Home
last modified time | relevance | path

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

/cts/tests/tests/keystore/src/android/keystore/cts/
DRSACipherTest.java59 Cipher cipher = Cipher.getInstance("RSA/ECB/NoPadding", provider); in testNoPaddingEncryptionAndDecryptionSucceedsWithInputShorterThanModulus() local
60 cipher.init(Cipher.ENCRYPT_MODE, publicKey); in testNoPaddingEncryptionAndDecryptionSucceedsWithInputShorterThanModulus()
61 MoreAsserts.assertEquals(expectedOutput, cipher.doFinal(input)); in testNoPaddingEncryptionAndDecryptionSucceedsWithInputShorterThanModulus()
63 cipher.init(Cipher.DECRYPT_MODE, privateKey); in testNoPaddingEncryptionAndDecryptionSucceedsWithInputShorterThanModulus()
64 MoreAsserts.assertEquals(expectedOutput, cipher.doFinal(input)); in testNoPaddingEncryptionAndDecryptionSucceedsWithInputShorterThanModulus()
89 Cipher cipher = Cipher.getInstance("RSA/ECB/NoPadding", provider); in testNoPaddingEncryptionSucceedsWithPlaintextOneSmallerThanModulus() local
90 cipher.init(Cipher.ENCRYPT_MODE, publicKey); in testNoPaddingEncryptionSucceedsWithPlaintextOneSmallerThanModulus()
91 byte[] ciphertext = cipher.doFinal(plaintext); in testNoPaddingEncryptionSucceedsWithPlaintextOneSmallerThanModulus()
92 cipher.init(Cipher.DECRYPT_MODE, privateKey); in testNoPaddingEncryptionSucceedsWithPlaintextOneSmallerThanModulus()
93 MoreAsserts.assertEquals(plaintext, cipher.doFinal(ciphertext)); in testNoPaddingEncryptionSucceedsWithPlaintextOneSmallerThanModulus()
[all …]
DCipherTest.java345 Cipher cipher = Cipher.getInstance(algorithm, provider); in testAndroidKeyStoreKeysHandledByAndroidKeyStoreProviderWhenDecrypting() local
346 cipher.init(Cipher.ENCRYPT_MODE, key.getKeystoreBackedEncryptionKey()); in testAndroidKeyStoreKeysHandledByAndroidKeyStoreProviderWhenDecrypting()
347 AlgorithmParameters params = cipher.getParameters(); in testAndroidKeyStoreKeysHandledByAndroidKeyStoreProviderWhenDecrypting()
350 cipher = Cipher.getInstance(algorithm); in testAndroidKeyStoreKeysHandledByAndroidKeyStoreProviderWhenDecrypting()
352 cipher.init(Cipher.DECRYPT_MODE, decryptionKey, params); in testAndroidKeyStoreKeysHandledByAndroidKeyStoreProviderWhenDecrypting()
353 assertSame(provider, cipher.getProvider()); in testAndroidKeyStoreKeysHandledByAndroidKeyStoreProviderWhenDecrypting()
356 cipher = Cipher.getInstance(algorithm); in testAndroidKeyStoreKeysHandledByAndroidKeyStoreProviderWhenDecrypting()
358 cipher.init(Cipher.UNWRAP_MODE, decryptionKey, params); in testAndroidKeyStoreKeysHandledByAndroidKeyStoreProviderWhenDecrypting()
360 cipher.init(Cipher.UNWRAP_MODE, decryptionKey); in testAndroidKeyStoreKeysHandledByAndroidKeyStoreProviderWhenDecrypting()
362 assertSame(provider, cipher.getProvider()); in testAndroidKeyStoreKeysHandledByAndroidKeyStoreProviderWhenDecrypting()
[all …]
DAESCipherNistCavpKatTest.java284 Cipher cipher = Cipher.getInstance("AES/" + mode + "/NoPadding"); in runKatTest() local
288 cipher.init(opmode, key, new IvParameterSpec(testVector.iv)); in runKatTest()
290 cipher.init(opmode, key); in runKatTest()
294 byte[] actualOutput = cipher.doFinal(input); in runKatTest()
DAndroidKeyStoreTest.java1918 String cipher = privateKey.getAlgorithm() + "/NONE/NOPADDING"; in testKeyStore_Encrypting_RSA_NONE_NOPADDING() local
1919 Cipher encrypt = Cipher.getInstance(cipher); in testKeyStore_Encrypting_RSA_NONE_NOPADDING()
2269 Cipher cipher = Cipher.getInstance("AES/GCM/NoPadding"); in testKeyStore_LargeNumberOfKeysSupported_AES() local
2270 cipher.init(Cipher.ENCRYPT_MODE, keystoreKey1); in testKeyStore_LargeNumberOfKeysSupported_AES()
2271 byte[] ciphertext = cipher.doFinal(plaintext); in testKeyStore_LargeNumberOfKeysSupported_AES()
2272 AlgorithmParameters cipherParams = cipher.getParameters(); in testKeyStore_LargeNumberOfKeysSupported_AES()
2273 cipher = Cipher.getInstance(cipher.getAlgorithm()); in testKeyStore_LargeNumberOfKeysSupported_AES()
2274 cipher.init(Cipher.DECRYPT_MODE, key1, cipherParams); in testKeyStore_LargeNumberOfKeysSupported_AES()
2275 MoreAsserts.assertEquals(plaintext, cipher.doFinal(ciphertext)); in testKeyStore_LargeNumberOfKeysSupported_AES()
2277 cipher = Cipher.getInstance(cipher.getAlgorithm()); in testKeyStore_LargeNumberOfKeysSupported_AES()
[all …]
DImportWrappedKeyTest.java329 Cipher cipher = Cipher.getInstance("AES/GCM/NoPadding"); in wrapKey() local
332 cipher.init(Cipher.ENCRYPT_MODE, secretKeySpec, gcmParameterSpec); in wrapKey()
335 cipher.updateAAD(aad); in wrapKey()
336 byte[] encryptedSecureKey = cipher.doFinal(keyMaterial); in wrapKey()
/cts/apps/CtsVerifier/src/com/android/cts/verifier/managedprovisioning/
DAuthenticationBoundKeyTestActivity.java255 Cipher cipher = Cipher.getInstance(CIPHER_TRANSFORMATION); in tryEncryptWithLockscreenKey() local
256 cipher.init(Cipher.ENCRYPT_MODE, loadSecretKey(LOCKSCREEN)); in tryEncryptWithLockscreenKey()
257 cipher.doFinal(SECRET_BYTE_ARRAY); in tryEncryptWithLockscreenKey()
276 Cipher cipher = Cipher.getInstance(CIPHER_TRANSFORMATION); in initFingerprintEncryptionCipher() local
277 cipher.init(Cipher.ENCRYPT_MODE, loadSecretKey(FINGERPRINT)); in initFingerprintEncryptionCipher()
278 return cipher; in initFingerprintEncryptionCipher()
292 private boolean tryEncryptWithFingerprintKey(Cipher cipher) { in tryEncryptWithFingerprintKey() argument
295 cipher.doFinal(SECRET_BYTE_ARRAY); in tryEncryptWithFingerprintKey()
/cts/tests/tests/identity/src/android/security/identity/cts/
DEphemeralKeyTest.java188 Cipher cipher = Cipher.getInstance("AES/GCM/NoPadding"); in encryptMessageToHolder() local
190 cipher.init(Cipher.ENCRYPT_MODE, mReaderSecretKey, encryptionParameterSpec); in encryptMessageToHolder()
191 messageCiphertext = cipher.doFinal(messagePlaintext); // This includes the auth tag in encryptMessageToHolder()
213 final Cipher cipher = Cipher.getInstance("AES/GCM/NoPadding"); in decryptMessageFromHolder() local
214 cipher.init(Cipher.DECRYPT_MODE, mSecretKey, new GCMParameterSpec(128, iv.array())); in decryptMessageFromHolder()
215 plaintext = cipher.doFinal(messageCiphertext); in decryptMessageFromHolder()
DUserAuthTest.java138 Cipher cipher = Cipher.getInstance("AES/GCM/NoPadding"); in checkAuthBoundKey() local
139 cipher.init(Cipher.ENCRYPT_MODE, secretKey); in checkAuthBoundKey()
141 byte[] cipherText = cipher.doFinal(clearText); in checkAuthBoundKey()
/cts/apps/CtsVerifier/src/com/android/cts/verifier/security/
DScreenLockBoundKeysTest.java147 Cipher cipher = Cipher.getInstance( in tryEncrypt() local
153 cipher.init(Cipher.ENCRYPT_MODE, secretKey); in tryEncrypt()
154 cipher.doFinal(SECRET_BYTE_ARRAY); in tryEncrypt()
/cts/tests/tests/net/ipsec/src/android/net/ipsec/ike/cts/
DPacketUtils.java400 Cipher cipher = Cipher.getInstance(AES_CBC); in getCiphertext() local
401 cipher.init(Cipher.ENCRYPT_MODE, secretKeySpec, ivParameterSpec); in getCiphertext()
402 byte[] encrypted = cipher.doFinal(getByteArrayFromBuffer(paddedPayload)); in getCiphertext()
/cts/tests/tests/net/src/android/net/cts/
DPacketUtils.java394 Cipher cipher = Cipher.getInstance(AES_CBC); in getCiphertext() local
395 cipher.init(Cipher.ENCRYPT_MODE, secretKeySpec, ivParameterSpec); in getCiphertext()
396 byte[] encrypted = cipher.doFinal(getByteArrayFromBuffer(paddedPayload)); in getCiphertext()
/cts/tests/tests/accounts/src/android/accounts/cts/
DAccountManagerTest.java3438 byte[] cipher = new byte[] {
3443 sessionBundle.putByteArray(KEY_CIPHER, cipher);