Home
last modified time | relevance | path

Searched refs:outlen (Results 1 – 25 of 121) sorted by relevance

12345

/openssl/demos/cipher/
H A Dariacbc.c60 int outlen, tmplen; in aria_cbc_encrypt() local
89 if (!EVP_EncryptFinal_ex(ctx, outbuf + outlen, &tmplen)) in aria_cbc_encrypt()
91 outlen += tmplen; in aria_cbc_encrypt()
94 printf("Ciphertext (outlen:%d):\n", outlen); in aria_cbc_encrypt()
95 BIO_dump_fp(stdout, outbuf, outlen); in aria_cbc_encrypt()
97 if (sizeof(cbc_ct) == outlen && !CRYPTO_memcmp(outbuf, cbc_ct, outlen)) in aria_cbc_encrypt()
118 int outlen, tmplen, rv; in aria_cbc_decrypt() local
147 outlen += tmplen; in aria_cbc_decrypt()
150 printf("Plaintext (outlen:%d):\n", outlen); in aria_cbc_decrypt()
151 BIO_dump_fp(stdout, outbuf, outlen); in aria_cbc_decrypt()
[all …]
H A Daesccm.c76 int outlen, tmplen; in aes_ccm_encrypt() local
116 if (!EVP_EncryptUpdate(ctx, NULL, &outlen, NULL, sizeof(ccm_pt))) in aes_ccm_encrypt()
120 if (!EVP_EncryptUpdate(ctx, NULL, &outlen, ccm_adata, sizeof(ccm_adata))) in aes_ccm_encrypt()
124 if (!EVP_EncryptUpdate(ctx, outbuf, &outlen, ccm_pt, sizeof(ccm_pt))) in aes_ccm_encrypt()
129 BIO_dump_fp(stdout, outbuf, outlen); in aes_ccm_encrypt()
163 int outlen, rv; in aes_ccm_decrypt() local
200 if (!EVP_DecryptUpdate(ctx, NULL, &outlen, NULL, sizeof(ccm_ct))) in aes_ccm_decrypt()
204 if (!EVP_DecryptUpdate(ctx, NULL, &outlen, ccm_adata, sizeof(ccm_adata))) in aes_ccm_decrypt()
208 rv = EVP_DecryptUpdate(ctx, outbuf, &outlen, ccm_ct, sizeof(ccm_ct)); in aes_ccm_decrypt()
213 BIO_dump_fp(stdout, outbuf, outlen); in aes_ccm_decrypt()
H A Daesgcm.c75 int outlen, tmplen; in aes_gcm_encrypt() local
110 if (!EVP_EncryptUpdate(ctx, NULL, &outlen, gcm_aad, sizeof(gcm_aad))) in aes_gcm_encrypt()
114 if (!EVP_EncryptUpdate(ctx, outbuf, &outlen, gcm_pt, sizeof(gcm_pt))) in aes_gcm_encrypt()
119 BIO_dump_fp(stdout, outbuf, outlen); in aes_gcm_encrypt()
152 int outlen, rv; in aes_gcm_decrypt() local
182 if (!EVP_DecryptUpdate(ctx, NULL, &outlen, gcm_aad, sizeof(gcm_aad))) in aes_gcm_decrypt()
186 if (!EVP_DecryptUpdate(ctx, outbuf, &outlen, gcm_ct, sizeof(gcm_ct))) in aes_gcm_decrypt()
191 BIO_dump_fp(stdout, outbuf, outlen); in aes_gcm_decrypt()
201 rv = EVP_DecryptFinal_ex(ctx, outbuf, &outlen); in aes_gcm_decrypt()
/openssl/crypto/asn1/
H A Da_strex.c149 outlen = 0; in do_buf()
229 return outlen; in do_buf()
293 if (outlen < 0) in do_dump()
334 int outlen, len; in do_print_ex() local
344 outlen = 0; in do_print_ex()
352 outlen++; in do_print_ex()
396 outlen += len; in do_print_ex()
398 outlen += 2; in do_print_ex()
407 return outlen; in do_print_ex()
434 int outlen, len; in do_name_ex() local
[all …]
H A Da_mbstr.c49 int outform, outlen = 0; in ASN1_mbstring_ncopy() local
165 outlen = nchar; in ASN1_mbstring_ncopy()
170 outlen = nchar << 1; in ASN1_mbstring_ncopy()
175 outlen = nchar << 2; in ASN1_mbstring_ncopy()
180 outlen = 0; in ASN1_mbstring_ncopy()
185 if ((p = OPENSSL_malloc(outlen + 1)) == NULL) { in ASN1_mbstring_ncopy()
191 dest->length = outlen; in ASN1_mbstring_ncopy()
193 p[outlen] = 0; in ASN1_mbstring_ncopy()
258 int *outlen, len; in out_utf8() local
263 outlen = arg; in out_utf8()
[all …]
/openssl/providers/implementations/kem/
H A Drsa_kem.c210 unsigned char *out, int outlen) in rsasve_gen_rand_bytes() argument
234 && (BN_bn2binpad(z, out, outlen) == outlen)); in rsasve_gen_rand_bytes()
245 unsigned char *out, size_t *outlen, in rsasve_generate() argument
259 if (outlen == NULL && secretlen == NULL) in rsasve_generate()
261 if (outlen != NULL) in rsasve_generate()
262 *outlen = nlen; in rsasve_generate()
278 if (outlen != NULL) in rsasve_generate()
279 *outlen = nlen; in rsasve_generate()
293 unsigned char *out, size_t *outlen, in rsasve_recover() argument
306 *outlen = nlen; in rsasve_recover()
[all …]
/openssl/crypto/pkcs12/
H A Dp12_decr.c26 int outlen, i; in PKCS12_pbe_crypt_ex() local
82 outlen = i; in PKCS12_pbe_crypt_ex()
91 outlen += i; in PKCS12_pbe_crypt_ex()
96 (int)mac_len, out+outlen) < 0) { in PKCS12_pbe_crypt_ex()
102 outlen += mac_len; in PKCS12_pbe_crypt_ex()
106 *datalen = outlen; in PKCS12_pbe_crypt_ex()
138 int outlen = 0; in PKCS12_item_decrypt_d2i_ex() local
141 &out, &outlen, 0, libctx, propq)) in PKCS12_item_decrypt_d2i_ex()
146 BIO_dump(trc_out, out, outlen); in PKCS12_item_decrypt_d2i_ex()
149 ret = ASN1_item_d2i(NULL, &p, outlen, it); in PKCS12_item_decrypt_d2i_ex()
[all …]
/openssl/test/
H A Dpkey_meth_kdf_test.c24 size_t outlen = sizeof(out); in test_kdf_tls1_prf() local
48 if (EVP_PKEY_derive(pctx, out, &outlen) <= 0) { in test_kdf_tls1_prf()
73 size_t outlen = sizeof(out); in test_kdf_hkdf() local
102 if (EVP_PKEY_derive(pctx, out, &outlen) <= 0) { in test_kdf_hkdf()
127 size_t outlen = sizeof(out); in test_kdf_scrypt() local
161 if (EVP_PKEY_derive(pctx, out, &outlen) > 0) { in test_kdf_scrypt()
169 if (EVP_PKEY_derive(pctx, out, &outlen) <= 0) { in test_kdf_scrypt()
H A Dpbetest.c63 int i, outlen; in test_pkcs5_pbe() local
81 outlen = i; in test_pkcs5_pbe()
85 outlen += i; in test_pkcs5_pbe()
87 if (!TEST_mem_eq(out, outlen, exp, exp_len)) in test_pkcs5_pbe()
97 outlen = i; in test_pkcs5_pbe()
101 if (!TEST_mem_eq(out, outlen, pbe_plaintext, sizeof(pbe_plaintext))) in test_pkcs5_pbe()
H A Daesgcmtest.c43 int outlen; in do_encrypt() local
52 && TEST_true(EVP_EncryptUpdate(ctx, NULL, &outlen, gcm_aad, in do_encrypt()
56 && TEST_true(EVP_EncryptFinal_ex(ctx, outbuf, &outlen) > 0) in do_encrypt()
71 int outlen, ptlen; in do_decrypt() local
80 && TEST_true(EVP_DecryptUpdate(ctx, NULL, &outlen, gcm_aad, in do_decrypt()
86 && TEST_true(EVP_DecryptFinal_ex(ctx, outbuf, &outlen) > 0) in do_decrypt()
H A Drecordlentest.c46 size_t outlen; in write_record() local
49 outlen = sizeof(buf); in write_record()
51 outlen = len; in write_record()
53 if (!BIO_write_ex(b, buf, outlen, &written) in write_record()
54 || written != outlen) in write_record()
57 len -= outlen; in write_record()
/openssl/crypto/ct/
H A Dct_b64.c27 int outlen, i; in ct_base64_decode() local
35 outlen = (inlen / 4) * 3; in ct_base64_decode()
36 outbuf = OPENSSL_malloc(outlen); in ct_base64_decode()
42 outlen = EVP_DecodeBlock(outbuf, (unsigned char *)in, inlen); in ct_base64_decode()
43 if (outlen < 0) { in ct_base64_decode()
51 --outlen; in ct_base64_decode()
57 return outlen; in ct_base64_decode()
/openssl/providers/implementations/rands/
H A Ddrbg_hash.c79 size_t outlen = drbg->seedlen; in hash_df() local
80 size_t num_bits_returned = outlen * 8; in hash_df()
110 if (outlen < hash->blocklen) { in hash_df()
113 memcpy(out, vtmp, outlen); in hash_df()
120 outlen -= hash->blocklen; in hash_df()
121 if (outlen == 0) in hash_df()
212 if (outlen == 0) in hash_gen()
221 if (outlen < hash->blocklen) { in hash_gen()
229 outlen -= hash->blocklen; in hash_gen()
230 if (outlen == 0) in hash_gen()
[all …]
H A Ddrbg_ctr.c103 int i, outlen = AES_BLOCK_SIZE; in ctr_BCC_block() local
109 || outlen != len) in ctr_BCC_block()
204 int outlen = AES_BLOCK_SIZE; in ctr_df() local
239 || outlen != AES_BLOCK_SIZE) in ctr_df()
265 int outlen = AES_BLOCK_SIZE; in ctr_update() local
281 || outlen != len) in ctr_update()
401 if (outlen == 0) { in drbg_ctr_generate()
409 memset(out, 0, outlen); in drbg_ctr_generate()
423 buflen = outlen > (1U << 30) ? (1U << 30) : outlen; in drbg_ctr_generate()
443 outlen -= buflen; in drbg_ctr_generate()
[all …]
/openssl/test/testutil/
H A Dfake_random.c70 static int fake_rand_generate(void *vrng, unsigned char *out, size_t outlen, in fake_rand_generate() argument
79 return (*frng->cb)(out, outlen, frng->name, frng->ctx); in fake_rand_generate()
80 while (outlen > 0) { in fake_rand_generate()
82 l = outlen < sizeof(r) ? outlen : sizeof(r); in fake_rand_generate()
86 outlen -= l; in fake_rand_generate()
215 int (*cb)(unsigned char *out, size_t outlen, in fake_rand_set_callback() argument
224 size_t outlen, in fake_rand_set_public_private_callbacks() argument
/openssl/crypto/ec/
H A Decdh_kdf.c24 int ossl_ecdh_kdf_X9_63(unsigned char *out, size_t outlen, in ossl_ecdh_kdf_X9_63() argument
45 ret = EVP_KDF_derive(kctx, out, outlen, params) > 0; in ossl_ecdh_kdf_X9_63()
57 int ECDH_KDF_X9_62(unsigned char *out, size_t outlen, in ECDH_KDF_X9_62() argument
62 return ossl_ecdh_kdf_X9_63(out, outlen, Z, Zlen, sinfo, sinfolen, md, NULL, in ECDH_KDF_X9_62()
/openssl/doc/man3/
H A DEVP_PKEY_decrypt.pod15 unsigned char *out, size_t *outlen,
30 buffer is written to the B<outlen> parameter. If B<out> is not B<NULL> then
31 before the call the B<outlen> parameter should contain the length of the
33 B<out> and the amount of data written to B<outlen>.
62 size_t outlen, inlen;
78 if (EVP_PKEY_decrypt(ctx, NULL, &outlen, in, inlen) <= 0)
81 out = OPENSSL_malloc(outlen);
86 if (EVP_PKEY_decrypt(ctx, out, &outlen, in, inlen) <= 0)
89 /* Decrypted data is outlen bytes written to buffer out */
H A DEVP_PKEY_encrypt.pod15 unsigned char *out, size_t *outlen,
30 buffer is written to the B<outlen> parameter. If B<out> is not B<NULL> then
31 before the call the B<outlen> parameter should contain the length of the
33 B<out> and the amount of data written to B<outlen>.
65 size_t outlen, inlen;
81 if (EVP_PKEY_encrypt(ctx, NULL, &outlen, in, inlen) <= 0)
84 out = OPENSSL_malloc(outlen);
89 if (EVP_PKEY_encrypt(ctx, out, &outlen, in, inlen) <= 0)
92 /* Encrypted data is outlen bytes written to buffer out */
H A DEVP_PKEY_encapsulate.pod14 unsigned char *out, size_t *outlen,
26 I<*outlen> parameter and the maximum size of the generated key buffer is written
30 I<out> and its size is written to I<*outlen>.
54 size_t secretlen = 0, outlen = 0;
67 if (EVP_PKEY_encapsulate(ctx, NULL, &outlen, NULL, &secretlen) <= 0)
70 out = OPENSSL_malloc(outlen);
80 if (EVP_PKEY_encapsulate(ctx, out, &outlen, secret, &secretlen) <= 0)
H A DSSL_get_client_random.pod15 size_t SSL_get_client_random(const SSL *ssl, unsigned char *out, size_t outlen);
16 size_t SSL_get_server_random(const SSL *ssl, unsigned char *out, size_t outlen);
18 unsigned char *out, size_t outlen);
27 which must have at least B<outlen> bytes available. It returns the
28 total number of bytes that were actually copied. If B<outlen> is
69 other outlen arguments to the SSL_get_*_random() functions is provided
82 For the other functions, if B<outlen> is greater than 0 then these functions
84 B<outlen>. If B<outlen> is 0 then these functions return the maximum number
/openssl/crypto/dh/
H A Ddh_kdf.c27 int ossl_dh_kdf_X9_42_asn1(unsigned char *out, size_t outlen, in ossl_dh_kdf_X9_42_asn1() argument
57 ret = EVP_KDF_derive(kctx, out, outlen, params) > 0; in ossl_dh_kdf_X9_42_asn1()
65 int DH_KDF_X9_42(unsigned char *out, size_t outlen, in DH_KDF_X9_42() argument
77 return ossl_dh_kdf_X9_42_asn1(out, outlen, Z, Zlen, key_alg, in DH_KDF_X9_42()
/openssl/crypto/pem/
H A Dpvkfmt.c574 outlen = 16 in do_i2b()
608 return outlen; in do_i2b()
614 int outlen, wrlen; in do_i2b_bio() local
617 if (outlen < 0) in do_i2b_bio()
622 return outlen; in do_i2b_bio()
1023 outlen += pklen; in i2b_PVK()
1025 return outlen; in i2b_PVK()
1096 ret = outlen; in i2b_PVK()
1113 int outlen, wrlen; in i2b_PVK_bio_ex() local
1116 if (outlen < 0) in i2b_PVK_bio_ex()
[all …]
/openssl/providers/implementations/asymciphers/
H A Dsm2_enc.c81 static int sm2_asym_encrypt(void *vpsm2ctx, unsigned char *out, size_t *outlen, in sm2_asym_encrypt() argument
92 if (!ossl_sm2_ciphertext_size(psm2ctx->key, md, inlen, outlen)) { in sm2_asym_encrypt()
99 return ossl_sm2_encrypt(psm2ctx->key, md, in, inlen, out, outlen); in sm2_asym_encrypt()
102 static int sm2_asym_decrypt(void *vpsm2ctx, unsigned char *out, size_t *outlen, in sm2_asym_decrypt() argument
113 if (!ossl_sm2_plaintext_size(in, inlen, outlen)) in sm2_asym_decrypt()
118 return ossl_sm2_decrypt(psm2ctx->key, md, in, inlen, out, outlen); in sm2_asym_decrypt()
/openssl/crypto/rsa/
H A Drsa_oaep.c335 long i, outlen = 0; in PKCS1_MGF1() local
348 for (i = 0; outlen < len; i++) { in PKCS1_MGF1()
359 if (outlen + mdlen <= len) { in PKCS1_MGF1()
360 if (!EVP_DigestFinal_ex(c, mask + outlen, NULL)) in PKCS1_MGF1()
362 outlen += mdlen; in PKCS1_MGF1()
366 memcpy(mask + outlen, md, len - outlen); in PKCS1_MGF1()
367 outlen = len; in PKCS1_MGF1()
/openssl/providers/implementations/exchange/
H A Decdh_exch.c297 size_t outlen; in ecdh_set_ctx_params() local
299 if (!OSSL_PARAM_get_size_t(p, &outlen)) in ecdh_set_ctx_params()
301 pectx->kdf_outlen = outlen; in ecdh_set_ctx_params()
431 size_t *psecretlen, size_t outlen) in ecdh_plain_derive() argument
461 size = outlen < ecdhsize ? outlen : ecdhsize; in ecdh_plain_derive()
509 size_t *psecretlen, size_t outlen) in ecdh_X9_63_kdf_derive() argument
521 if (pecdhctx->kdf_outlen > outlen) { in ecdh_X9_63_kdf_derive()
552 size_t *psecretlen, size_t outlen) in ecdh_derive() argument
558 return ecdh_plain_derive(vpecdhctx, secret, psecretlen, outlen); in ecdh_derive()
560 return ecdh_X9_63_kdf_derive(vpecdhctx, secret, psecretlen, outlen); in ecdh_derive()

Completed in 88 milliseconds

12345