/external/boringssl/src/crypto/aes/ |
aes_test.cc | 29 std::vector<uint8_t> key, plaintext, ciphertext; local 31 !t->GetBytes(&plaintext, "Plaintext") || 36 if (plaintext.size() != AES_BLOCK_SIZE || 38 t->PrintLine("Plaintext or Ciphertext not a block size."); 50 AES_encrypt(plaintext.data(), block, &aes_key); 58 OPENSSL_memcpy(block, plaintext.data(), AES_BLOCK_SIZE); 73 if (!t->ExpectBytesEqual(block, AES_BLOCK_SIZE, plaintext.data(), 74 plaintext.size())) { 82 if (!t->ExpectBytesEqual(block, AES_BLOCK_SIZE, plaintext.data() 100 std::vector<uint8_t> key, plaintext, ciphertext; local [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...] |
/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...] |
chacha20poly1305_amd64.go | 49 func (c *chacha20poly1305) seal(dst, nonce, plaintext, additionalData []byte) []byte { 51 return c.sealGeneric(dst, nonce, plaintext, additionalData) 57 ret, out := sliceForAppend(dst, len(plaintext)+16) 58 chacha20Poly1305Seal(out[:], state[:], plaintext, additionalData)
|
/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/protobuf/src/google/protobuf/stubs/ |
strutil_unittest.cc | 85 const char* plaintext; member in struct:google::protobuf::__anon29097::__anon29098 345 const char* plaintext; member in struct:google::protobuf::__anon29097::__anon29099 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...] |
/external/boringssl/src/crypto/modes/ |
gcm_test.cc | 69 const char *plaintext; member in struct:test_case 308 uint8_t *key = NULL, *plaintext = NULL, *additional_data = NULL, local 315 !decode_hex(&plaintext, &plaintext_len, test->plaintext, test_num, 316 "plaintext") || 327 fprintf(stderr, "%u: plaintext and ciphertext have differing lengths.\n", 357 if (plaintext) { 358 CRYPTO_gcm128_encrypt(&ctx, &aes_key, plaintext, out, plaintext_len); 380 if (plaintext && OPENSSL_memcmp(out, plaintext, plaintext_len)) [all...] |