Home
last modified time | relevance | path

Searched refs:sig (Results 1 – 25 of 39) sorted by relevance

12

/mbedtls-3.5.0/tests/suites/
Dtest_suite_lmots.function6 int check_lmots_private_key_for_leak(unsigned char *sig)
13 TEST_EQUAL(sig[idx], 0x7E);
36 unsigned char sig[MBEDTLS_LMOTS_SIG_LEN(MBEDTLS_LMOTS_SHA256_N32_W8)];
45 msg->x, msg->len, sig, sizeof(sig), NULL), 0);
46 TEST_EQUAL(mbedtls_lmots_verify(&pub_ctx, msg->x, msg->len, sig, sizeof(sig)), 0);
59 unsigned char sig[MBEDTLS_LMOTS_SIG_LEN(MBEDTLS_LMOTS_SHA256_N32_W8)];
68 NULL, 0, sig, sizeof(sig), NULL), 0);
69 TEST_EQUAL(mbedtls_lmots_verify(&pub_ctx, NULL, 0, sig, sizeof(sig)), 0);
78 void lmots_verify_test(data_t *msg, data_t *sig, data_t *pub_key,
89 TEST_EQUAL(mbedtls_lmots_verify(&ctx, msg->x, msg->len, sig->x, sig->len), expected_rc);
[all …]
Dtest_suite_lms.function16 unsigned char sig[MBEDTLS_LMS_SIG_LEN(MBEDTLS_LMS_SHA256_M32_H10, MBEDTLS_LMOTS_SHA256_N32_W8)];
32 msg->x, msg->len, sig, sizeof(sig),
35 TEST_EQUAL(mbedtls_lms_verify(&pub_ctx, msg->x, msg->len, sig,
36 sizeof(sig)), 0);
49 unsigned char sig[MBEDTLS_LMS_SIG_LEN(MBEDTLS_LMS_SHA256_M32_H10, MBEDTLS_LMOTS_SHA256_N32_W8)];
65 NULL, 0, sig, sizeof(sig),
68 TEST_EQUAL(mbedtls_lms_verify(&pub_ctx, NULL, 0, sig,
69 sizeof(sig)), 0);
78 void lms_verify_test(data_t *msg, data_t *sig, data_t *pub_key,
89 TEST_EQUAL(mbedtls_lms_verify(&ctx, msg->x, msg->len, sig->x, sig->len), expected_rc);
[all …]
Dtest_suite_ecdsa.function238 unsigned char sig[200];
244 memset(sig, 0x2a, sizeof(sig));
254 sig, sizeof(sig), &sig_len,
258 sig, sig_len) == 0);
261 for (i = sig_len; i < sizeof(sig); i++) {
262 TEST_ASSERT(sig[i] == 0x2a);
267 sig, sig_len - 1) != 0);
269 sig, sig_len + 1) != 0);
272 sig[0]++;
274 sig, sig_len) != 0);
[all …]
Dtest_suite_pk.function78 const unsigned char *hash, unsigned char *sig)
84 md_alg, hashlen, hash, sig);
629 data_t *sig, int ret)
648 hash->x, hash->len, sig->x, sig->len) == ret);
665 unsigned char sig[MBEDTLS_ECDSA_MAX_LEN];
673 memset(sig, 0, sizeof(sig));
685 slen = sizeof(sig);
689 sig, sizeof(sig), &slen,
696 TEST_ASSERT(memcmp(sig, sig_check->x, slen) == 0);
704 hash->x, hash->len, sig, slen, &rs_ctx);
[all …]
Dtest_suite_lms.data18 # word at the start of the key/sig. We strip these 4 bytes from the signature
58 # "levels" word at the start of the key/sig. We strip these 4 bytes from the
67 # * rm message.bin.sig
69 # * rm message.bin.sig
71 # * cat message.bin.sig | xxd
76 # * echo -n -e "\0\0\0\0" > message.bin.sig; cat sig.bin >> message.bin.sig (restore the
90 # 4-byte "levels" word at the start of the key/sig. We strip these 4 bytes from
100 # * cat message.bin.sig | xxd
104 # * echo -n -e "\0\0\0\0" > message.bin.sig; cat sig.bin >> message.bin.sig (restore the
118 # 4-byte "levels" word at the start of the key/sig. We strip these 4 bytes from
[all …]
Dtest_suite_lmots.data37 # sig = ots_private_key.sign(message)
38 # print('lmots_verify_test:"{}":"{}":"{}":0'.format(message.hex(), sig.hex(), ots_public_key.pubkey…
62 #sig = ots_private_key.sign(message)
63 #print('lmots_verify_test:"{}":"{}":"{}":0'.format(message.hex(), sig.hex(), ots_public_key.pubkey.…
85 #sig = ots_private_key.sign(message)
86 #print('lmots_verify_test:"{}":"{}":"{}":0'.format(message.hex(), sig.hex(), ots_public_key.pubkey.…
Dtest_suite_ecdsa.data389 ECDSA verify valid pub key, invalid sig (r=0), 0 bytes of data
393 ECDSA verify valid pub key, invalid sig (r=0), 1 byte of data
397 ECDSA verify valid pub key, invalid sig (r>n-1), 32 bytes of data
401 ECDSA verify valid pub key, valid/incorrect sig, 0 bytes of data
405 ECDSA verify valid pub key, valid/incorrect sig, 1 byte of data
409 ECDSA verify valid pub key, valid/incorrect sig, 32 bytes of data
413 ECDSA verify valid public key, correct sig, 0 bytes of data
417 ECDSA verify valid pub key, correct sig, 1 byte of data
421 ECDSA verify valid pub key, correct sig, 32 bytes of data
/mbedtls-3.5.0/library/
Dpk_wrap.c203 const unsigned char *sig, size_t sig_len) in rsa_verify_wrap() argument
247 sig, sig_len); in rsa_verify_wrap()
265 const unsigned char *sig, size_t sig_len) in rsa_verify_wrap() argument
281 hash, sig)) != 0) { in rsa_verify_wrap()
302 unsigned char *sig, size_t sig_size, in mbedtls_pk_psa_rsa_sign_ext() argument
339 sig, sig_size, sig_len); in mbedtls_pk_psa_rsa_sign_ext()
359 unsigned char *sig, size_t sig_size, size_t *sig_len, in rsa_sign_wrap() argument
374 sig, sig_size, sig_len); in rsa_sign_wrap()
379 unsigned char *sig, size_t sig_size, size_t *sig_len, in rsa_sign_wrap() argument
395 hash, sig); in rsa_sign_wrap()
[all …]
Decdsa.c269 ECDSA_RS_ENTER(sig); in mbedtls_ecdsa_sign_restartable()
272 if (rs_ctx != NULL && rs_ctx->sig != NULL) { in mbedtls_ecdsa_sign_restartable()
274 p_sign_tries = &rs_ctx->sig->sign_tries; in mbedtls_ecdsa_sign_restartable()
275 p_key_tries = &rs_ctx->sig->key_tries; in mbedtls_ecdsa_sign_restartable()
276 pk = &rs_ctx->sig->k; in mbedtls_ecdsa_sign_restartable()
277 pr = &rs_ctx->sig->r; in mbedtls_ecdsa_sign_restartable()
280 if (rs_ctx->sig->state == ecdsa_sig_mul) { in mbedtls_ecdsa_sign_restartable()
283 if (rs_ctx->sig->state == ecdsa_sig_modn) { in mbedtls_ecdsa_sign_restartable()
310 if (rs_ctx != NULL && rs_ctx->sig != NULL) { in mbedtls_ecdsa_sign_restartable()
311 rs_ctx->sig->state = ecdsa_sig_mul; in mbedtls_ecdsa_sign_restartable()
[all …]
Dpk.c423 const unsigned char *sig, size_t sig_len, in mbedtls_pk_verify_restartable() argument
447 md_alg, hash, hash_len, sig, sig_len, rs_ctx->rs_ctx); in mbedtls_pk_verify_restartable()
464 sig, sig_len); in mbedtls_pk_verify_restartable()
472 const unsigned char *sig, size_t sig_len) in mbedtls_pk_verify() argument
475 sig, sig_len, NULL); in mbedtls_pk_verify()
484 const unsigned char *sig, size_t sig_len) in mbedtls_pk_verify_ext() argument
504 return mbedtls_pk_verify(ctx, md_alg, hash, hash_len, sig, sig_len); in mbedtls_pk_verify_ext()
561 hash_len, sig, signature_length); in mbedtls_pk_verify_ext()
584 sig); in mbedtls_pk_verify_ext()
606 unsigned char *sig, size_t sig_size, size_t *sig_len, in mbedtls_pk_sign_restartable() argument
[all …]
Dpk_wrap.h50 const unsigned char *sig, size_t sig_len);
55 unsigned char *sig, size_t sig_size, size_t *sig_len,
63 const unsigned char *sig, size_t sig_len,
69 unsigned char *sig, size_t sig_size, size_t *sig_len,
162 unsigned char *sig, size_t sig_size,
Dlms.c309 const unsigned char *sig, size_t sig_size) in mbedtls_lms_verify() argument
345 sig + SIG_OTS_SIG_OFFSET + in mbedtls_lms_verify()
356 sig + SIG_TYPE_OFFSET(ctx->params.otstype)) in mbedtls_lms_verify()
363 MBEDTLS_LMOTS_Q_LEAF_ID_LEN, sig + SIG_Q_LEAF_ID_OFFSET); in mbedtls_lms_verify()
380 sig + SIG_OTS_SIG_OFFSET, in mbedtls_lms_verify()
404 left_node = sig + SIG_PATH_OFFSET(ctx->params.otstype) + in mbedtls_lms_verify()
409 right_node = sig + SIG_PATH_OFFSET(ctx->params.otstype) + in mbedtls_lms_verify()
708 unsigned int msg_size, unsigned char *sig, size_t sig_size, in mbedtls_lms_sign() argument
752 sig + SIG_OTS_SIG_OFFSET, in mbedtls_lms_sign()
762 sig + SIG_TYPE_OFFSET(ctx->params.otstype)); in mbedtls_lms_sign()
[all …]
Dlmots.c496 const unsigned char *sig, in mbedtls_lmots_calculate_public_key_candidate() argument
516 sig + MBEDTLS_LMOTS_SIG_C_RANDOM_OFFSET, in mbedtls_lmots_calculate_public_key_candidate()
523 sig + MBEDTLS_LMOTS_SIG_SIGNATURE_OFFSET(params->type), in mbedtls_lmots_calculate_public_key_candidate()
545 const unsigned char *sig, size_t sig_size) in mbedtls_lmots_verify() argument
567 sig + MBEDTLS_LMOTS_SIG_TYPE_OFFSET) != in mbedtls_lmots_verify()
573 msg, msg_size, sig, sig_size, in mbedtls_lmots_verify()
734 unsigned char *sig, size_t sig_size, size_t *sig_len) in mbedtls_lmots_sign() argument
783 sig + MBEDTLS_LMOTS_SIG_TYPE_OFFSET); in mbedtls_lmots_sign()
790 ret = (*mbedtls_lmots_sign_private_key_invalidated_hook)(sig); in mbedtls_lmots_sign()
804 memcpy(sig + MBEDTLS_LMOTS_SIG_C_RANDOM_OFFSET, tmp_c_random, in mbedtls_lmots_sign()
[all …]
Drsa.c1658 unsigned char *sig) in rsa_rsassa_pss_sign() argument
1661 unsigned char *p = sig; in rsa_rsassa_pss_sign()
1720 memset(sig, 0, olen); in rsa_rsassa_pss_sign()
1747 ret = mgf_mask(sig + offset, olen - hlen - 1 - offset, p, hlen, in rsa_rsassa_pss_sign()
1754 sig[0] &= 0xFF >> (olen * 8 - msb); in rsa_rsassa_pss_sign()
1759 return mbedtls_rsa_private(ctx, f_rng, p_rng, sig, sig); in rsa_rsassa_pss_sign()
1773 unsigned char *sig) in mbedtls_rsa_rsassa_pss_sign_ext() argument
1776 hashlen, hash, saltlen, sig); in mbedtls_rsa_rsassa_pss_sign_ext()
1789 unsigned char *sig) in mbedtls_rsa_rsassa_pss_sign() argument
1792 hashlen, hash, MBEDTLS_RSA_SALT_LEN_ANY, sig); in mbedtls_rsa_rsassa_pss_sign()
[all …]
Dx509write_csr.c238 unsigned char *sig, size_t sig_size, in x509write_csr_der_internal() argument
334 sig, sig_size, &sig_len, in x509write_csr_der_internal()
366 sig, sig_len)); in x509write_csr_der_internal()
395 unsigned char *sig; in mbedtls_x509write_csr_der() local
397 if ((sig = mbedtls_calloc(1, MBEDTLS_PK_SIGNATURE_MAX_SIZE)) == NULL) { in mbedtls_x509write_csr_der()
402 sig, MBEDTLS_PK_SIGNATURE_MAX_SIZE, in mbedtls_x509write_csr_der()
405 mbedtls_free(sig); in mbedtls_x509write_csr_der()
Dlmots.h182 const unsigned char *sig,
215 size_t msg_size, const unsigned char *sig,
315 unsigned char *sig, size_t sig_size, size_t *sig_len);
Dx509write_crt.c428 unsigned char sig[MBEDTLS_PK_SIGNATURE_MAX_SIZE]; in mbedtls_x509write_crt_der() local
609 hash, hash_length, sig, sizeof(sig), &sig_len, in mbedtls_x509write_crt_der()
624 sig_oid, sig_oid_len, sig, in mbedtls_x509write_crt_der()
Dx509_create.c285 unsigned char *sig, size_t size) in mbedtls_x509_write_sig() argument
296 memcpy(*p, sig, len); in mbedtls_x509_write_sig()
/mbedtls-3.5.0/programs/pkey/
Decdsa.c98 unsigned char sig[MBEDTLS_ECDSA_MAX_LEN]; in main() local
107 memset(sig, 0, sizeof(sig)); in main()
170 sig, sizeof(sig), &sig_len, in main()
177 dump_buf(" + Signature: ", sig, sig_len); in main()
210 sig, sig_len)) != 0) { in main()
/mbedtls-3.5.0/include/mbedtls/
Drsa.h844 unsigned char *sig);
876 unsigned char *sig);
928 unsigned char *sig);
977 unsigned char *sig);
1009 const unsigned char *sig);
1034 const unsigned char *sig);
1069 const unsigned char *sig);
1111 const unsigned char *sig);
Decdsa.h114 mbedtls_ecdsa_restart_sig_ctx *MBEDTLS_PRIVATE(sig); /*!< ecdsa_sign() sub-context */
485 unsigned char *sig, size_t sig_size, size_t *slen,
532 unsigned char *sig, size_t sig_size, size_t *slen,
566 const unsigned char *sig, size_t slen);
601 const unsigned char *sig, size_t slen,
Dpk.h262 const unsigned char *hash, unsigned char *sig);
482 const unsigned char *sig, size_t sig_len);
507 const unsigned char *sig, size_t sig_len,
544 const unsigned char *sig, size_t sig_len);
576 unsigned char *sig, size_t sig_size, size_t *sig_len,
613 unsigned char *sig, size_t sig_size, size_t *sig_len,
650 unsigned char *sig, size_t sig_size, size_t *sig_len,
Dlms.h334 const unsigned char *sig, size_t sig_size);
444 unsigned int msg_size, unsigned char *sig, size_t sig_size,
Dx509.h427 int mbedtls_x509_get_sig(unsigned char **p, const unsigned char *end, mbedtls_x509_buf *sig);
453 unsigned char *sig, size_t size);
Dx509_crl.h95 mbedtls_x509_buf MBEDTLS_PRIVATE(sig);

12