Home
last modified time | relevance | path

Searched refs:cipher (Results 1 – 17 of 17) sorted by relevance

/frameworks/base/services/core/java/com/android/server/accounts/
DCryptoHelper.java63 Cipher cipher = Cipher.getInstance(CIPHER_ALGORITHM); in encryptBundle() local
64 cipher.init(Cipher.ENCRYPT_MODE, mEncryptionKey); in encryptBundle()
65 byte[] encryptedBytes = cipher.doFinal(clearBytes); in encryptBundle()
66 byte[] iv = cipher.getIV(); in encryptBundle()
89 Cipher cipher = Cipher.getInstance(CIPHER_ALGORITHM); in decryptBundle() local
90 cipher.init(Cipher.DECRYPT_MODE, mEncryptionKey, ivSpec); in decryptBundle()
91 byte[] decryptedBytes = cipher.doFinal(encryptedBytes); in decryptBundle()
115 …private byte[] createMac(@NonNull byte[] cipher, @NonNull byte[] iv) throws GeneralSecurityExcepti… in createMac() argument
118 mac.update(cipher); in createMac()
/frameworks/base/services/core/java/com/android/server/locksettings/recoverablekeystore/
DWrappedKey.java72 Cipher cipher; in fromSecretKey() local
74 cipher = Cipher.getInstance(KEY_WRAP_CIPHER_ALGORITHM); in fromSecretKey()
80 cipher.init(Cipher.WRAP_MODE, wrappingKey.getKey()); in fromSecretKey()
83 encryptedKeyMaterial = cipher.wrap(key); in fromSecretKey()
101 /*nonce=*/ cipher.getIV(), in fromSecretKey()
206 Cipher cipher = Cipher.getInstance(KEY_WRAP_CIPHER_ALGORITHM); in unwrapKeys() local
221 cipher.init( in unwrapKeys()
227 key = (SecretKey) cipher.unwrap( in unwrapKeys()
DSecureBox.java343 Cipher cipher; in aesGcmInternal() local
345 cipher = Cipher.getInstance(ENC_ALG); in aesGcmInternal()
353 cipher.init(Cipher.DECRYPT_MODE, key, spec); in aesGcmInternal()
355 cipher.init(Cipher.ENCRYPT_MODE, key, spec); in aesGcmInternal()
362 cipher.updateAAD(aad); in aesGcmInternal()
363 return cipher.doFinal(text); in aesGcmInternal()
/frameworks/base/services/backup/java/com/android/server/backup/encryption/chunking/
DChunkEncryptor.java61 Cipher cipher; in encrypt() local
63 cipher = Cipher.getInstance(CIPHER_ALGORITHM); in encrypt()
64 cipher.init( in encrypt()
76 encryptedBytes = cipher.doFinal(plaintext); in encrypt()
/frameworks/base/services/core/java/com/android/server/locksettings/
DSyntheticPasswordCrypto.java63 Cipher cipher = Cipher.getInstance(KeyProperties.KEY_ALGORITHM_AES + "/" in decrypt() local
65 cipher.init(Cipher.DECRYPT_MODE, key, new GCMParameterSpec(DEFAULT_TAG_LENGTH_BITS, iv)); in decrypt()
66 return cipher.doFinal(ciphertext); in decrypt()
76 Cipher cipher = Cipher.getInstance( in encrypt() local
79 cipher.init(Cipher.ENCRYPT_MODE, key); in encrypt()
80 byte[] ciphertext = cipher.doFinal(blob); in encrypt()
81 byte[] iv = cipher.getIV(); in encrypt()
85 final GCMParameterSpec spec = cipher.getParameters().getParameterSpec( in encrypt()
DLockSettingsService.java1155 Cipher cipher = Cipher.getInstance(KeyProperties.KEY_ALGORITHM_AES + "/" in getDecryptedPasswordForTiedProfile() local
1158 cipher.init(Cipher.DECRYPT_MODE, decryptionKey, new GCMParameterSpec(128, iv)); in getDecryptedPasswordForTiedProfile()
1159 decryptionResult = cipher.doFinal(encryptedPassword); in getDecryptedPasswordForTiedProfile()
1567 Cipher cipher = Cipher.getInstance( in tieProfileLockToParent() local
1570 cipher.init(Cipher.ENCRYPT_MODE, keyStoreEncryptionKey); in tieProfileLockToParent()
1571 encryptionResult = cipher.doFinal(password); in tieProfileLockToParent()
1572 iv = cipher.getIV(); in tieProfileLockToParent()
/frameworks/base/services/tests/servicestests/src/com/android/server/locksettings/recoverablekeystore/
DRecoverableKeyGeneratorTest.java130 Cipher cipher = Cipher.getInstance(KEY_WRAP_ALGORITHM); in generateAndStoreKey_storesTheWrappedVersionOfTheRawMaterial() local
131 cipher.init(Cipher.DECRYPT_MODE, mDecryptKey.getKey(), in generateAndStoreKey_storesTheWrappedVersionOfTheRawMaterial()
133 byte[] unwrappedMaterial = cipher.doFinal(wrappedKey.getKeyMaterial()); in generateAndStoreKey_storesTheWrappedVersionOfTheRawMaterial()
164 Cipher cipher = Cipher.getInstance(KEY_WRAP_ALGORITHM); in importKey_storesTheWrappedVersionOfTheRawMaterial() local
165 cipher.init(Cipher.DECRYPT_MODE, mDecryptKey.getKey(), in importKey_storesTheWrappedVersionOfTheRawMaterial()
167 byte[] unwrappedMaterial = cipher.doFinal(wrappedKey.getKeyMaterial()); in importKey_storesTheWrappedVersionOfTheRawMaterial()
DWrappedKeyTest.java77 Cipher cipher = Cipher.getInstance(CIPHER_ALGORITHM); in fromSecretKey_createsWrappedKeyThatCanBeUnwrapped_nullMetadata() local
78 cipher.init( in fromSecretKey_createsWrappedKeyThatCanBeUnwrapped_nullMetadata()
82 SecretKey unwrappedKey = (SecretKey) cipher.unwrap( in fromSecretKey_createsWrappedKeyThatCanBeUnwrapped_nullMetadata()
96 Cipher cipher = Cipher.getInstance(CIPHER_ALGORITHM); in fromSecretKey_createsWrappedKeyThatCanBeUnwrapped_nonNullMetadata() local
97 cipher.init( in fromSecretKey_createsWrappedKeyThatCanBeUnwrapped_nonNullMetadata()
101 SecretKey unwrappedKey = (SecretKey) cipher.unwrap( in fromSecretKey_createsWrappedKeyThatCanBeUnwrapped_nonNullMetadata()
/frameworks/opt/net/wifi/service/java/com/android/server/wifi/util/
DDataIntegrityChecker.java176 Cipher cipher = Cipher.getInstance(CIPHER_ALGORITHM); in encrypt() local
179 cipher.init(Cipher.ENCRYPT_MODE, secretKeyReference); in encrypt()
180 encryptedData = new EncryptedData(cipher.doFinal(data), cipher.getIV(), keyAlias); in encrypt()
202 Cipher cipher = Cipher.getInstance(CIPHER_ALGORITHM); in decrypt() local
206 cipher.init(Cipher.DECRYPT_MODE, secretKeyReference, spec); in decrypt()
207 decryptedData = cipher.doFinal(encryptedData.getEncryptedData()); in decrypt()
DInformationElementUtil.java532 private static int parseWpaCipher(int cipher) { in parseWpaCipher() argument
533 switch (cipher) { in parseWpaCipher()
542 + Integer.toHexString(cipher)); in parseWpaCipher()
547 private static int parseRsnCipher(int cipher) { in parseRsnCipher() argument
548 switch (cipher) { in parseRsnCipher()
561 + Integer.toHexString(cipher)); in parseRsnCipher()
778 private String cipherToString(int cipher) { in cipherToString() argument
779 switch (cipher) { in cipherToString()
DTelephonyUtil.java184 Cipher cipher = Cipher.getInstance(IMSI_CIPHER_TRANSFORMATION); in encryptDataUsingPublicKey() local
185 cipher.init(Cipher.ENCRYPT_MODE, key); in encryptDataUsingPublicKey()
186 byte[] encryptedBytes = cipher.doFinal(data); in encryptDataUsingPublicKey()
/frameworks/base/core/java/android/hardware/biometrics/
DCryptoObject.java39 public CryptoObject(@NonNull Cipher cipher) { in CryptoObject() argument
40 mCrypto = cipher; in CryptoObject()
DBiometricPrompt.java396 public CryptoObject(@NonNull Cipher cipher) { in CryptoObject() argument
397 super(cipher); in CryptoObject()
/frameworks/base/services/robotests/backup/src/com/android/server/backup/encryption/chunking/
DChunkEncryptorTest.java149 Cipher cipher = Cipher.getInstance(CIPHER_ALGORITHM); in encrypt_decryptedResultCorrespondsToPlaintext() local
150 cipher.init( in encrypt_decryptedResultCorrespondsToPlaintext()
154 byte[] decrypted = cipher.doFinal(chunk.encryptedBytes()); in encrypt_decryptedResultCorrespondsToPlaintext()
/frameworks/opt/net/wifi/tests/wifitests/src/com/android/server/wifi/util/
DTelephonyUtilTest.java136 Cipher cipher = mock(Cipher.class); in getEncryptedIdentity_WithRfc4648() local
150 when(Cipher.getInstance(anyString())).thenReturn(cipher); in getEncryptedIdentity_WithRfc4648()
151 when(cipher.doFinal(any(byte[].class))).thenReturn(permanentIdentity.getBytes()); in getEncryptedIdentity_WithRfc4648()
177 Cipher cipher = mock(Cipher.class); in getEncryptedIdentityFailed() local
184 when(Cipher.getInstance(anyString())).thenReturn(cipher); in getEncryptedIdentityFailed()
185 when(cipher.doFinal(any(byte[].class))).thenThrow(BadPaddingException.class); in getEncryptedIdentityFailed()
/frameworks/base/core/java/android/hardware/fingerprint/
DFingerprintManager.java120 public CryptoObject(@NonNull Cipher cipher) { in CryptoObject() argument
121 super(cipher); in CryptoObject()
/frameworks/base/config/
Dhiddenapi-greylist-max-o.txt113184 Ljava/security/Signature$CipherAdapter;->cipher:Ljavax/crypto/Cipher;
119914 Ljavax/crypto/CipherInputStream;->cipher:Ljavax/crypto/Cipher;
119923 Ljavax/crypto/CipherOutputStream;->cipher:Ljavax/crypto/Cipher;