Home
last modified time | relevance | path

Searched refs:olen (Results 1 – 25 of 77) sorted by relevance

1234

/mbedtls-3.5.0/3rdparty/everest/library/
Dx25519.c59 int mbedtls_x25519_make_params( mbedtls_x25519_context *ctx, size_t *olen, in mbedtls_x25519_make_params() argument
71 *olen = MBEDTLS_X25519_KEY_SIZE_BYTES + 4; in mbedtls_x25519_make_params()
72 if( blen < *olen ) in mbedtls_x25519_make_params()
107 size_t olen = 0; in mbedtls_x25519_get_params() local
111 …return mbedtls_ecp_point_write_binary( &key->grp, &key->Q, MBEDTLS_ECP_PF_COMPRESSED, &olen, ctx->… in mbedtls_x25519_get_params()
119 int mbedtls_x25519_calc_secret( mbedtls_x25519_context *ctx, size_t *olen, in mbedtls_x25519_calc_secret() argument
129 *olen = MBEDTLS_X25519_KEY_SIZE_BYTES; in mbedtls_x25519_calc_secret()
131 if( blen < *olen ) in mbedtls_x25519_calc_secret()
145 int mbedtls_x25519_make_public( mbedtls_x25519_context *ctx, size_t *olen, in mbedtls_x25519_make_public() argument
159 *olen = MBEDTLS_X25519_KEY_SIZE_BYTES + 1; in mbedtls_x25519_make_public()
[all …]
Deverest.c48 int mbedtls_everest_make_params( mbedtls_ecdh_context_everest *ctx, size_t *olen, in mbedtls_everest_make_params() argument
54 return mbedtls_x25519_make_params( x25519_ctx, olen, buf, blen, f_rng, p_rng ); in mbedtls_everest_make_params()
76 int mbedtls_everest_make_public( mbedtls_ecdh_context_everest *ctx, size_t *olen, in mbedtls_everest_make_public() argument
82 return mbedtls_x25519_make_public( x25519_ctx, olen, buf, blen, f_rng, p_rng ); in mbedtls_everest_make_public()
92 int mbedtls_everest_calc_secret( mbedtls_ecdh_context_everest *ctx, size_t *olen, in mbedtls_everest_calc_secret() argument
98 return mbedtls_x25519_calc_secret( x25519_ctx, olen, buf, blen, f_rng, p_rng ); in mbedtls_everest_calc_secret()
/mbedtls-3.5.0/tests/suites/
Dtest_suite_gcm.function21 size_t olen;
37 olen = 0xdeadbeef;
38 TEST_EQUAL(0, mbedtls_gcm_update(ctx, input->x, n1, output, n1, &olen));
39 TEST_EQUAL(n1, olen);
40 ASSERT_COMPARE(output, olen, expected_output->x, n1);
45 olen = 0xdeadbeef;
46 TEST_EQUAL(0, mbedtls_gcm_update(ctx, input->x + n1, n2, output, n2, &olen));
47 TEST_EQUAL(n2, olen);
48 ASSERT_COMPARE(output, olen, expected_output->x + n1, n2);
53 TEST_EQUAL(0, mbedtls_gcm_finish(ctx, NULL, 0, &olen, output, tag->len));
[all …]
Dtest_suite_pem.function16 size_t olen = 0, olen2 = 0;
19 ret = mbedtls_pem_write_buffer(start, end, buf->x, buf->len, NULL, 0, &olen);
22 check_buf = (unsigned char *) mbedtls_calloc(1, olen);
25 ret = mbedtls_pem_write_buffer(start, end, buf->x, buf->len, check_buf, olen, &olen2);
27 TEST_ASSERT(olen2 <= olen);
28 TEST_ASSERT(olen > strlen((char *) result_str));
30 TEST_ASSERT(strncmp((char *) check_buf, (char *) result_str, olen) == 0);
Dtest_suite_ccm.function21 size_t olen;
36 olen = 0xdeadbeef;
37 TEST_EQUAL(0, mbedtls_ccm_update(ctx, input->x, n1, output, n1, &olen));
38 TEST_EQUAL(n1, olen);
39 ASSERT_COMPARE(output, olen, expected_output->x, n1);
44 olen = 0xdeadbeef;
45 TEST_EQUAL(0, mbedtls_ccm_update(ctx, input->x + n1, n2, output, n2, &olen));
46 TEST_EQUAL(n2, olen);
47 ASSERT_COMPARE(output, olen, expected_output->x + n1, n2);
242 size_t olen;
[all …]
/mbedtls-3.5.0/library/
Dentropy_poll.c58 size_t *olen) in mbedtls_platform_entropy_poll() argument
62 *olen = 0; in mbedtls_platform_entropy_poll()
75 *olen = len; in mbedtls_platform_entropy_poll()
159 unsigned char *output, size_t len, size_t *olen) in mbedtls_platform_entropy_poll() argument
169 *olen = ret; in mbedtls_platform_entropy_poll()
185 *olen = len; in mbedtls_platform_entropy_poll()
189 *olen = 0; in mbedtls_platform_entropy_poll()
206 *olen = len; in mbedtls_platform_entropy_poll()
216 unsigned char *output, size_t len, size_t *olen) in mbedtls_nv_seed_poll() argument
233 *olen = use_len; in mbedtls_nv_seed_poll()
Dcipher.c520 size_t ilen, unsigned char *output, size_t *olen) in mbedtls_cipher_update() argument
538 *olen = 0; in mbedtls_cipher_update()
549 *olen = ilen; in mbedtls_cipher_update()
563 output, ilen, olen); in mbedtls_cipher_update()
571 output, ilen, olen); in mbedtls_cipher_update()
577 *olen = ilen; in mbedtls_cipher_update()
623 *olen += block_size; in mbedtls_cipher_update()
663 *olen += ilen; in mbedtls_cipher_update()
679 *olen = ilen; in mbedtls_cipher_update()
693 *olen = ilen; in mbedtls_cipher_update()
[all …]
Dnist_kw.c144 size_t olen, padlen = 0; in mbedtls_nist_kw_wrap() local
208 inbuff, 16, output, &olen); in mbedtls_nist_kw_wrap()
230 inbuff, 16, outbuff, &olen); in mbedtls_nist_kw_wrap()
274 size_t olen; in unwrap() local
297 inbuff, 16, outbuff, &olen); in unwrap()
336 size_t i, olen; in mbedtls_nist_kw_unwrap() local
390 input, 16, outbuff, &olen); in mbedtls_nist_kw_unwrap()
560 size_t olen; in mbedtls_nist_kw_self_test() local
581 kw_msg_len[i], out, &olen, sizeof(out)); in mbedtls_nist_kw_self_test()
582 if (ret != 0 || kw_out_len[i] != olen || in mbedtls_nist_kw_self_test()
[all …]
Decdh.c277 size_t *olen, int point_format, in ecdh_make_params_internal() argument
329 *olen = grp_len + pt_len; in ecdh_make_params_internal()
340 int mbedtls_ecdh_make_params(mbedtls_ecdh_context *ctx, size_t *olen, in mbedtls_ecdh_make_params() argument
353 return ecdh_make_params_internal(ctx, olen, ctx->point_format, buf, blen, in mbedtls_ecdh_make_params()
359 return mbedtls_everest_make_params(&ctx->ctx.everest_ecdh, olen, in mbedtls_ecdh_make_params()
363 return ecdh_make_params_internal(&ctx->ctx.mbed_ecdh, olen, in mbedtls_ecdh_make_params()
496 size_t *olen, int point_format, in ecdh_make_public_internal() argument
533 return mbedtls_ecp_tls_write_point(&ctx->grp, &ctx->Q, point_format, olen, in ecdh_make_public_internal()
540 int mbedtls_ecdh_make_public(mbedtls_ecdh_context *ctx, size_t *olen, in mbedtls_ecdh_make_public() argument
551 return ecdh_make_public_internal(ctx, olen, ctx->point_format, buf, blen, in mbedtls_ecdh_make_public()
[all …]
Dbase64.c39 int mbedtls_base64_encode(unsigned char *dst, size_t dlen, size_t *olen, in mbedtls_base64_encode() argument
47 *olen = 0; in mbedtls_base64_encode()
54 *olen = BASE64_SIZE_T_MAX; in mbedtls_base64_encode()
61 *olen = n + 1; in mbedtls_base64_encode()
97 *olen = p - dst; in mbedtls_base64_encode()
106 int mbedtls_base64_decode(unsigned char *dst, size_t dlen, size_t *olen, in mbedtls_base64_decode() argument
165 *olen = 0; in mbedtls_base64_decode()
177 *olen = n; in mbedtls_base64_decode()
206 *olen = p - dst; in mbedtls_base64_decode()
Dgcm.c73 size_t olen = 0; in gcm_gen_table() local
76 if ((ret = mbedtls_cipher_update(&ctx->cipher_ctx, h, 16, h, &olen)) != 0) { in gcm_gen_table()
266 size_t use_len, olen = 0; in mbedtls_gcm_starts() local
308 ctx->base_ectr, &olen)) != 0) { in mbedtls_gcm_starts()
400 size_t olen = 0; in gcm_mask() local
404 &olen)) != 0) { in gcm_mask()
569 size_t olen; in mbedtls_gcm_crypt_and_tag() local
580 output, length, &olen)) != 0) { in mbedtls_gcm_crypt_and_tag()
584 if ((ret = mbedtls_gcm_finish(ctx, NULL, 0, &olen, tag, tag_len)) != 0) { in mbedtls_gcm_crypt_and_tag()
872 size_t olen; in mbedtls_gcm_self_test() local
[all …]
Drsa.c729 size_t olen; in mbedtls_rsa_public() local
751 olen = ctx->len; in mbedtls_rsa_public()
753 MBEDTLS_MPI_CHK(mbedtls_mpi_write_binary(&T, output, olen)); in mbedtls_rsa_public()
866 size_t olen; in mbedtls_rsa_private() local
1037 olen = ctx->len; in mbedtls_rsa_private()
1038 MBEDTLS_MPI_CHK(mbedtls_mpi_write_binary(&T, output, olen)); in mbedtls_rsa_private()
1307 size_t olen; in mbedtls_rsa_rsaes_oaep_encrypt() local
1321 olen = ctx->len; in mbedtls_rsa_rsaes_oaep_encrypt()
1324 if (ilen + 2 * hlen + 2 < ilen || olen < ilen + 2 * hlen + 2) { in mbedtls_rsa_rsaes_oaep_encrypt()
1328 memset(output, 0, olen); in mbedtls_rsa_rsaes_oaep_encrypt()
[all …]
Dentropy.c235 size_t olen; in entropy_gather_internal() local
249 olen = 0; in entropy_gather_internal()
251 buf, MBEDTLS_ENTROPY_MAX_GATHER, &olen)) != 0) { in entropy_gather_internal()
258 if (olen > 0) { in entropy_gather_internal()
260 buf, olen)) != 0) { in entropy_gather_internal()
263 ctx->source[i].size += olen; in entropy_gather_internal()
539 size_t len, size_t *olen) in entropy_dummy_source() argument
544 *olen = len; in entropy_dummy_source()
555 size_t olen = 0; in mbedtls_entropy_source_self_test_gather() local
560 buf_len - entropy_len, &olen)) != 0) { in mbedtls_entropy_source_self_test_gather()
[all …]
Dssl_tls12_server.c1687 size_t *olen) in ssl_write_cid_ext() argument
1693 *olen = 0; in ssl_write_cid_ext()
1724 *olen = ssl->own_cid_len + 5; in ssl_write_cid_ext()
1731 size_t *olen) in ssl_write_encrypt_then_mac_ext() argument
1758 *olen = 0; in ssl_write_encrypt_then_mac_ext()
1770 *olen = 4; in ssl_write_encrypt_then_mac_ext()
1777 size_t *olen) in ssl_write_extended_ms_ext() argument
1782 *olen = 0; in ssl_write_extended_ms_ext()
1795 *olen = 4; in ssl_write_extended_ms_ext()
1802 size_t *olen) in ssl_write_session_ticket_ext() argument
[all …]
Dentropy_poll.h46 unsigned char *output, size_t len, size_t *olen);
59 unsigned char *output, size_t len, size_t *olen);
69 unsigned char *output, size_t len, size_t *olen);
Dccm.c118 size_t olen = 0; in mbedtls_ccm_crypt() local
123 &olen)) != 0) { in mbedtls_ccm_crypt()
146 size_t len_left, olen; in ccm_calculate_first_block_if_ready() local
192 if ((ret = mbedtls_cipher_update(&ctx->cipher_ctx, ctx->y, 16, ctx->y, &olen)) != 0) { in ccm_calculate_first_block_if_ready()
272 size_t olen, use_len, offset; in mbedtls_ccm_update_ad() local
313 mbedtls_cipher_update(&ctx->cipher_ctx, ctx->y, 16, ctx->y, &olen)) != 0) { in mbedtls_ccm_update_ad()
336 size_t use_len, offset, olen; in mbedtls_ccm_update() local
375 mbedtls_cipher_update(&ctx->cipher_ctx, ctx->y, 16, ctx->y, &olen)) != 0) { in mbedtls_ccm_update()
407 mbedtls_cipher_update(&ctx->cipher_ctx, ctx->y, 16, ctx->y, &olen)) != 0) { in mbedtls_ccm_update()
480 size_t olen; in ccm_auth_crypt() local
[all …]
/mbedtls-3.5.0/programs/aes/
Dcrypt_and_hash.c76 size_t keylen, ilen, olen; in main() local
341 if (mbedtls_cipher_update(&cipher_ctx, buffer, ilen, output, &olen) != 0) { in main()
346 if (mbedtls_md_hmac_update(&md_ctx, output, olen) != 0) { in main()
351 if (fwrite(output, 1, olen, fout) != olen) { in main()
352 mbedtls_fprintf(stderr, "fwrite(%ld bytes) failed\n", (long) olen); in main()
357 if (mbedtls_cipher_finish(&cipher_ctx, output, &olen) != 0) { in main()
361 if (mbedtls_md_hmac_update(&md_ctx, output, olen) != 0) { in main()
366 if (fwrite(output, 1, olen, fout) != olen) { in main()
367 mbedtls_fprintf(stderr, "fwrite(%ld bytes) failed\n", (long) olen); in main()
498 &olen) != 0) { in main()
[all …]
/mbedtls-3.5.0/programs/cipher/
Dcipher_aead_demo.c195 size_t olen; in aead_encrypt() local
203 CHK(mbedtls_cipher_update(ctx, part1, part1_len, p, &olen)); in aead_encrypt()
204 p += olen; in aead_encrypt()
205 CHK(mbedtls_cipher_update(ctx, part2, part2_len, p, &olen)); in aead_encrypt()
206 p += olen; in aead_encrypt()
207 CHK(mbedtls_cipher_finish(ctx, p, &olen)); in aead_encrypt()
208 p += olen; in aead_encrypt()
212 olen = p - out; in aead_encrypt()
213 print_buf("out", out, olen); in aead_encrypt()
/mbedtls-3.5.0/programs/psa/
Daead_demo.c210 size_t olen, olen_tag; in aead_encrypt() local
220 PSA_CHECK(psa_aead_update(&op, part1, part1_len, p, end - p, &olen)); in aead_encrypt()
221 p += olen; in aead_encrypt()
222 PSA_CHECK(psa_aead_update(&op, part2, part2_len, p, end - p, &olen)); in aead_encrypt()
223 p += olen; in aead_encrypt()
224 PSA_CHECK(psa_aead_finish(&op, p, end - p, &olen, in aead_encrypt()
226 p += olen; in aead_encrypt()
230 olen = p - out; in aead_encrypt()
231 print_buf("out", out, olen); in aead_encrypt()
/mbedtls-3.5.0/include/mbedtls/
Decjpake.h175 unsigned char *buf, size_t len, size_t *olen,
216 unsigned char *buf, size_t len, size_t *olen,
256 unsigned char *buf, size_t len, size_t *olen,
279 unsigned char *buf, size_t len, size_t *olen,
/mbedtls-3.5.0/tests/src/
Dhelpers.c265 unsigned char *mbedtls_test_unhexify_alloc(const char *ibuf, size_t *olen) in mbedtls_test_unhexify_alloc() argument
270 *olen = strlen(ibuf) / 2; in mbedtls_test_unhexify_alloc()
272 if (*olen == 0) { in mbedtls_test_unhexify_alloc()
273 return mbedtls_test_zero_alloc(*olen); in mbedtls_test_unhexify_alloc()
276 obuf = mbedtls_calloc(1, *olen); in mbedtls_test_unhexify_alloc()
278 TEST_HELPER_ASSERT(mbedtls_test_unhexify(obuf, *olen, ibuf, &len) == 0); in mbedtls_test_unhexify_alloc()
/mbedtls-3.5.0/programs/pkey/
Dpk_sign.c59 size_t olen = 0; in main() local
110 buf, sizeof(buf), &olen, in main()
126 if (fwrite(buf, 1, olen, f) != olen) { in main()
Drsa_sign_pss.c60 size_t olen = 0; in main() local
123 buf, sizeof(buf), &olen, in main()
139 if (fwrite(buf, 1, olen, f) != olen) { in main()
/mbedtls-3.5.0/programs/test/
Dbenchmark.c993 size_t olen; in main() local
1016 mbedtls_dhm_calc_secret(&dhm, buf, sizeof(buf), &olen, myrand, NULL)); in main()
1021 mbedtls_dhm_calc_secret(&dhm, buf, sizeof(buf), &olen, myrand, NULL)); in main()
1102 size_t olen; in main() local
1130 CHECK_AND_CONTINUE(mbedtls_ecdh_make_public(&ecdh, &olen, buf, sizeof(buf), in main()
1137 CHECK_AND_CONTINUE(mbedtls_ecdh_make_public(&ecdh, &olen, buf, sizeof(buf), in main()
1139 CHECK_AND_CONTINUE(mbedtls_ecdh_calc_secret(&ecdh, &olen, buf, sizeof(buf), in main()
1177 CHECK_AND_CONTINUE(mbedtls_ecdh_make_public(&ecdh, &olen, buf, sizeof(buf), in main()
1180 CHECK_AND_CONTINUE(mbedtls_ecdh_make_public(&ecdh, &olen, buf, sizeof(buf), in main()
1186 CHECK_AND_CONTINUE(mbedtls_ecdh_calc_secret(&ecdh, &olen, buf, sizeof(buf), in main()
[all …]
/mbedtls-3.5.0/3rdparty/everest/include/everest/
Dx25519.h81 int mbedtls_x25519_make_params( mbedtls_x25519_context *ctx, size_t *olen,
140 int mbedtls_x25519_calc_secret( mbedtls_x25519_context *ctx, size_t *olen,
163 int mbedtls_x25519_make_public( mbedtls_x25519_context *ctx, size_t *olen,

1234