/external/boringssl/src/crypto/fipsmodule/aes/ |
aes_test.cc | 31 std::vector<uint8_t> key, plaintext, ciphertext; local 33 ASSERT_TRUE(t->GetBytes(&plaintext, "Plaintext")); 36 ASSERT_EQ(static_cast<unsigned>(AES_BLOCK_SIZE), plaintext.size()); 44 AES_encrypt(plaintext.data(), block, &aes_key); 48 OPENSSL_memcpy(block, plaintext.data(), AES_BLOCK_SIZE); 56 EXPECT_EQ(Bytes(plaintext), Bytes(block)); 61 EXPECT_EQ(Bytes(plaintext), Bytes(block)); 73 std::vector<uint8_t> key, plaintext, ciphertext; local 75 ASSERT_TRUE(t->GetBytes(&plaintext, "Plaintext")) [all...] |
/prebuilts/go/darwin-x86/src/crypto/cipher/ |
cfb_test.go | 20 key, iv, plaintext, ciphertext string 58 plaintext, err := hex.DecodeString(test.plaintext) 72 ciphertext := make([]byte, len(plaintext)) 74 cfb.XORKeyStream(ciphertext, plaintext) 85 t.Errorf("#%d: wrong plaintext: got %x, expected %x", i, plaintextCopy, plaintext) 97 plaintext := []byte("this is the plaintext. this is the plaintext." [all...] |
ofb_test.go | 79 plaintext := tt.in[0 : len(tt.in)-j] 81 ciphertext := make([]byte, len(plaintext)) 82 ofb.XORKeyStream(ciphertext, plaintext) 83 if !bytes.Equal(ciphertext, tt.out[:len(plaintext)]) { 84 t.Errorf("%s/%d: encrypting\ninput % x\nhave % x\nwant % x", test, len(plaintext), plaintext, ciphertext, tt.out) 91 plaintext := make([]byte, len(ciphertext)) 92 ofb.XORKeyStream(plaintext, ciphertext) 93 if !bytes.Equal(plaintext, tt.in[:len(ciphertext)]) { 94 t.Errorf("%s/%d: decrypting\nhave % x\nwant % x", test, len(ciphertext), plaintext, tt.in [all...] |
example_test.go | 21 plaintext := []byte("exampleplaintext") 39 ciphertext := aesgcm.Seal(nil, nonce, plaintext, nil) 61 plaintext, err := aesgcm.Open(nil, nonce, ciphertext, nil) 66 fmt.Printf("%s\n", plaintext) 97 // If the original plaintext lengths are not a multiple of the block 111 plaintext := []byte("exampleplaintext") 116 // assume that the plaintext is already of the correct length. 117 if len(plaintext)%aes.BlockSize != 0 { 118 panic("plaintext is not a multiple of the block size") 128 ciphertext := make([]byte, aes.BlockSize+len(plaintext)) [all...] |
/prebuilts/go/linux-x86/src/crypto/cipher/ |
cfb_test.go | 20 key, iv, plaintext, ciphertext string 58 plaintext, err := hex.DecodeString(test.plaintext) 72 ciphertext := make([]byte, len(plaintext)) 74 cfb.XORKeyStream(ciphertext, plaintext) 85 t.Errorf("#%d: wrong plaintext: got %x, expected %x", i, plaintextCopy, plaintext) 97 plaintext := []byte("this is the plaintext. this is the plaintext." [all...] |
ofb_test.go | 79 plaintext := tt.in[0 : len(tt.in)-j] 81 ciphertext := make([]byte, len(plaintext)) 82 ofb.XORKeyStream(ciphertext, plaintext) 83 if !bytes.Equal(ciphertext, tt.out[:len(plaintext)]) { 84 t.Errorf("%s/%d: encrypting\ninput % x\nhave % x\nwant % x", test, len(plaintext), plaintext, ciphertext, tt.out) 91 plaintext := make([]byte, len(ciphertext)) 92 ofb.XORKeyStream(plaintext, ciphertext) 93 if !bytes.Equal(plaintext, tt.in[:len(ciphertext)]) { 94 t.Errorf("%s/%d: decrypting\nhave % x\nwant % x", test, len(ciphertext), plaintext, tt.in [all...] |
example_test.go | 21 plaintext := []byte("exampleplaintext") 39 ciphertext := aesgcm.Seal(nil, nonce, plaintext, nil) 61 plaintext, err := aesgcm.Open(nil, nonce, ciphertext, nil) 66 fmt.Printf("%s\n", plaintext) 97 // If the original plaintext lengths are not a multiple of the block 111 plaintext := []byte("exampleplaintext") 116 // assume that the plaintext is already of the correct length. 117 if len(plaintext)%aes.BlockSize != 0 { 118 panic("plaintext is not a multiple of the block size") 128 ciphertext := make([]byte, aes.BlockSize+len(plaintext)) [all...] |
/external/boringssl/src/crypto/fipsmodule/modes/ |
gcm_test.cc | 72 std::vector<uint8_t> key, plaintext, additional_data, nonce, ciphertext, 75 ASSERT_TRUE(t->GetBytes(&plaintext, "Plaintext")); 81 ASSERT_EQ(plaintext.size(), ciphertext.size()); 85 std::vector<uint8_t> out(plaintext.size()); 95 if (!plaintext.empty()) { 96 CRYPTO_gcm128_encrypt(&ctx, &aes_key, plaintext.data(), out.data(), 97 plaintext.size()); 112 EXPECT_EQ(Bytes(plaintext), Bytes(out));
|
/system/keymaster/ |
ocb_utils.h | 37 const KeymasterKeyBlob& plaintext, const Buffer& nonce, 44 const Buffer& tag, KeymasterKeyBlob* plaintext);
|
ocb_utils.cpp | 121 const KeymasterKeyBlob& plaintext, const Buffer& nonce, 137 if (!ciphertext->Reset(plaintext.key_material_size)) 140 int ae_err = ae_encrypt(ctx.get(), nonce.peek_read(), plaintext.key_material, 141 plaintext.key_material_size, NULL /* additional data */, 150 assert(ae_err == static_cast<int>(plaintext.key_material_size)); 158 const Buffer& tag, KeymasterKeyBlob* plaintext) { 159 assert(plaintext); 173 if (!plaintext->Reset(ciphertext.key_material_size)) 178 0 /* additional data length */, plaintext->writable_data(), 183 plaintext->Clear() [all...] |
/prebuilts/go/darwin-x86/src/vendor/golang_org/x/crypto/chacha20poly1305/ |
chacha20poly1305_noasm.go | 9 func (c *chacha20poly1305) seal(dst, nonce, plaintext, additionalData []byte) []byte { 10 return c.sealGeneric(dst, nonce, plaintext, additionalData)
|
chacha20poly1305_generic.go | 18 func (c *chacha20poly1305) sealGeneric(dst, nonce, plaintext, additionalData []byte) []byte { 25 ret, out := sliceForAppend(dst, len(plaintext)+poly1305.TagSize) 27 chacha20.XORKeyStream(out, plaintext, &counter, &c.key) 29 polyInput := make([]byte, roundTo16(len(additionalData))+roundTo16(len(plaintext))+8+8) 31 copy(polyInput[roundTo16(len(additionalData)):], out[:len(plaintext)]) 33 binary.LittleEndian.PutUint64(polyInput[len(polyInput)-8:], uint64(len(plaintext))) 37 copy(out[len(plaintext):], tag[:])
|
chacha20poly1305_test.go | 20 plaintext, _ := hex.DecodeString(test.plaintext) 27 ct := aead.Seal(nil, nonce, plaintext, ad) 39 if !bytes.Equal(plaintext, plaintext2) { 40 t.Errorf("#%d: plaintext's don't match: got %x vs %x", i, plaintext2, plaintext) 70 // Some random tests to verify Open(Seal) == Plaintext 78 plaintext := make([]byte, pl) 82 cr.Read(plaintext) 89 ct := aead.Seal(nil, nonce[:], plaintext, ad [all...] |
/prebuilts/go/linux-x86/src/vendor/golang_org/x/crypto/chacha20poly1305/ |
chacha20poly1305_noasm.go | 9 func (c *chacha20poly1305) seal(dst, nonce, plaintext, additionalData []byte) []byte { 10 return c.sealGeneric(dst, nonce, plaintext, additionalData)
|
chacha20poly1305_generic.go | 18 func (c *chacha20poly1305) sealGeneric(dst, nonce, plaintext, additionalData []byte) []byte { 25 ret, out := sliceForAppend(dst, len(plaintext)+poly1305.TagSize) 27 chacha20.XORKeyStream(out, plaintext, &counter, &c.key) 29 polyInput := make([]byte, roundTo16(len(additionalData))+roundTo16(len(plaintext))+8+8) 31 copy(polyInput[roundTo16(len(additionalData)):], out[:len(plaintext)]) 33 binary.LittleEndian.PutUint64(polyInput[len(polyInput)-8:], uint64(len(plaintext))) 37 copy(out[len(plaintext):], tag[:])
|
chacha20poly1305_test.go | 20 plaintext, _ := hex.DecodeString(test.plaintext) 27 ct := aead.Seal(nil, nonce, plaintext, ad) 39 if !bytes.Equal(plaintext, plaintext2) { 40 t.Errorf("#%d: plaintext's don't match: got %x vs %x", i, plaintext2, plaintext) 70 // Some random tests to verify Open(Seal) == Plaintext 78 plaintext := make([]byte, pl) 82 cr.Read(plaintext) 89 ct := aead.Seal(nil, nonce[:], plaintext, ad [all...] |
/external/python/cpython2/Lib/test/ |
test_uu.py | 12 plaintext = "The smooth-scaled python crept over the sleeping dog\n" variable 23 inp = cStringIO.StringIO(plaintext) 27 inp = cStringIO.StringIO(plaintext) 36 self.assertEqual(out.getvalue(), plaintext) 44 self.assertEqual(out.getvalue(), plaintext) 73 plaintext = "\x33" # 00110011 78 self.assertEqual(out.getvalue(), plaintext) 82 self.assertEqual(decoded, plaintext) 95 sys.stdin = cStringIO.StringIO(plaintext) 107 self.assertEqual(sys.stdout.getvalue(), plaintext) [all...] |
/external/protobuf/src/google/protobuf/stubs/ |
strutil_unittest.cc | 85 const char* plaintext; member in struct:google::protobuf::__anon29948::__anon29949 345 const char* plaintext; member in struct:google::protobuf::__anon29948::__anon29950 448 reinterpret_cast<const unsigned char*>(base64_tests[i].plaintext); 450 StringPiece plaintext(base64_tests[i].plaintext, 491 EXPECT_EQ(plaintext, decode_str); 495 Base64Escape(string(base64_tests[i].plaintext, 504 EXPECT_EQ_ARRAY(decoded.size(), decoded, base64_tests[i].plaintext, i); 522 EXPECT_EQ_ARRAY(decoded.size(), decoded, base64_tests[i].plaintext, i); 533 EXPECT_EQ_ARRAY(decoded.size(), decoded, base64_tests[i].plaintext, i) [all...] |
/device/linaro/bootloader/edk2/AppPkg/Applications/Python/Python-2.7.2/Lib/test/ |
test_uu.py | 12 plaintext = "The smooth-scaled python crept over the sleeping dog\n"
variable 23 inp = cStringIO.StringIO(plaintext)
27 inp = cStringIO.StringIO(plaintext)
36 self.assertEqual(out.getvalue(), plaintext)
44 self.assertEqual(out.getvalue(), plaintext)
75 sys.stdin = cStringIO.StringIO(plaintext)
87 self.assertEqual(sys.stdout.getvalue(), plaintext)
119 fin.write(plaintext)
159 self.assertEqual(s, plaintext)
177 self.assertEqual(s, plaintext)
[all...] |
/prebuilts/gdb/darwin-x86/lib/python2.7/test/ |
test_uu.py | 12 plaintext = "The smooth-scaled python crept over the sleeping dog\n" variable 23 inp = cStringIO.StringIO(plaintext) 27 inp = cStringIO.StringIO(plaintext) 36 self.assertEqual(out.getvalue(), plaintext) 44 self.assertEqual(out.getvalue(), plaintext) 75 sys.stdin = cStringIO.StringIO(plaintext) 87 self.assertEqual(sys.stdout.getvalue(), plaintext) 119 fin.write(plaintext) 159 self.assertEqual(s, plaintext) 177 self.assertEqual(s, plaintext) [all...] |
/prebuilts/gdb/linux-x86/lib/python2.7/test/ |
test_uu.py | 12 plaintext = "The smooth-scaled python crept over the sleeping dog\n" variable 23 inp = cStringIO.StringIO(plaintext) 27 inp = cStringIO.StringIO(plaintext) 36 self.assertEqual(out.getvalue(), plaintext) 44 self.assertEqual(out.getvalue(), plaintext) 75 sys.stdin = cStringIO.StringIO(plaintext) 87 self.assertEqual(sys.stdout.getvalue(), plaintext) 119 fin.write(plaintext) 159 self.assertEqual(s, plaintext) 177 self.assertEqual(s, plaintext) [all...] |
/prebuilts/python/darwin-x86/2.7.5/lib/python2.7/test/ |
test_uu.py | 12 plaintext = "The smooth-scaled python crept over the sleeping dog\n" variable 23 inp = cStringIO.StringIO(plaintext) 27 inp = cStringIO.StringIO(plaintext) 36 self.assertEqual(out.getvalue(), plaintext) 44 self.assertEqual(out.getvalue(), plaintext) 75 sys.stdin = cStringIO.StringIO(plaintext) 87 self.assertEqual(sys.stdout.getvalue(), plaintext) 119 fin.write(plaintext) 159 self.assertEqual(s, plaintext) 177 self.assertEqual(s, plaintext) [all...] |
/prebuilts/python/linux-x86/2.7.5/lib/python2.7/test/ |
test_uu.py | 12 plaintext = "The smooth-scaled python crept over the sleeping dog\n" variable 23 inp = cStringIO.StringIO(plaintext) 27 inp = cStringIO.StringIO(plaintext) 36 self.assertEqual(out.getvalue(), plaintext) 44 self.assertEqual(out.getvalue(), plaintext) 75 sys.stdin = cStringIO.StringIO(plaintext) 87 self.assertEqual(sys.stdout.getvalue(), plaintext) 119 fin.write(plaintext) 159 self.assertEqual(s, plaintext) 177 self.assertEqual(s, plaintext) [all...] |
/cts/tests/tests/keystore/src/android/keystore/cts/ |
RSACipherTest.java | 86 // Plaintext is one smaller than the modulus 87 byte[] plaintext = 91 byte[] ciphertext = cipher.doFinal(plaintext); 93 MoreAsserts.assertEquals(plaintext, cipher.doFinal(ciphertext)); 113 // Plaintext is exactly the modulus 114 byte[] plaintext = TestUtils.getBigIntegerMagnitudeBytes(modulus); 118 byte[] ciphertext = cipher.doFinal(plaintext); 141 // Plaintext is one larger than the modulus 142 byte[] plaintext = 147 byte[] ciphertext = cipher.doFinal(plaintext); [all...] |
CipherTest.java | 81 private final byte[] plaintext; field in class:CipherTest.KatVector 94 private KatVector(byte[] plaintext, byte[] ciphertext) { 95 this(plaintext, null, ciphertext); 98 private KatVector(byte[] plaintext, AlgorithmParameterSpec params, byte[] ciphertext) { 99 this.plaintext = plaintext; 324 byte[] plaintext = truncatePlaintextIfNecessary( 326 if (plaintext == null) { 333 byte[] ciphertext = cipher.doFinal(plaintext); 334 byte[] expectedPlaintext = plaintext; [all...] |