/aosp12/packages/modules/IPsec/src/java/com/android/internal/net/ipsec/ike/crypto/ |
H A D | IkeMacPrf.java | 108 keyBytes = modifyAesXCbcKeyIfNeeded(keyBytes); in signBytes() 114 keyBytes = modifyAesCmacKeyIfNeeded(keyBytes); in signBytes() 117 return super.signBytes(keyBytes, dataToSign); in signBytes() 133 if (keyBytes.length < 16) { in modifyAesXCbcKeyIfNeeded() 134 keyBytes = Arrays.copyOf(keyBytes, 16); in modifyAesXCbcKeyIfNeeded() 135 } else if (keyBytes.length > 16) { in modifyAesXCbcKeyIfNeeded() 136 keyBytes = new AesXCbcImpl().mac(new byte[16], keyBytes, false /*needTruncation*/); in modifyAesXCbcKeyIfNeeded() 139 return keyBytes; in modifyAesXCbcKeyIfNeeded() 151 if (keyBytes.length != 16) { in modifyAesCmacKeyIfNeeded() 152 keyBytes = signBytes(new byte[16], keyBytes); in modifyAesCmacKeyIfNeeded() [all …]
|
H A D | IkeNormalModeCipher.java | 62 private byte[] doCipherAction(byte[] data, byte[] keyBytes, byte[] ivBytes, int opmode) in doCipherAction() argument 64 if (getKeyLength() != keyBytes.length) { in doCipherAction() 69 + keyBytes.length); in doCipherAction() 72 byte[] secretKeyBytes = Arrays.copyOfRange(keyBytes, 0, keyBytes.length - mSaltLen); in doCipherAction() 73 byte[] salt = Arrays.copyOfRange(keyBytes, secretKeyBytes.length, keyBytes.length); in doCipherAction() 109 public byte[] encrypt(byte[] paddedData, byte[] keyBytes, byte[] ivBytes) { in encrypt() argument 111 return doCipherAction(paddedData, keyBytes, ivBytes, Cipher.ENCRYPT_MODE); in encrypt() 127 public byte[] decrypt(byte[] encryptedData, byte[] keyBytes, byte[] ivBytes) in decrypt() argument 129 return doCipherAction(encryptedData, keyBytes, ivBytes, Cipher.DECRYPT_MODE); in decrypt()
|
H A D | IkeMacIntegrity.java | 133 public byte[] signBytes(byte[] keyBytes, byte[] dataToSign) { in signBytes() argument 136 return new AesXCbcImpl().mac(keyBytes, dataToSign, true /*needTruncation*/); in signBytes() 141 return super.signBytes(keyBytes, dataToSign); in signBytes() 163 public byte[] generateChecksum(byte[] keyBytes, byte[] dataToAuthenticate) { in generateChecksum() argument 164 if (getKeyLength() != keyBytes.length) { in generateChecksum() 169 + keyBytes.length); in generateChecksum() 172 byte[] signedBytes = signBytes(keyBytes, dataToAuthenticate); in generateChecksum()
|
H A D | IkeCombinedModeCipher.java | 87 byte[] data, byte[] additionalAuthData, byte[] keyBytes, byte[] ivBytes, int opmode) in doCipherAction() argument 92 ByteBuffer secretKeyAndSaltBuffer = ByteBuffer.wrap(keyBytes); in doCipherAction() 93 byte[] secretKeyBytes = new byte[keyBytes.length - mSaltLen]; in doCipherAction() 157 byte[] paddedData, byte[] additionalAuthData, byte[] keyBytes, byte[] ivBytes) { in encrypt() argument 160 paddedData, additionalAuthData, keyBytes, ivBytes, Cipher.ENCRYPT_MODE); in encrypt() 179 byte[] keyBytes, in decrypt() argument 187 keyBytes, in decrypt()
|
H A D | AesXCbcImpl.java | 57 public byte[] mac(byte[] keyBytes, byte[] dataToSign, boolean needTruncation) { in mac() argument 71 byte[] key1 = encryptAesBlock(keyBytes, HexDump.hexStringToByteArray(KEY1_SEED_HEX_STRING)); in mac() 72 byte[] key2 = encryptAesBlock(keyBytes, HexDump.hexStringToByteArray(KEY2_SEED_HEX_STRING)); in mac() 73 byte[] key3 = encryptAesBlock(keyBytes, HexDump.hexStringToByteArray(KEY3_SEED_HEX_STRING)); in mac() 139 private byte[] encryptAesBlock(byte[] keyBytes, byte[] dataToEncrypt) { in encryptAesBlock() argument 147 Cipher.ENCRYPT_MODE, new SecretKeySpec(keyBytes, mCipher.getAlgorithm()), iv); in encryptAesBlock()
|
H A D | IkeMac.java | 66 public byte[] signBytes(byte[] keyBytes, byte[] dataToSign) { in signBytes() argument 69 SecretKeySpec secretKey = new SecretKeySpec(keyBytes, getAlgorithmName()); in signBytes()
|
/aosp12/frameworks/libs/net/common/framework/com/android/net/module/util/ |
H A D | DnsSdTxtRecord.java | 70 byte[] keyBytes; in set() 83 keyBytes = key.getBytes("US-ASCII"); in set() 89 for (int i = 0; i < keyBytes.length; i++) { in set() 90 if (keyBytes[i] == '=') { in set() 95 if (keyBytes.length + valLen >= 255) { in set() 103 insert(keyBytes, valBytes, currentLoc); in set() 168 private void insert(byte[] keyBytes, byte[] value, int index) { in insert() argument 178 avLen = keyBytes.length + valLen + (value != null ? 1 : 0); in insert() 186 System.arraycopy(keyBytes, 0, mData, insertion + 1, keyBytes.length); in insert() 188 mData[insertion + 1 + keyBytes.length] = mSeparator; in insert() [all …]
|
/aosp12/frameworks/base/media/java/android/media/ |
H A D | MediaMetrics.java | 360 final byte[] keyBytes = key.getBytes(MEDIAMETRICS_CHARSET); in Item() 361 final int keyLength = keyBytes.length; in Item() 384 .put(keyBytes).put((byte) 0) in Item() 424 final byte[] keyBytes = key.getBytes(MEDIAMETRICS_CHARSET); in putInt() 429 .put(keyBytes).put((byte) 0) // key, zero terminated in putInt() 447 final byte[] keyBytes = key.getBytes(MEDIAMETRICS_CHARSET); in putLong() 452 .put(keyBytes).put((byte) 0) // key, zero terminated in putLong() 475 .put(keyBytes).put((byte) 0) // key, zero terminated in putDouble() 499 .put(keyBytes).put((byte) 0) // key, zero terminated in putString() 744 final int keyLength = keyBytes.length; in reserveProperty() [all …]
|
/aosp12/frameworks/base/packages/BackupEncryption/test/robolectric/src/com/android/server/backup/encryption/chunking/cdc/ |
H A D | FingerprintMixerTest.java | 77 byte[] keyBytes = new byte[KEY_SIZE_BITS / 8]; in create_withUnencodableSecretKey_throwsInvalidKeyException() 79 new UnencodableSecretKeySpec(keyBytes, 0, keyBytes.length, KEY_ALGORITHM); in create_withUnencodableSecretKey_throwsInvalidKeyException() 182 byte[] keyBytes = new byte[KEY_SIZE_BITS / 8]; in randomKey() 183 mSeededRandom.nextBytes(keyBytes); in randomKey() 184 return new SecretKeySpec(keyBytes, 0, keyBytes.length, KEY_ALGORITHM); in randomKey()
|
/aosp12/packages/modules/IPsec/src/java/com/android/internal/net/crypto/ |
H A D | KeyGenerationUtils.java | 42 ByteSigner byteSigner, byte[] keyBytes, byte[] dataToSign, int keyMaterialLen) { in prfPlus() argument 54 previousMac = byteSigner.signBytes(keyBytes, dataToSignBuffer.array()); in prfPlus() 79 byte[] signBytes(byte[] keyBytes, byte[] dataToSign); in signBytes() argument
|
/aosp12/packages/modules/IPsec/tests/iketests/src/java/com/android/internal/net/ipsec/ike/utils/ |
H A D | IkeCertUtilsTest.java | 80 byte[] keyBytes = HexDump.hexStringToByteArray(PRIVATE_KEY_HEX); in testCreatePrivateKeyFromByteArray() 81 PrivateKey key = IkeCertUtils.privateKeyFromByteArray(keyBytes); in testCreatePrivateKeyFromByteArray() 83 assertArrayEquals(keyBytes, key.getEncoded()); in testCreatePrivateKeyFromByteArray()
|
/aosp12/frameworks/base/packages/BackupEncryption/src/com/android/server/backup/encryption/chunking/cdc/ |
H A D | FingerprintMixer.java | 61 byte[] keyBytes = secretKey.getEncoded(); in FingerprintMixer() 62 if (keyBytes == null) { in FingerprintMixer() 66 Hkdf.hkdf(keyBytes, salt, DERIVED_KEY_NAME.getBytes(StandardCharsets.UTF_8)); in FingerprintMixer()
|
/aosp12/frameworks/base/packages/BackupEncryption/src/com/android/server/backup/encryption/keys/ |
H A D | TertiaryKeyStore.java | 84 byte[] keyBytes = getEncodedKey(KeyWrapUtils.wrap(mSecondaryKey.getSecretKey(), key)); in save() 93 mSecondaryKey.getAlias(), applicationName, keyBytes)); in save() 175 byte[] keyBytes = getEncodedKey(wrappedKeysByApplicationName.get(applicationName)); in putAll() 179 mSecondaryKey.getAlias(), applicationName, keyBytes)); in putAll()
|
/aosp12/packages/modules/IPsec/tests/iketests/src/java/com/android/internal/net/ipsec/ike/crypto/ |
H A D | IkeMacIntegrityTest.java | 211 byte[] keyBytes = TestUtils.hexStringToByteArray(AUTH_AES128XCBC_KEY_HEX_STRING); in testBuildIpSecAlgorithmFromAuthAes128XCbcMac() 214 IpSecAlgorithm algo = mAes128XCbcIntgerityMac.buildIpSecAlgorithmWithKey(keyBytes); in testBuildIpSecAlgorithmFromAuthAes128XCbcMac() 216 assertArrayEquals(keyBytes, algo.getKey()); in testBuildIpSecAlgorithmFromAuthAes128XCbcMac() 219 mAes128XCbcIntgerityMac.buildIpSecAlgorithmWithKey(keyBytes); in testBuildIpSecAlgorithmFromAuthAes128XCbcMac()
|
/aosp12/frameworks/base/services/tests/servicestests/src/com/android/server/locksettings/ |
H A D | SP800DeriveTests.java | 38 byte[] keyBytes = HexDump.hexStringToByteArray( in testFixedInput() 41 SP800Derive sk = new SP800Derive(keyBytes); in testFixedInput()
|
/aosp12/packages/modules/IPsec/src/java/com/android/internal/net/eap/crypto/ |
H A D | HmacSha256ByteSigner.java | 47 public byte[] signBytes(byte[] keyBytes, byte[] dataToSign) { in signBytes() argument 50 mac.init(new SecretKeySpec(keyBytes, MAC_ALGORITHM_STRING)); in signBytes()
|
/aosp12/frameworks/base/services/core/java/com/android/server/locksettings/ |
H A D | RebootEscrowKey.java | 44 static RebootEscrowKey fromKeyBytes(byte[] keyBytes) { in fromKeyBytes() argument 45 return new RebootEscrowKey(new SecretKeySpec(keyBytes, KEY_ALGO)); in fromKeyBytes()
|
H A D | SP800Derive.java | 39 SP800Derive(byte[] keyBytes) { in SP800Derive() argument 40 mKeyBytes = keyBytes; in SP800Derive()
|
H A D | SyntheticPasswordCrypto.java | 102 public static byte[] encrypt(byte[] keyBytes, byte[] personalisation, byte[] message) { in encrypt() argument 103 byte[] keyHash = personalisedHash(personalisation, keyBytes); in encrypt() 116 public static byte[] decrypt(byte[] keyBytes, byte[] personalisation, byte[] ciphertext) { in decrypt() argument 117 byte[] keyHash = personalisedHash(personalisation, keyBytes); in decrypt()
|
/aosp12/hardware/interfaces/rebootescrow/aidl/default/ |
H A D | RebootEscrow.cpp | 63 auto keyBytes = hadamard::DecodeKey(encodedBytes); in retrieveKey() local 65 *_aidl_return = keyBytes; in retrieveKey()
|
/aosp12/frameworks/base/services/core/java/com/android/server/locksettings/recoverablekeystore/ |
H A D | RecoverableKeyGenerator.java | 144 @NonNull byte[] keyBytes, @Nullable byte[] metadata) in importKey() argument 146 SecretKey key = new SecretKeySpec(keyBytes, SECRET_KEY_ALGORITHM); in importKey()
|
H A D | RecoverableKeyStoreManager.java | 752 public @Nullable String importKey(@NonNull String alias, @NonNull byte[] keyBytes) in importKey() argument 754 return importKeyWithMetadata(alias, keyBytes, /*metadata=*/ null); in importKey() 769 public @Nullable String importKeyWithMetadata(@NonNull String alias, @NonNull byte[] keyBytes, in importKeyWithMetadata() argument 773 Objects.requireNonNull(keyBytes, "keyBytes is null"); in importKeyWithMetadata() 774 if (keyBytes.length != RecoverableKeyGenerator.KEY_SIZE_BITS / Byte.SIZE) { in importKeyWithMetadata() 797 mRecoverableKeyGenerator.importKey(encryptionKey, userId, uid, alias, keyBytes, in importKeyWithMetadata() 801 mApplicationKeyStorage.setSymmetricKeyEntry(userId, uid, alias, keyBytes); in importKeyWithMetadata()
|
/aosp12/frameworks/base/core/java/android/security/keystore/recovery/ |
H A D | RecoveryController.java | 620 public @NonNull Key importKey(@NonNull String alias, @NonNull byte[] keyBytes) in importKey() argument 623 String grantAlias = mBinder.importKey(alias, keyBytes); in importKey() 662 public @NonNull Key importKey(@NonNull String alias, @NonNull byte[] keyBytes, in importKey() argument 666 String grantAlias = mBinder.importKeyWithMetadata(alias, keyBytes, metadata); in importKey()
|
/aosp12/frameworks/base/services/tests/servicestests/src/com/android/server/locksettings/recoverablekeystore/ |
H A D | SecureBoxTest.java | 363 private static PrivateKey decodePrivateKey(byte[] keyBytes) throws Exception { in decodePrivateKey() argument 364 assertThat(keyBytes.length).isEqualTo(32); in decodePrivateKey() 365 BigInteger priv = new BigInteger(/*signum=*/ 1, keyBytes); in decodePrivateKey()
|
H A D | TestData.java | 455 byte[] keyBytes = Base64.getDecoder().decode(INSECURE_PRIVATE_KEY_FOR_ENDPOINT1_BASE64); in getInsecurePrivateKeyForEndpoint1() 457 PKCS8EncodedKeySpec skSpec = new PKCS8EncodedKeySpec(keyBytes); in getInsecurePrivateKeyForEndpoint1()
|