Home
last modified time | relevance | path

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

12

/mbedtls-3.4.0/tests/suites/
Dtest_suite_lmots.function6 int check_lmots_private_key_for_leak(unsigned char * sig)
14 TEST_EQUAL( sig[idx], 0x7E );
37 unsigned char sig[MBEDTLS_LMOTS_SIG_LEN(MBEDTLS_LMOTS_SHA256_N32_W8)];
46 msg->x, msg->len, sig, sizeof(sig), NULL ), 0 );
47 TEST_EQUAL( mbedtls_lmots_verify(&pub_ctx, msg->x, msg->len, sig, sizeof(sig)), 0 );
60 unsigned char sig[MBEDTLS_LMOTS_SIG_LEN(MBEDTLS_LMOTS_SHA256_N32_W8)];
69 NULL, 0, sig, sizeof(sig), NULL ), 0 );
70 TEST_EQUAL( mbedtls_lmots_verify(&pub_ctx, NULL, 0, sig, sizeof(sig)), 0 );
79 void lmots_verify_test ( data_t *msg, data_t *sig, data_t *pub_key,
90 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.function239 unsigned char sig[200];
245 memset( sig, 0x2a, sizeof( sig ) );
255 sig, sizeof( sig ), &sig_len, &mbedtls_test_rnd_pseudo_rand,
258 sig, sig_len ) == 0 );
261 for( i = sig_len; i < sizeof( sig ); i++ )
262 TEST_ASSERT( sig[i] == 0x2a );
266 sig, sig_len - 1 ) != 0 );
268 sig, sig_len + 1 ) != 0 );
271 sig[0]++;
273 sig, sig_len ) != 0 );
[all …]
Dtest_suite_pk.function77 const unsigned char *hash, unsigned char *sig )
83 md_alg, hashlen, hash, sig ) );
639 data_t * sig, int ret )
658 hash->x, hash->len, sig->x, sig->len ) == ret );
675 unsigned char sig[MBEDTLS_ECDSA_MAX_LEN];
683 memset( sig, 0, sizeof( sig ) );
695 slen = sizeof( sig );
699 sig, sizeof( sig ), &slen,
706 TEST_ASSERT( memcmp( sig, sig_check->x, slen ) == 0 );
714 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.4.0/library/
Dpk_wrap.c166 const unsigned char *sig, size_t sig_len ) in rsa_verify_wrap() argument
210 sig, sig_len ); in rsa_verify_wrap()
228 const unsigned char *sig, size_t sig_len ) in rsa_verify_wrap() argument
244 hash, sig ) ) != 0 ) in rsa_verify_wrap()
263 unsigned char *sig, size_t sig_size, in mbedtls_pk_psa_rsa_sign_ext() argument
299 sig, sig_size, sig_len ); in mbedtls_pk_psa_rsa_sign_ext()
319 unsigned char *sig, size_t sig_size, size_t *sig_len, in rsa_sign_wrap() argument
333 sig, sig_size, sig_len ) ); in rsa_sign_wrap()
338 unsigned char *sig, size_t sig_size, size_t *sig_len, in rsa_sign_wrap() argument
354 hash, sig ) ); in rsa_sign_wrap()
[all …]
Decdsa.c265 ECDSA_RS_ENTER( sig ); in ecdsa_sign_restartable()
268 if( rs_ctx != NULL && rs_ctx->sig != NULL ) in ecdsa_sign_restartable()
271 p_sign_tries = &rs_ctx->sig->sign_tries; in ecdsa_sign_restartable()
272 p_key_tries = &rs_ctx->sig->key_tries; in ecdsa_sign_restartable()
273 pk = &rs_ctx->sig->k; in ecdsa_sign_restartable()
274 pr = &rs_ctx->sig->r; in ecdsa_sign_restartable()
277 if( rs_ctx->sig->state == ecdsa_sig_mul ) in ecdsa_sign_restartable()
279 if( rs_ctx->sig->state == ecdsa_sig_modn ) in ecdsa_sign_restartable()
309 if( rs_ctx != NULL && rs_ctx->sig != NULL ) in ecdsa_sign_restartable()
310 rs_ctx->sig->state = ecdsa_sig_mul; in ecdsa_sign_restartable()
[all …]
Dpk.c393 const unsigned char *sig, size_t sig_len, in mbedtls_pk_verify_restartable() argument
415 md_alg, hash, hash_len, sig, sig_len, rs_ctx->rs_ctx ); in mbedtls_pk_verify_restartable()
430 sig, sig_len ) ); in mbedtls_pk_verify_restartable()
438 const unsigned char *sig, size_t sig_len ) in mbedtls_pk_verify() argument
441 sig, sig_len, NULL ) ); in mbedtls_pk_verify()
450 const unsigned char *sig, size_t sig_len ) in mbedtls_pk_verify_ext() argument
467 return( mbedtls_pk_verify( ctx, md_alg, hash, hash_len, sig, sig_len ) ); in mbedtls_pk_verify_ext()
531 hash_len, sig, signature_length ); in mbedtls_pk_verify_ext()
552 sig ); in mbedtls_pk_verify_ext()
572 unsigned char *sig, size_t sig_size, size_t *sig_len, in mbedtls_pk_sign_restartable() argument
[all …]
Dpk_wrap.h51 const unsigned char *sig, size_t sig_len );
56 unsigned char *sig, size_t sig_size, size_t *sig_len,
64 const unsigned char *sig, size_t sig_len,
70 unsigned char *sig, size_t sig_size, size_t *sig_len,
160 unsigned char *sig, size_t sig_size,
Dx509write_csr.c134 unsigned char *sig, size_t sig_size, in x509write_csr_der_internal() argument
231 sig, sig_size, &sig_len, in x509write_csr_der_internal()
264 sig, sig_len ) ); in x509write_csr_der_internal()
293 unsigned char *sig; in mbedtls_x509write_csr_der() local
295 if( ( sig = mbedtls_calloc( 1, MBEDTLS_PK_SIGNATURE_MAX_SIZE ) ) == NULL ) in mbedtls_x509write_csr_der()
301 sig, MBEDTLS_PK_SIGNATURE_MAX_SIZE, in mbedtls_x509write_csr_der()
304 mbedtls_free( sig ); in mbedtls_x509write_csr_der()
Dlms.c299 const unsigned char *sig, size_t sig_size ) in mbedtls_lms_verify() argument
340 sig + SIG_OTS_SIG_OFFSET + MBEDTLS_LMOTS_SIG_TYPE_OFFSET ) in mbedtls_lms_verify()
352 sig + SIG_TYPE_OFFSET(ctx->params.otstype)) in mbedtls_lms_verify()
360 MBEDTLS_LMOTS_Q_LEAF_ID_LEN, sig + SIG_Q_LEAF_ID_OFFSET ); in mbedtls_lms_verify()
376 msg_size, sig + SIG_OTS_SIG_OFFSET, in mbedtls_lms_verify()
401 left_node = sig + SIG_PATH_OFFSET(ctx->params.otstype) + in mbedtls_lms_verify()
408 right_node = sig + SIG_PATH_OFFSET(ctx->params.otstype) + in mbedtls_lms_verify()
709 unsigned int msg_size, unsigned char *sig, size_t sig_size, in mbedtls_lms_sign() argument
756 sig + SIG_OTS_SIG_OFFSET, in mbedtls_lms_sign()
766 sig + SIG_TYPE_OFFSET(ctx->params.otstype) ); in mbedtls_lms_sign()
[all …]
Dlmots.c480 const unsigned char *sig, in mbedtls_lmots_calculate_public_key_candidate() argument
502 sig + MBEDTLS_LMOTS_SIG_C_RANDOM_OFFSET, in mbedtls_lmots_calculate_public_key_candidate()
510 sig + MBEDTLS_LMOTS_SIG_SIGNATURE_OFFSET(params->type), in mbedtls_lmots_calculate_public_key_candidate()
535 const unsigned char *sig, size_t sig_size ) in mbedtls_lmots_verify() argument
561 sig + MBEDTLS_LMOTS_SIG_TYPE_OFFSET ) != MBEDTLS_LMOTS_SHA256_N32_W8 ) in mbedtls_lmots_verify()
567 msg, msg_size, sig, sig_size, in mbedtls_lmots_verify()
728 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()
791 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.c1603 unsigned char *sig ) in rsa_rsassa_pss_sign() argument
1606 unsigned char *p = sig; in rsa_rsassa_pss_sign()
1664 memset( sig, 0, olen ); in rsa_rsassa_pss_sign()
1688 ret = mgf_mask( sig + offset, olen - hlen - 1 - offset, p, hlen, in rsa_rsassa_pss_sign()
1694 sig[0] &= 0xFF >> ( olen * 8 - msb ); in rsa_rsassa_pss_sign()
1699 return mbedtls_rsa_private( ctx, f_rng, p_rng, sig, sig ); in rsa_rsassa_pss_sign()
1713 unsigned char *sig ) in mbedtls_rsa_rsassa_pss_sign_ext() argument
1716 hashlen, hash, saltlen, sig ); in mbedtls_rsa_rsassa_pss_sign_ext()
1729 unsigned char *sig ) in mbedtls_rsa_rsassa_pss_sign() argument
1732 hashlen, hash, MBEDTLS_RSA_SALT_LEN_ANY, sig ); in mbedtls_rsa_rsassa_pss_sign()
[all …]
Dlmots.h181 const unsigned char *sig,
214 size_t msg_size, const unsigned char *sig,
314 unsigned char *sig, size_t sig_size, size_t* sig_len );
Dx509write_crt.c398 unsigned char sig[MBEDTLS_PK_SIGNATURE_MAX_SIZE]; in mbedtls_x509write_crt_der() local
563 hash, hash_length, sig, sizeof( sig ), &sig_len, in mbedtls_x509write_crt_der()
579 sig_oid, sig_oid_len, sig, sig_len ) ); in mbedtls_x509write_crt_der()
Dx509.c686 int mbedtls_x509_get_sig( unsigned char **p, const unsigned char *end, mbedtls_x509_buf *sig ) in mbedtls_x509_get_sig() argument
701 sig->tag = tag_type; in mbedtls_x509_get_sig()
702 sig->len = len; in mbedtls_x509_get_sig()
703 sig->p = *p; in mbedtls_x509_get_sig()
/mbedtls-3.4.0/programs/pkey/
Decdsa.c98 unsigned char sig[MBEDTLS_ECDSA_MAX_LEN]; in main() local
107 memset( sig, 0, sizeof( sig ) ); in main()
174 sig, sizeof( sig ), &sig_len, in main()
182 dump_buf( " + Signature: ", sig, sig_len ); in main()
214 sig, sig_len ) ) != 0 ) in main()
/mbedtls-3.4.0/include/mbedtls/
Drsa.h823 unsigned char *sig );
855 unsigned char *sig );
907 unsigned char *sig );
956 unsigned char *sig );
988 const unsigned char *sig );
1013 const unsigned char *sig );
1048 const unsigned char *sig );
1090 const unsigned char *sig );
Decdsa.h110 mbedtls_ecdsa_restart_sig_ctx *MBEDTLS_PRIVATE(sig); /*!< ecdsa_sign() sub-context */
308 unsigned char *sig, size_t sig_size, size_t *slen,
355 unsigned char *sig, size_t sig_size, size_t *slen,
389 const unsigned char *sig, size_t slen );
424 const unsigned char *sig, size_t slen,
Dpk.h224 const unsigned char *hash, unsigned char *sig );
444 const unsigned char *sig, size_t sig_len );
469 const unsigned char *sig, size_t sig_len,
504 const unsigned char *sig, size_t sig_len );
536 unsigned char *sig, size_t sig_size, size_t *sig_len,
573 unsigned char *sig, size_t sig_size, size_t *sig_len,
610 unsigned char *sig, size_t sig_size, size_t *sig_len,
Dlms.h333 const unsigned char *sig, size_t sig_size );
443 unsigned int msg_size, unsigned char *sig, size_t sig_size,
Dx509.h346 int mbedtls_x509_get_sig( unsigned char **p, const unsigned char *end, mbedtls_x509_buf *sig );
372 unsigned char *sig, size_t size );
Dx509_crl.h97 mbedtls_x509_buf MBEDTLS_PRIVATE(sig);

12