Home
last modified time | relevance | path

Searched refs:ciphertext (Results 1 – 25 of 122) sorted by relevance

12345

/src/crypto/openssl/test/
H A Digetest.c227 unsigned char ciphertext[BIG_TEST_SIZE]; in test_ige_enc_dec() local
232 AES_ige_encrypt(plaintext, ciphertext, TEST_SIZE, &key, iv, AES_ENCRYPT); in test_ige_enc_dec()
236 AES_ige_encrypt(ciphertext, checktext, TEST_SIZE, &key, iv, AES_DECRYPT); in test_ige_enc_dec()
245 unsigned char ciphertext[BIG_TEST_SIZE]; in test_ige_enc_chaining() local
250 AES_ige_encrypt(plaintext, ciphertext, TEST_SIZE / 2, &key, iv, in test_ige_enc_chaining()
253 ciphertext + TEST_SIZE / 2, TEST_SIZE / 2, in test_ige_enc_chaining()
258 AES_ige_encrypt(ciphertext, checktext, TEST_SIZE, &key, iv, AES_DECRYPT); in test_ige_enc_chaining()
267 unsigned char ciphertext[BIG_TEST_SIZE]; in test_ige_dec_chaining() local
272 AES_ige_encrypt(plaintext, ciphertext, TEST_SIZE / 2, &key, iv, in test_ige_dec_chaining()
275 ciphertext + TEST_SIZE / 2, TEST_SIZE / 2, in test_ige_dec_chaining()
[all …]
H A Dml_kem_internal_test.c104 uint8_t *ciphertext = NULL; in sanity_test() local
130 ciphertext = OPENSSL_malloc(v->ctext_bytes); in sanity_test()
131 if (encoded_public_key == NULL || ciphertext == NULL) in sanity_test()
167 if (!ossl_ml_kem_encap_rand(ciphertext, v->ctext_bytes, in sanity_test()
174 if (!TEST_true(EVP_Digest(ciphertext, v->ctext_bytes, in sanity_test()
190 ciphertext, v->ctext_bytes, private_key)) in sanity_test()
200 memset(ciphertext, 0, v->ctext_bytes); in sanity_test()
202 ciphertext, v->ctext_bytes, in sanity_test()
217 ciphertext, v->ctext_bytes - 1, in sanity_test()
237 OPENSSL_free(ciphertext); in sanity_test()
/src/sys/contrib/openzfs/module/icp/io/
H A Daes.c174 crypto_key_t *key, crypto_data_t *plaintext, crypto_data_t *ciphertext, in aes_encrypt_atomic() argument
185 ASSERT(ciphertext != NULL); in aes_encrypt_atomic()
207 if (ciphertext->cd_length < length_needed) { in aes_encrypt_atomic()
208 ciphertext->cd_length = length_needed; in aes_encrypt_atomic()
213 saved_offset = ciphertext->cd_offset; in aes_encrypt_atomic()
214 saved_length = ciphertext->cd_length; in aes_encrypt_atomic()
221 ret = crypto_update_iov(&aes_ctx, plaintext, ciphertext, in aes_encrypt_atomic()
225 ret = crypto_update_uio(&aes_ctx, plaintext, ciphertext, in aes_encrypt_atomic()
235 ciphertext, AES_BLOCK_LEN, aes_encrypt_block, in aes_encrypt_atomic()
242 ciphertext, AES_BLOCK_LEN, aes_encrypt_block, in aes_encrypt_atomic()
[all …]
/src/crypto/openssh/regress/misc/fuzz-harness/
H A Dsntrup761_dec_fuzz.cc55 unsigned char ciphertext[crypto_kem_sntrup761_CIPHERTEXTBYTES]; in LLVMFuzzerTestOneInput() local
63 memset(&ciphertext, 0, sizeof(ciphertext)); in LLVMFuzzerTestOneInput()
64 if (len > sizeof(ciphertext)) { in LLVMFuzzerTestOneInput()
65 len = sizeof(ciphertext); in LLVMFuzzerTestOneInput()
67 memcpy(ciphertext, input, len); in LLVMFuzzerTestOneInput()
69 (void)crypto_kem_sntrup761_dec(secret, ciphertext, zero_sk); in LLVMFuzzerTestOneInput()
70 (void)crypto_kem_sntrup761_dec(secret, ciphertext, rnd_sk); in LLVMFuzzerTestOneInput()
H A Dmkcorpus_sntrup761.c59 unsigned char ciphertext[crypto_kem_sntrup761_CIPHERTEXTBYTES]; in main() local
73 if (crypto_kem_sntrup761_enc(ciphertext, secret, pk) != 0) in main()
76 ciphertext, sizeof(ciphertext)); in main()
H A Dsntrup761_enc_fuzz.cc41 unsigned char ciphertext[crypto_kem_sntrup761_CIPHERTEXTBYTES]; in LLVMFuzzerTestOneInput() local
51 (void)crypto_kem_sntrup761_enc(ciphertext, secret, pk); in LLVMFuzzerTestOneInput()
53 (void)crypto_kem_sntrup761_enc(ciphertext, secret, pk); in LLVMFuzzerTestOneInput()
/src/crypto/krb5/src/lib/crypto/crypto_tests/
H A Dt_encrypt.c139 enc_out.ciphertext = out; in main()
140 enc_out2.ciphertext = out2; in main()
144 enc_out.ciphertext.length = len; in main()
149 display ("Enc output", &enc_out.ciphertext); in main()
158 display ("Enc output", &enc_out.ciphertext); in main()
167 memcpy(out2.data, enc_out.ciphertext.data, enc_out.ciphertext.length); in main()
170 iov[0].data.length = enc_out.ciphertext.length; in main()
180 memcpy(out2.data, enc_out.ciphertext.data, enc_out.ciphertext.length); in main()
237 enc_out.ciphertext.length = out.length; in main()
244 display ("Enc output", &enc_out.ciphertext); in main()
[all …]
H A Dt_decrypt.c40 krb5_data ciphertext; member
567 ret = alloc_data(&enc.ciphertext, enclen); in generate()
575 printhex("Ciphertext: ", enc.ciphertext.data, in generate()
576 enc.ciphertext.length); in generate()
577 free(enc.ciphertext.data); in generate()
603 ret = alloc_data(&plain, test->ciphertext.length); in main()
608 enc.ciphertext = test->ciphertext; in main()
H A Dt_short.c90 input.ciphertext.data = calloc(len, 1); in test_enctype()
91 input.ciphertext.length = len; in test_enctype()
103 iov[0].data = input.ciphertext; in test_enctype()
111 free(input.ciphertext.data); in test_enctype()
/src/crypto/openssh/
H A Dkexsntrup761x25519.c84 u_char *kem_key, *ciphertext, *server_pub; in kex_kem_sntrup761x25519_enc() local
122 if ((r = sshbuf_reserve(server_blob, need, &ciphertext)) != 0) in kex_kem_sntrup761x25519_enc()
125 crypto_kem_sntrup761_enc(ciphertext, kem_key, client_pub); in kex_kem_sntrup761x25519_enc()
127 server_pub = ciphertext + crypto_kem_sntrup761_CIPHERTEXTBYTES; in kex_kem_sntrup761x25519_enc()
137 dump_digest("server cipher text:", ciphertext, in kex_kem_sntrup761x25519_enc()
169 const u_char *ciphertext, *server_pub; in kex_kem_sntrup761x25519_dec() local
181 ciphertext = sshbuf_ptr(server_blob); in kex_kem_sntrup761x25519_dec()
182 server_pub = ciphertext + crypto_kem_sntrup761_CIPHERTEXTBYTES; in kex_kem_sntrup761x25519_dec()
184 dump_digest("server cipher text:", ciphertext, in kex_kem_sntrup761x25519_dec()
196 decoded = crypto_kem_sntrup761_dec(kem_key, ciphertext, in kex_kem_sntrup761x25519_dec()
/src/crypto/krb5/src/lib/krb5/krb/
H A Denc_keyhelper.c45 cipher->ciphertext.length = enclen; in k5_encrypt_keyhelper()
46 cipher->ciphertext.data = malloc(enclen); in k5_encrypt_keyhelper()
47 if (cipher->ciphertext.data == NULL) in k5_encrypt_keyhelper()
51 free(cipher->ciphertext.data); in k5_encrypt_keyhelper()
52 cipher->ciphertext.data = NULL; in k5_encrypt_keyhelper()
H A Dencode_kdc.c99 (void) memset(dec_rep->enc_part.ciphertext.data, 0, \ in krb5_encode_kdc_rep()
100 dec_rep->enc_part.ciphertext.length); \ in krb5_encode_kdc_rep()
101 free(dec_rep->enc_part.ciphertext.data); \ in krb5_encode_kdc_rep()
102 dec_rep->enc_part.ciphertext.length = 0; \ in krb5_encode_kdc_rep()
103 dec_rep->enc_part.ciphertext.data = 0;} in krb5_encode_kdc_rep()
H A Denc_helper.c43 cipher->ciphertext.length = enclen; in krb5_encrypt_helper()
44 if ((cipher->ciphertext.data = (char *) malloc(enclen)) == NULL) in krb5_encrypt_helper()
48 free(cipher->ciphertext.data); in krb5_encrypt_helper()
49 cipher->ciphertext.data = NULL; in krb5_encrypt_helper()
H A Dmk_rep.c130 memset(reply.enc_part.ciphertext.data, 0, reply.enc_part.ciphertext.length); in k5_mk_rep()
131 free(reply.enc_part.ciphertext.data); in k5_mk_rep()
132 reply.enc_part.ciphertext.length = 0; in k5_mk_rep()
133 reply.enc_part.ciphertext.data = 0; in k5_mk_rep()
H A Dmk_priv.c77 ret = alloc_data(&privmsg.enc_part.ciphertext, enclen); in create_krbpriv()
98 zapfree(privmsg.enc_part.ciphertext.data, in create_krbpriv()
99 privmsg.enc_part.ciphertext.length); in create_krbpriv()
151 zapfree(enc.ciphertext.data, enc.ciphertext.length); in krb5_mk_priv()
/src/sys/contrib/libsodium/test/default/
H A Daead_aes256gcm.c3083 unsigned char *ciphertext; in tv() local
3135 ciphertext = (unsigned char *) sodium_malloc(ciphertext_len); in tv()
3150 ciphertext, ciphertext_len); in tv()
3155 crypto_aead_aes256gcm_encrypt(ciphertext, &found_ciphertext_len, in tv()
3160 if (memcmp(ciphertext, expected_ciphertext, ciphertext_len) != 0) { in tv()
3164 ciphertext, ciphertext_len); in tv()
3172 NULL, ciphertext, in tv()
3189 NULL, ciphertext, ciphertext_len, in tv()
3194 NULL, ciphertext, ciphertext_len, in tv()
3216 sodium_free(ciphertext); in tv()
/src/contrib/libfido2/tools/
H A Dlargeblob.c359 decode(const struct blob *ciphertext, const struct blob *nonce, in decode() argument
377 if (ciphertext->len > UINT_MAX || in decode()
378 ciphertext->len > SIZE_MAX - 16 || in decode()
379 ciphertext->len < 16) in decode()
381 plaintext.len = ciphertext->len - 16; in decode()
390 ciphertext->ptr + ciphertext->len - 16) == 0) in decode()
399 EVP_Cipher(ctx, plaintext.ptr, ciphertext->ptr, in decode()
417 try_rp(const fido_credman_rk_t *rk, const struct blob *ciphertext, in try_rp() argument
424 decode(ciphertext, nonce, origsiz, cred) == 0) in try_rp()
446 decode_blob_entry(const cbor_item_t *item, struct blob *ciphertext, in decode_blob_entry() argument
[all …]
/src/secure/lib/libcrypt/
H A Dcrypt-blowfish.c142 u_int8_t ciphertext[4 * BCRYPT_BLOCKS] = "OrpheanBeholderScryDoubt"; in crypt_blowfish() local
228 cdata[i] = Blowfish_stream2word(ciphertext, 4 * BCRYPT_BLOCKS, &j); in crypt_blowfish()
235 ciphertext[4 * i + 3] = cdata[i] & 0xff; in crypt_blowfish()
237 ciphertext[4 * i + 2] = cdata[i] & 0xff; in crypt_blowfish()
239 ciphertext[4 * i + 1] = cdata[i] & 0xff; in crypt_blowfish()
241 ciphertext[4 * i + 0] = cdata[i] & 0xff; in crypt_blowfish()
256 encode_base64((u_int8_t *)buffer, ciphertext, 4 * BCRYPT_BLOCKS - 1); in crypt_blowfish()
258 memset(ciphertext, 0, sizeof(ciphertext)); in crypt_blowfish()
/src/crypto/openssl/crypto/camellia/
H A Dcmll_local.h35 u8 ciphertext[]);
36 void Camellia_DecryptBlock_Rounds(int grandRounds, const u8 ciphertext[],
40 const KEY_TABLE_TYPE keyTable, u8 ciphertext[]);
41 void Camellia_DecryptBlock(int keyBitLength, const u8 ciphertext[],
H A Dcamellia.c407 u8 ciphertext[]) in Camellia_EncryptBlock_Rounds() argument
445 PUTU32(ciphertext, s2); in Camellia_EncryptBlock_Rounds()
446 PUTU32(ciphertext + 4, s3); in Camellia_EncryptBlock_Rounds()
447 PUTU32(ciphertext + 8, s0); in Camellia_EncryptBlock_Rounds()
448 PUTU32(ciphertext + 12, s1); in Camellia_EncryptBlock_Rounds()
452 const KEY_TABLE_TYPE keyTable, u8 ciphertext[]) in Camellia_EncryptBlock() argument
455 plaintext, keyTable, ciphertext); in Camellia_EncryptBlock()
458 void Camellia_DecryptBlock_Rounds(int grandRounds, const u8 ciphertext[], in Camellia_DecryptBlock_Rounds() argument
465 s0 = GETU32(ciphertext) ^ k[0]; in Camellia_DecryptBlock_Rounds()
466 s1 = GETU32(ciphertext + 4) ^ k[1]; in Camellia_DecryptBlock_Rounds()
[all …]
/src/crypto/krb5/src/plugins/preauth/securid_sam2/
H A Dgrail.c90 enc.ciphertext = *enc_track_data; in decrypt_track_data()
121 enc.ciphertext = empty_data(); in encrypt_track_data()
133 ret = alloc_data(&enc.ciphertext, olen); in encrypt_track_data()
145 *output = enc.ciphertext; in encrypt_track_data()
146 enc.ciphertext = empty_data(); in encrypt_track_data()
150 krb5_free_data_contents(context, &enc.ciphertext); in encrypt_track_data()
211 if ((sr2->sam_enc_nonce_or_sad.ciphertext.data == NULL) || in verify_grail_data()
212 (sr2->sam_enc_nonce_or_sad.ciphertext.length <= 0)) in verify_grail_data()
226 ret = alloc_data(&scratch, sr2->sam_enc_nonce_or_sad.ciphertext.length); in verify_grail_data()
/src/crypto/openssl/doc/man7/
H A Ddes_modes.pod31 The same plaintext block always produces the same ciphertext block
36 An error will only affect one ciphertext block.
54 The CBC mode produces the same ciphertext whenever the same
59 The chaining operation makes the ciphertext blocks dependent on the
66 enciphering to the same ciphertext.
70 An error will affect the current and the following ciphertext blocks.
86 The CFB mode produces the same ciphertext whenever the same
91 The chaining operation makes the ciphertext variables dependent on the
98 enciphering to the same ciphertext.
117 An error will affect the current and the following ciphertext variables.
[all …]
/src/crypto/krb5/src/lib/crypto/krb/
H A Ddecrypt.c51 if (input->ciphertext.length < header_len + trailer_len) in krb5_k_decrypt()
53 plain_len = input->ciphertext.length - header_len - trailer_len; in krb5_k_decrypt()
63 memcpy(iov[0].data.data, input->ciphertext.data, header_len); in krb5_k_decrypt()
67 memcpy(iov[1].data.data, input->ciphertext.data + header_len, plain_len); in krb5_k_decrypt()
75 memcpy(iov[3].data.data, input->ciphertext.data + header_len + plain_len, in krb5_k_decrypt()
/src/crypto/openssh/openbsd-compat/
H A Dbcrypt_pbkdf.c76 uint8_t ciphertext[BCRYPT_HASHSIZE] = in bcrypt_hash() local
94 cdata[i] = Blowfish_stream2word(ciphertext, sizeof(ciphertext), in bcrypt_hash()
108 explicit_bzero(ciphertext, sizeof(ciphertext)); in bcrypt_hash()
/src/sys/contrib/openzfs/module/icp/api/
H A Dkcf_cipher.c70 crypto_key_t *key, crypto_ctx_template_t tmpl, crypto_data_t *ciphertext) in crypto_encrypt() argument
94 plaintext, ciphertext, spi_ctx_tmpl); in crypto_encrypt()
140 crypto_decrypt(crypto_mechanism_t *mech, crypto_data_t *ciphertext, in crypto_decrypt() argument
166 ciphertext, plaintext, spi_ctx_tmpl); in crypto_decrypt()

12345