/external/grpc-grpc-java/alts/src/main/java/io/grpc/alts/internal/ |
D | AesGcmAeadCrypter.java | 47 ByteBuffer ciphertext, ByteBuffer plaintext, @Nullable ByteBuffer aad, byte[] nonce) in encryptAad() argument 57 return cipher.doFinal(plaintext, ciphertext); in encryptAad() 61 ByteBuffer plaintext, ByteBuffer ciphertext, @Nullable ByteBuffer aad, byte[] nonce) in decryptAad() argument 71 cipher.doFinal(ciphertext, plaintext); in decryptAad() 75 public void encrypt(ByteBuffer ciphertext, ByteBuffer plaintext, byte[] nonce) in encrypt() argument 77 encryptAad(ciphertext, plaintext, null, nonce); in encrypt() 81 public void encrypt(ByteBuffer ciphertext, ByteBuffer plaintext, ByteBuffer aad, byte[] nonce) in encrypt() argument 83 encryptAad(ciphertext, plaintext, aad, nonce); in encrypt() 87 public void decrypt(ByteBuffer plaintext, ByteBuffer ciphertext, byte[] nonce) in decrypt() argument 89 decryptAad(plaintext, ciphertext, null, nonce); in decrypt() [all …]
|
D | AesGcmHkdfAeadCrypter.java | 58 public void encrypt(ByteBuffer ciphertext, ByteBuffer plaintext, byte[] nonce) in encrypt() argument 62 aeadCrypter.encrypt(ciphertext, plaintext, nonceBuffer); in encrypt() 66 public void encrypt(ByteBuffer ciphertext, ByteBuffer plaintext, ByteBuffer aad, byte[] nonce) in encrypt() argument 70 aeadCrypter.encrypt(ciphertext, plaintext, aad, nonceBuffer); in encrypt() 74 public void decrypt(ByteBuffer plaintext, ByteBuffer ciphertext, byte[] nonce) in decrypt() argument 78 aeadCrypter.decrypt(plaintext, ciphertext, nonceBuffer); in decrypt() 82 public void decrypt(ByteBuffer plaintext, ByteBuffer ciphertext, ByteBuffer aad, byte[] nonce) in decrypt() argument 86 aeadCrypter.decrypt(plaintext, ciphertext, aad, nonceBuffer); in decrypt()
|
D | AeadCrypter.java | 36 void encrypt(ByteBuffer ciphertext, ByteBuffer plaintext, byte[] nonce) in encrypt() argument 49 void encrypt(ByteBuffer ciphertext, ByteBuffer plaintext, ByteBuffer aad, byte[] nonce) in encrypt() argument 61 void decrypt(ByteBuffer plaintext, ByteBuffer ciphertext, byte[] nonce) in decrypt() argument 74 void decrypt(ByteBuffer plaintext, ByteBuffer ciphertext, ByteBuffer aad, byte[] nonce) in decrypt() argument
|
/external/boringssl/src/crypto/hrss/ |
D | hrss_test.cc | 189 uint8_t ciphertext[HRSS_CIPHERTEXT_BYTES]; in TEST() local 191 HRSS_encap(ciphertext, shared_key, &pub2, encap_entropy); in TEST() 194 HRSS_decap(shared_key2, &priv, ciphertext, sizeof(ciphertext)); in TEST() 214 uint8_t ciphertext[HRSS_CIPHERTEXT_BYTES]; in TEST() local 216 HRSS_encap(ciphertext, shared_key, &pub, encap_entropy); in TEST() 219 HRSS_decap(shared_key2, &priv, ciphertext, sizeof(ciphertext)); in TEST() 226 ciphertext[offset % sizeof(ciphertext)] ^= (1 << (bit & 7)); in TEST() 227 HRSS_decap(shared_key2, &priv, ciphertext, sizeof(ciphertext)); in TEST() 357 uint8_t ciphertext[HRSS_CIPHERTEXT_BYTES]; in TEST() local 359 HRSS_encap(ciphertext, shared_key, &pub, encap_entropy); in TEST() [all …]
|
/external/grpc-grpc-java/alts/src/test/java/io/grpc/alts/internal/ |
D | AesGcmHkdfAeadCrypterTest.java | 39 final byte[] ciphertext; field in AesGcmHkdfAeadCrypterTest.TestVector 47 ciphertext = builder.ciphertext; in TestVector() 61 byte[] ciphertext; field in AesGcmHkdfAeadCrypterTest.TestVectorBuilder 69 && ciphertext == null) { in build() 100 TestVectorBuilder withCiphertext(String ciphertext) { in withCiphertext() argument 101 this.ciphertext = BaseEncoding.base16().lowerCase().decode(ciphertext); in withCiphertext() 110 int bufferSize = testVector.ciphertext.length; in testVectorEncrypt() 111 byte[] ciphertext = new byte[bufferSize]; in testVectorEncrypt() 112 ByteBuffer ciphertextBuffer = ByteBuffer.wrap(ciphertext); in testVectorEncrypt() 123 .isEqualTo(bufferSize - testVector.ciphertext.length); in testVectorEncrypt() [all …]
|
D | ChannelCrypterNettyTestBase.java | 60 List<ByteBuf> ciphertext; field in ChannelCrypterNettyTestBase.FrameDecrypt 79 frameDecrypt.ciphertext = in frameDecryptOfEncrypt() 93 server.decrypt(frameDecrypt.out, frameDecrypt.tag, frameDecrypt.ciphertext); in encryptDecrypt() 122 server.decrypt(frameDecrypt.out, frameDecrypt.tag, frameDecrypt.ciphertext); in encryptDecryptMultiple() 153 frameDecrypt.ciphertext = Collections.singletonList(cipher); in encryptDecryptComposite() 157 server.decrypt(frameDecrypt.out, frameDecrypt.tag, frameDecrypt.ciphertext); in encryptDecryptComposite() 169 client.decrypt(frameDecrypt.out, frameDecrypt.tag, frameDecrypt.ciphertext); in reflection() 186 client.decrypt(frameDecrypt.out, frameDecrypt.tag, frameDecrypt.ciphertext); in skipMessage() 202 client.decrypt(frameDecrypt.out, frameDecrypt.tag, frameDecrypt.ciphertext); in corruptMessage() 217 server.decrypt(frameDecrypt1.out, frameDecrypt1.tag, frameDecrypt1.ciphertext); in replayMessage() [all …]
|
D | FakeChannelCrypter.java | 49 public void decrypt(ByteBuf out, ByteBuf tag, List<ByteBuf> ciphertext) in decrypt() argument 52 for (ByteBuf buf : ciphertext) { in decrypt() 65 ByteBuf ciphertext = ciphertextAndTag.readSlice(ciphertextAndTag.readableBytes() - TAG_BYTES); in decrypt() local 66 decrypt(out, /*tag=*/ ciphertextAndTag, Collections.singletonList(ciphertext)); in decrypt()
|
/external/boringssl/src/crypto/fipsmodule/aes/ |
D | aes_test.cc | 35 std::vector<uint8_t> key, plaintext, ciphertext; in TestRaw() local 38 ASSERT_TRUE(t->GetBytes(&ciphertext, "Ciphertext")); in TestRaw() 41 ASSERT_EQ(static_cast<unsigned>(AES_BLOCK_SIZE), ciphertext.size()); in TestRaw() 49 EXPECT_EQ(Bytes(ciphertext), Bytes(block)); in TestRaw() 54 EXPECT_EQ(Bytes(ciphertext), Bytes(block)); in TestRaw() 59 AES_decrypt(ciphertext.data(), block, &aes_key); in TestRaw() 63 OPENSSL_memcpy(block, ciphertext.data(), AES_BLOCK_SIZE); in TestRaw() 77 std::vector<uint8_t> key, plaintext, ciphertext; in TestKeyWrap() local 80 ASSERT_TRUE(t->GetBytes(&ciphertext, "Ciphertext")); in TestKeyWrap() 82 ASSERT_EQ(plaintext.size() + 8, ciphertext.size()) in TestKeyWrap() [all …]
|
/external/wycheproof/java/com/google/security/wycheproof/testcases/ |
D | DhiesTest.java | 95 byte[] ciphertext = dhies.doFinal(message); in testDhiesBasic() 96 System.out.println("testDhiesBasic:" + TestUtil.bytesToHex(ciphertext)); in testDhiesBasic() 98 byte[] decrypted = dhies.doFinal(ciphertext); in testDhiesBasic() 123 byte[] ciphertext = dhies.doFinal(message); in testDhiesCorrupt() 124 for (int i = 0; i < ciphertext.length; i++) { in testDhiesCorrupt() 125 byte[] corrupt = Arrays.copyOf(ciphertext, ciphertext.length); in testDhiesCorrupt() 159 byte[] ciphertext = dhies.doFinal(message); in testNotEcb() 160 for (int i = 0; i + 32 <= ciphertext.length; i++) { in testNotEcb() 161 String block1 = TestUtil.bytesToHex(Arrays.copyOfRange(ciphertext, i, i + 16)); in testNotEcb() 162 String block2 = TestUtil.bytesToHex(Arrays.copyOfRange(ciphertext, i + 16, i + 32)); in testNotEcb() [all …]
|
D | EciesTest.java | 83 byte[] ciphertext = ecies.doFinal(message); in testEciesBasic() 84 System.out.println("testEciesBasic:" + TestUtil.bytesToHex(ciphertext)); in testEciesBasic() 86 byte[] decrypted = ecies.doFinal(ciphertext); in testEciesBasic() 174 byte[] ciphertext = ecies.doFinal(message); in testExceptions() 175 System.out.println(TestUtil.bytesToHex(ciphertext)); in testExceptions() 178 for (int byteNr = kemSize; byteNr < ciphertext.length; byteNr++) { in testExceptions() 180 byte[] corrupt = Arrays.copyOf(ciphertext, ciphertext.length); in testExceptions() 212 byte[] ciphertext = ecies.doFinal(message); in testModifyPoint() 213 ciphertext[2] ^= (byte) 1; in testModifyPoint() 216 ecies.doFinal(ciphertext); in testModifyPoint() [all …]
|
D | RsaEncryptionTest.java | 105 byte[] ciphertext = new byte[1024 / 8]; in testExceptions() 109 rand.nextBytes(ciphertext); in testExceptions() 110 ciphertext[0] &= (byte) 0x7f; in testExceptions() 113 c.doFinal(ciphertext); in testExceptions() 123 ciphertext = enc.doFinal(paddedKeys[i]); in testExceptions() 125 c.doFinal(ciphertext); in testExceptions()
|
D | AesEaxTest.java | 44 String message, String keyMaterial, String nonce, String aad, String ciphertext) { in EaxTestVector() argument 48 this.ct = TestUtil.hexToBytes(ciphertext); in EaxTestVector() 49 this.ctHex = ciphertext; in EaxTestVector()
|
/external/boringssl/src/third_party/wycheproof_testvectors/ |
D | aes_cbc_pkcs5_test.txt | 209 # The ciphertext in this test vector is the message encrypted with an invalid or 220 # The ciphertext in this test vector is the message encrypted with an invalid or 231 # The ciphertext in this test vector is the message encrypted with an invalid or 242 # The ciphertext in this test vector is the message encrypted with an invalid or 253 # The ciphertext in this test vector is the message encrypted with an invalid or 264 # The ciphertext in this test vector is the message encrypted with an invalid or 275 # The ciphertext in this test vector is the message encrypted with an invalid or 286 # The ciphertext in this test vector is the message encrypted with an invalid or 297 # The ciphertext in this test vector is the message encrypted with an invalid or 308 # The ciphertext in this test vector is the message encrypted with an invalid or [all …]
|
/external/boringssl/src/ssl/test/runner/ |
D | key_agreement.go | 106 if len(ckx.ciphertext) < 2 { 110 ciphertext := ckx.ciphertext 112 ciphertextLen := int(ckx.ciphertext[0])<<8 | int(ckx.ciphertext[1]) 113 if ciphertextLen != len(ckx.ciphertext)-2 { 116 ciphertext = ckx.ciphertext[2:] 123 err = rsa.DecryptPKCS1v15SessionKey(config.rand(), key, ciphertext, preMasterSecret) 227 ckx.ciphertext = make([]byte, len(encrypted)+2) 228 ckx.ciphertext[0] = byte(len(encrypted) >> 8) 229 ckx.ciphertext[1] = byte(len(encrypted)) 230 copy(ckx.ciphertext[2:], encrypted) [all …]
|
D | chacha20_poly1305.go | 139 func (c *chaCha20Poly1305) poly1305(tag *[16]byte, nonce, ciphertext, additionalData []byte) { 140 input := make([]byte, 0, len(additionalData)+15+len(ciphertext)+15+8+8) 146 input = append(input, ciphertext...) 153 binary.LittleEndian.PutUint64(out, uint64(len(ciphertext))) 176 func (c *chaCha20Poly1305) Open(dst, nonce, ciphertext, additionalData []byte) ([]byte, error) { 180 if len(ciphertext) < 16 { 183 plaintextLen := len(ciphertext) - 16 186 c.poly1305(&tag, nonce, ciphertext[:plaintextLen], additionalData) 187 if subtle.ConstantTimeCompare(tag[:], ciphertext[plaintextLen:]) != 1 { 192 chaCha20(out, ciphertext[:plaintextLen], c.key[:], nonce, 1)
|
/external/conscrypt/openjdk-integ-tests/src/test/java/org/conscrypt/javax/crypto/ |
D | CipherBasicsTest.java | 119 byte[] ciphertext = toBytes(line[CIPHERTEXT_INDEX]); in testBasicEncryption() 135 ciphertext.length, cipher.getOutputSize(plaintext.length)); in testBasicEncryption() 139 Arrays.equals(ciphertext, cipher.doFinal(plaintext))); in testBasicEncryption() 145 plaintext.length, cipher.getOutputSize(ciphertext.length)); in testBasicEncryption() 149 Arrays.equals(plaintext, cipher.doFinal(ciphertext))); in testBasicEncryption() 179 byte[] ciphertext = toBytes(line[CIPHERTEXT_INDEX]); in testAeadEncryption() 201 byte[] combinedOutput = new byte[ciphertext.length + tag.length]; in testAeadEncryption() 206 System.arraycopy(ciphertext, 0, combinedOutput, 0, ciphertext.length); in testAeadEncryption() 207 System.arraycopy(tag, 0, combinedOutput, ciphertext.length, tag.length); in testAeadEncryption()
|
/external/conscrypt/repackaged/openjdk-integ-tests/src/test/java/com/android/org/conscrypt/javax/crypto/ |
D | CipherBasicsTest.java | 121 byte[] ciphertext = toBytes(line[CIPHERTEXT_INDEX]); in testBasicEncryption() 137 ciphertext.length, cipher.getOutputSize(plaintext.length)); in testBasicEncryption() 141 Arrays.equals(ciphertext, cipher.doFinal(plaintext))); in testBasicEncryption() 147 plaintext.length, cipher.getOutputSize(ciphertext.length)); in testBasicEncryption() 151 Arrays.equals(plaintext, cipher.doFinal(ciphertext))); in testBasicEncryption() 181 byte[] ciphertext = toBytes(line[CIPHERTEXT_INDEX]); in testAeadEncryption() 203 byte[] combinedOutput = new byte[ciphertext.length + tag.length]; in testAeadEncryption() 208 System.arraycopy(ciphertext, 0, combinedOutput, 0, ciphertext.length); in testAeadEncryption() 209 System.arraycopy(tag, 0, combinedOutput, ciphertext.length, tag.length); in testAeadEncryption()
|
/external/grpc-grpc/src/core/tsi/alts/crypt/ |
D | aes_gcm.cc | 320 uint8_t* ciphertext = static_cast<uint8_t*>(ciphertext_vec.iov_base); in gsec_aes_gcm_aead_crypter_encrypt_iovec() local 322 if (ciphertext == nullptr) { in gsec_aes_gcm_aead_crypter_encrypt_iovec() 344 if (!EVP_EncryptUpdate(aes_gcm_crypter->ctx, ciphertext, &bytes_written, in gsec_aes_gcm_aead_crypter_encrypt_iovec() 353 ciphertext += bytes_written; in gsec_aes_gcm_aead_crypter_encrypt_iovec() 374 kAesGcmTagLength, ciphertext)) { in gsec_aes_gcm_aead_crypter_encrypt_iovec() 378 ciphertext += kAesGcmTagLength; in gsec_aes_gcm_aead_crypter_encrypt_iovec() 479 const uint8_t* ciphertext = nullptr; in gsec_aes_gcm_aead_crypter_decrypt_iovec() local 484 ciphertext = static_cast<uint8_t*>(ciphertext_vec[i].iov_base); in gsec_aes_gcm_aead_crypter_decrypt_iovec() 486 if (ciphertext == nullptr) { in gsec_aes_gcm_aead_crypter_decrypt_iovec() 507 reinterpret_cast<int*>(&bytes_written), ciphertext, in gsec_aes_gcm_aead_crypter_decrypt_iovec() [all …]
|
/external/boringssl/src/crypto/fipsmodule/modes/ |
D | gcm_test.cc | 68 std::vector<uint8_t> key, plaintext, additional_data, nonce, ciphertext, in TEST() local 74 ASSERT_TRUE(t->GetBytes(&ciphertext, "Ciphertext")); in TEST() 77 ASSERT_EQ(plaintext.size(), ciphertext.size()); in TEST() 100 EXPECT_EQ(Bytes(ciphertext), Bytes(out)); in TEST() 107 if (!ciphertext.empty()) { in TEST() 108 CRYPTO_gcm128_decrypt(&ctx, &aes_key, ciphertext.data(), out.data(), in TEST() 109 ciphertext.size()); in TEST()
|
/external/openssh/openbsd-compat/ |
D | bcrypt_pbkdf.c | 73 u_int8_t ciphertext[BCRYPT_HASHSIZE] = in bcrypt_hash() local 91 cdata[i] = Blowfish_stream2word(ciphertext, sizeof(ciphertext), in bcrypt_hash() 105 explicit_bzero(ciphertext, sizeof(ciphertext)); in bcrypt_hash()
|
/external/boringssl/src/crypto/cipher_extra/ |
D | cipher_test.cc | 156 const std::vector<uint8_t> &ciphertext, in TestOperation() argument 162 out = &ciphertext; in TestOperation() 164 in = &ciphertext; in TestOperation() 219 std::vector<uint8_t> key, iv, plaintext, ciphertext, aad, tag; in TestCipher() local 222 ASSERT_TRUE(t->GetBytes(&ciphertext, "Ciphertext")); in TestCipher() 256 plaintext, ciphertext, aad, tag); in TestCipher() 262 plaintext, ciphertext, aad, tag); in TestCipher()
|
D | aead_test.cc | 429 uint8_t ciphertext[128]; in TEST_P() local 432 OPENSSL_memset(ciphertext, kSentinel, sizeof(ciphertext)); in TEST_P() 434 ASSERT_TRUE(EVP_AEAD_CTX_seal(ctx.get(), ciphertext, &ciphertext_len, in TEST_P() 435 sizeof(ciphertext), nonce, nonce_len, plaintext, in TEST_P() 438 for (size_t i = ciphertext_len; i < sizeof(ciphertext); i++) { in TEST_P() 440 EXPECT_EQ(kSentinel, ciphertext[i]) in TEST_P() 456 nonce_len, ciphertext, ciphertext_len, nullptr /* ad */, 0)) in TEST_P() 564 alignas(64) uint8_t ciphertext[sizeof(plaintext) + EVP_AEAD_MAX_OVERHEAD]; in TEST_P() local 566 ASSERT_TRUE(EVP_AEAD_CTX_seal(ctx.get(), ciphertext + 1, &ciphertext_len, in TEST_P() 567 sizeof(ciphertext) - 1, nonce + 1, nonce_len, in TEST_P() [all …]
|
/external/boringssl/src/crypto/pkcs8/ |
D | pkcs8.c | 422 CBS epki, algorithm, ciphertext; in PKCS8_parse_encrypted_private_key() local 425 !CBS_get_asn1(&epki, &ciphertext, CBS_ASN1_OCTETSTRING) || in PKCS8_parse_encrypted_private_key() 434 CBS_data(&ciphertext), CBS_len(&ciphertext))) { in PKCS8_parse_encrypted_private_key() 507 CBB ciphertext; in PKCS8_marshal_encrypted_private_key() local 510 if (!CBB_add_asn1(&epki, &ciphertext, CBS_ASN1_OCTETSTRING) || in PKCS8_marshal_encrypted_private_key() 511 !CBB_reserve(&ciphertext, &ptr, max_out) || in PKCS8_marshal_encrypted_private_key() 514 !CBB_did_write(&ciphertext, n1 + n2) || in PKCS8_marshal_encrypted_private_key()
|
/external/boringssl/src/crypto/ |
D | impl_dispatch_test.cc | 106 uint8_t ciphertext[sizeof(kPlaintext) + 16]; in TEST_F() local 113 &ctx, ciphertext, &ciphertext_len, sizeof(ciphertext), kZeros, in TEST_F()
|
/external/boringssl/src/crypto/rsa_extra/ |
D | rsa_test.cc | 406 uint8_t ciphertext[256]; in TEST_P() local 410 ASSERT_TRUE(RSA_encrypt(key.get(), &ciphertext_len, ciphertext, in TEST_P() 411 sizeof(ciphertext), kPlaintext, kPlaintextLen, in TEST_P() 418 sizeof(plaintext), ciphertext, ciphertext_len, in TEST_P() 424 ASSERT_TRUE(RSA_encrypt(key.get(), &ciphertext_len, ciphertext, in TEST_P() 425 sizeof(ciphertext), kPlaintext, kPlaintextLen, in TEST_P() 431 sizeof(plaintext), ciphertext, ciphertext_len, in TEST_P() 443 OPENSSL_memcpy(ciphertext, param.oaep_ciphertext, param.oaep_ciphertext_len); in TEST_P() 446 ciphertext[i] ^= 1; in TEST_P() 448 key.get(), &plaintext_len, plaintext, sizeof(plaintext), ciphertext, in TEST_P() [all …]
|