Home
last modified time | relevance | path

Searched refs:plaintext (Results 1 – 7 of 7) sorted by relevance

/cts/tests/tests/keystore/src/android/keystore/cts/
DRSACipherTest.java122 byte[] plaintext = in testNoPaddingEncryptionSucceedsWithPlaintextOneSmallerThanModulus()
126 byte[] ciphertext = cipher.doFinal(plaintext); in testNoPaddingEncryptionSucceedsWithPlaintextOneSmallerThanModulus()
128 assertArrayEquals(plaintext, cipher.doFinal(ciphertext)); in testNoPaddingEncryptionSucceedsWithPlaintextOneSmallerThanModulus()
150 byte[] plaintext = TestUtils.getBigIntegerMagnitudeBytes(modulus); in testNoPaddingEncryptionFailsWithPlaintextEqualToModulus()
154 byte[] ciphertext = cipher.doFinal(plaintext); in testNoPaddingEncryptionFailsWithPlaintextEqualToModulus()
179 byte[] plaintext = in testNoPaddingEncryptionFailsWithPlaintextOneLargerThanModulus()
184 byte[] ciphertext = cipher.doFinal(plaintext); in testNoPaddingEncryptionFailsWithPlaintextOneLargerThanModulus()
213 byte[] plaintext = new byte[((modulus.bitLength() + 7) / 8) + 1]; in testNoPaddingEncryptionFailsWithPlaintextOneByteLongerThanModulus()
217 byte[] ciphertext = cipher.doFinal(plaintext); in testNoPaddingEncryptionFailsWithPlaintextOneByteLongerThanModulus()
250 byte[] plaintext = cipher.doFinal(ciphertext); in testNoPaddingDecryptionFailsWithCiphertextOneByteLongerThanModulus()
[all …]
DCipherTest.java150 private final byte[] plaintext; field in CipherTest.KatVector
163 private KatVector(byte[] plaintext, byte[] ciphertext) { in KatVector() argument
164 this(plaintext, null, ciphertext); in KatVector()
167 private KatVector(byte[] plaintext, AlgorithmParameterSpec params, byte[] ciphertext) { in KatVector() argument
168 this.plaintext = plaintext; in KatVector()
457 byte[] plaintext = truncatePlaintextIfNecessary( in testEmptyPlaintextEncryptsAndDecrypts()
459 if (plaintext == null) { in testEmptyPlaintextEncryptsAndDecrypts()
466 byte[] ciphertext = cipher.doFinal(plaintext); in testEmptyPlaintextEncryptsAndDecrypts()
467 byte[] expectedPlaintext = plaintext; in testEmptyPlaintextEncryptsAndDecrypts()
509 byte[] plaintext = truncatePlaintextIfNecessary( in testEncryptsAndDecryptsInterrupted()
[all …]
DImportWrappedKeyTest.java165 String plaintext = "hello, world"; in testKeyStore_ImportWrappedKey_AES() local
169 byte[] encrypted = c.doFinal(plaintext.getBytes()); in testKeyStore_ImportWrappedKey_AES()
174 assertEquals(new String(c.doFinal(encrypted)), plaintext); in testKeyStore_ImportWrappedKey_AES()
179 assertEquals(new String(c.doFinal(encrypted)), plaintext); in testKeyStore_ImportWrappedKey_AES()
289 String plaintext = "hello, world"; in testKeyStore_ImportWrappedKey_3DES() local
294 byte[] encrypted = c.doFinal(plaintext.getBytes()); in testKeyStore_ImportWrappedKey_3DES()
299 assertEquals(new String(c.doFinal(encrypted)), plaintext); in testKeyStore_ImportWrappedKey_3DES()
304 assertEquals(new String(c.doFinal(encrypted)), plaintext); in testKeyStore_ImportWrappedKey_3DES()
355 String plaintext = "hello, world"; in testKeyStore_ImportWrappedKey_RSA() local
363 byte[] encrypted = c.doFinal(plaintext.getBytes()); in testKeyStore_ImportWrappedKey_RSA()
[all …]
DAESCipherNistCavpKatTest.java286 testVector.plaintext = HexEncoding.decode(value); in runTestsForKatFile()
331 byte[] input = (encrypt) ? testVector.plaintext : testVector.ciphertext; in runKatTest()
333 byte[] expectedOutput = (encrypt) ? testVector.ciphertext : testVector.plaintext; in runKatTest()
359 public byte[] plaintext; field in AESCipherNistCavpKatTest.TestVector
DBlockCipherTestBase.java425 byte[] plaintext = new byte[getBlockSize()]; in testIvGeneratedAndUsedWhenEncryptingWithoutExplicitIv()
426 byte[] ciphertext = doFinal(plaintext); in testIvGeneratedAndUsedWhenEncryptingWithoutExplicitIv()
430 assertArrayEquals(plaintext, decryptedPlaintext); in testIvGeneratedAndUsedWhenEncryptingWithoutExplicitIv()
782 byte[] plaintext = getKatPlaintext(); in testKatEncryptOneByteAtATime()
788 for (int plaintextIndex = 0; plaintextIndex < plaintext.length; plaintextIndex++) { in testKatEncryptOneByteAtATime()
789 byte[] output = update(new byte[] {plaintext[plaintextIndex]}); in testKatEncryptOneByteAtATime()
806 subarray(expectedCiphertext, plaintext.length, in testKatEncryptOneByteAtATime()
827 for (int plaintextIndex = 0; plaintextIndex < plaintext.length; plaintextIndex++) { in testKatEncryptOneByteAtATime()
828 byte[] output = update(new byte[] {plaintext[plaintextIndex]}); in testKatEncryptOneByteAtATime()
1135 byte[] plaintext = concat(basePlaintext, new byte[lastInputBlockUnusedByteCount]); in testGeneratedPadding()
[all …]
DAndroidKeyStoreTest.java1864 final String plaintext = "My awesome plaintext message!"; in testKeyStore_SetKeyEntry_ReplacedWithSameGeneratedSecretKey() local
1880 final byte[] ciphertext = cipher.doFinal(plaintext.getBytes()); in testKeyStore_SetKeyEntry_ReplacedWithSameGeneratedSecretKey()
1893 plaintext2, plaintext.getBytes()); in testKeyStore_SetKeyEntry_ReplacedWithSameGeneratedSecretKey()
2351 byte[] plaintext = "This is a test".getBytes("UTF-8"); in testKeyStore_LargeNumberOfKeysSupported_AES()
2354 byte[] ciphertext = cipher.doFinal(plaintext); in testKeyStore_LargeNumberOfKeysSupported_AES()
2358 assertArrayEquals(plaintext, cipher.doFinal(ciphertext)); in testKeyStore_LargeNumberOfKeysSupported_AES()
2362 ciphertext = cipher.doFinal(plaintext); in testKeyStore_LargeNumberOfKeysSupported_AES()
2366 assertArrayEquals(plaintext, cipher.doFinal(ciphertext)); in testKeyStore_LargeNumberOfKeysSupported_AES()
/cts/tests/tests/identity/src/android/security/identity/cts/
DEphemeralKeyTest.java212 byte[] plaintext = null; in decryptMessageFromHolder()
216 plaintext = cipher.doFinal(messageCiphertext); in decryptMessageFromHolder()
227 return plaintext; in decryptMessageFromHolder()