Home
last modified time | relevance | path

Searched refs:ctx (Results 1 – 25 of 152) sorted by relevance

1234567

/net-tools-3.7.0/mbedtls-2.4.0/library/
Dmd_wrap.c74 static void md2_starts_wrap( void *ctx ) in md2_starts_wrap() argument
76 mbedtls_md2_starts( (mbedtls_md2_context *) ctx ); in md2_starts_wrap()
79 static void md2_update_wrap( void *ctx, const unsigned char *input, in md2_update_wrap() argument
82 mbedtls_md2_update( (mbedtls_md2_context *) ctx, input, ilen ); in md2_update_wrap()
85 static void md2_finish_wrap( void *ctx, unsigned char *output ) in md2_finish_wrap() argument
87 mbedtls_md2_finish( (mbedtls_md2_context *) ctx, output ); in md2_finish_wrap()
92 void *ctx = mbedtls_calloc( 1, sizeof( mbedtls_md2_context ) ); in md2_ctx_alloc() local
94 if( ctx != NULL ) in md2_ctx_alloc()
95 mbedtls_md2_init( (mbedtls_md2_context *) ctx ); in md2_ctx_alloc()
97 return( ctx ); in md2_ctx_alloc()
[all …]
Dmd.c181 void mbedtls_md_init( mbedtls_md_context_t *ctx ) in mbedtls_md_init() argument
183 memset( ctx, 0, sizeof( mbedtls_md_context_t ) ); in mbedtls_md_init()
186 void mbedtls_md_free( mbedtls_md_context_t *ctx ) in mbedtls_md_free() argument
188 if( ctx == NULL || ctx->md_info == NULL ) in mbedtls_md_free()
191 if( ctx->md_ctx != NULL ) in mbedtls_md_free()
192 ctx->md_info->ctx_free_func( ctx->md_ctx ); in mbedtls_md_free()
194 if( ctx->hmac_ctx != NULL ) in mbedtls_md_free()
196 mbedtls_zeroize( ctx->hmac_ctx, 2 * ctx->md_info->block_size ); in mbedtls_md_free()
197 mbedtls_free( ctx->hmac_ctx ); in mbedtls_md_free()
200 mbedtls_zeroize( ctx, sizeof( mbedtls_md_context_t ) ); in mbedtls_md_free()
[all …]
Dhmac_drbg.c61 void mbedtls_hmac_drbg_init( mbedtls_hmac_drbg_context *ctx ) in mbedtls_hmac_drbg_init() argument
63 memset( ctx, 0, sizeof( mbedtls_hmac_drbg_context ) ); in mbedtls_hmac_drbg_init()
66 mbedtls_mutex_init( &ctx->mutex ); in mbedtls_hmac_drbg_init()
73 void mbedtls_hmac_drbg_update( mbedtls_hmac_drbg_context *ctx, in mbedtls_hmac_drbg_update() argument
76 size_t md_len = mbedtls_md_get_size( ctx->md_ctx.md_info ); in mbedtls_hmac_drbg_update()
84 mbedtls_md_hmac_reset( &ctx->md_ctx ); in mbedtls_hmac_drbg_update()
85 mbedtls_md_hmac_update( &ctx->md_ctx, ctx->V, md_len ); in mbedtls_hmac_drbg_update()
86 mbedtls_md_hmac_update( &ctx->md_ctx, sep, 1 ); in mbedtls_hmac_drbg_update()
88 mbedtls_md_hmac_update( &ctx->md_ctx, additional, add_len ); in mbedtls_hmac_drbg_update()
89 mbedtls_md_hmac_finish( &ctx->md_ctx, K ); in mbedtls_hmac_drbg_update()
[all …]
Dcipher.c131 void mbedtls_cipher_init( mbedtls_cipher_context_t *ctx ) in mbedtls_cipher_init() argument
133 memset( ctx, 0, sizeof( mbedtls_cipher_context_t ) ); in mbedtls_cipher_init()
136 void mbedtls_cipher_free( mbedtls_cipher_context_t *ctx ) in mbedtls_cipher_free() argument
138 if( ctx == NULL ) in mbedtls_cipher_free()
142 if( ctx->cmac_ctx ) in mbedtls_cipher_free()
144 mbedtls_zeroize( ctx->cmac_ctx, sizeof( mbedtls_cmac_context_t ) ); in mbedtls_cipher_free()
145 mbedtls_free( ctx->cmac_ctx ); in mbedtls_cipher_free()
149 if( ctx->cipher_ctx ) in mbedtls_cipher_free()
150 ctx->cipher_info->base->ctx_free_func( ctx->cipher_ctx ); in mbedtls_cipher_free()
152 mbedtls_zeroize( ctx, sizeof(mbedtls_cipher_context_t) ); in mbedtls_cipher_free()
[all …]
Ddhm.c121 void mbedtls_dhm_init( mbedtls_dhm_context *ctx ) in mbedtls_dhm_init() argument
123 memset( ctx, 0, sizeof( mbedtls_dhm_context ) ); in mbedtls_dhm_init()
129 int mbedtls_dhm_read_params( mbedtls_dhm_context *ctx, in mbedtls_dhm_read_params() argument
135 if( ( ret = dhm_read_bignum( &ctx->P, p, end ) ) != 0 || in mbedtls_dhm_read_params()
136 ( ret = dhm_read_bignum( &ctx->G, p, end ) ) != 0 || in mbedtls_dhm_read_params()
137 ( ret = dhm_read_bignum( &ctx->GY, p, end ) ) != 0 ) in mbedtls_dhm_read_params()
140 if( ( ret = dhm_check_range( &ctx->GY, &ctx->P ) ) != 0 ) in mbedtls_dhm_read_params()
143 ctx->len = mbedtls_mpi_size( &ctx->P ); in mbedtls_dhm_read_params()
151 int mbedtls_dhm_make_params( mbedtls_dhm_context *ctx, int x_size, in mbedtls_dhm_make_params() argument
160 if( mbedtls_mpi_cmp_int( &ctx->P, 0 ) == 0 ) in mbedtls_dhm_make_params()
[all …]
Dmd2.c86 void mbedtls_md2_init( mbedtls_md2_context *ctx ) in mbedtls_md2_init() argument
88 memset( ctx, 0, sizeof( mbedtls_md2_context ) ); in mbedtls_md2_init()
91 void mbedtls_md2_free( mbedtls_md2_context *ctx ) in mbedtls_md2_free() argument
93 if( ctx == NULL ) in mbedtls_md2_free()
96 mbedtls_zeroize( ctx, sizeof( mbedtls_md2_context ) ); in mbedtls_md2_free()
108 void mbedtls_md2_starts( mbedtls_md2_context *ctx ) in mbedtls_md2_starts() argument
110 memset( ctx->cksum, 0, 16 ); in mbedtls_md2_starts()
111 memset( ctx->state, 0, 46 ); in mbedtls_md2_starts()
112 memset( ctx->buffer, 0, 16 ); in mbedtls_md2_starts()
113 ctx->left = 0; in mbedtls_md2_starts()
[all …]
Dpk.c50 void mbedtls_pk_init( mbedtls_pk_context *ctx ) in mbedtls_pk_init() argument
52 if( ctx == NULL ) in mbedtls_pk_init()
55 ctx->pk_info = NULL; in mbedtls_pk_init()
56 ctx->pk_ctx = NULL; in mbedtls_pk_init()
62 void mbedtls_pk_free( mbedtls_pk_context *ctx ) in mbedtls_pk_free() argument
64 if( ctx == NULL || ctx->pk_info == NULL ) in mbedtls_pk_free()
67 ctx->pk_info->ctx_free_func( ctx->pk_ctx ); in mbedtls_pk_free()
69 mbedtls_zeroize( ctx, sizeof( mbedtls_pk_context ) ); in mbedtls_pk_free()
101 int mbedtls_pk_setup( mbedtls_pk_context *ctx, const mbedtls_pk_info_t *info ) in mbedtls_pk_setup() argument
103 if( ctx == NULL || info == NULL || ctx->pk_info != NULL ) in mbedtls_pk_setup()
[all …]
Decdh.c88 void mbedtls_ecdh_init( mbedtls_ecdh_context *ctx ) in mbedtls_ecdh_init() argument
90 memset( ctx, 0, sizeof( mbedtls_ecdh_context ) ); in mbedtls_ecdh_init()
96 void mbedtls_ecdh_free( mbedtls_ecdh_context *ctx ) in mbedtls_ecdh_free() argument
98 if( ctx == NULL ) in mbedtls_ecdh_free()
101 mbedtls_ecp_group_free( &ctx->grp ); in mbedtls_ecdh_free()
102 mbedtls_ecp_point_free( &ctx->Q ); in mbedtls_ecdh_free()
103 mbedtls_ecp_point_free( &ctx->Qp ); in mbedtls_ecdh_free()
104 mbedtls_ecp_point_free( &ctx->Vi ); in mbedtls_ecdh_free()
105 mbedtls_ecp_point_free( &ctx->Vf ); in mbedtls_ecdh_free()
106 mbedtls_mpi_free( &ctx->d ); in mbedtls_ecdh_free()
[all …]
Dentropy.c69 void mbedtls_entropy_init( mbedtls_entropy_context *ctx ) in mbedtls_entropy_init() argument
71 memset( ctx, 0, sizeof(mbedtls_entropy_context) ); in mbedtls_entropy_init()
74 mbedtls_mutex_init( &ctx->mutex ); in mbedtls_entropy_init()
78 mbedtls_sha512_starts( &ctx->accumulator, 0 ); in mbedtls_entropy_init()
80 mbedtls_sha256_starts( &ctx->accumulator, 0 ); in mbedtls_entropy_init()
83 mbedtls_havege_init( &ctx->havege_data ); in mbedtls_entropy_init()
87 mbedtls_entropy_add_source( ctx, mbedtls_null_entropy_poll, NULL, in mbedtls_entropy_init()
93 mbedtls_entropy_add_source( ctx, mbedtls_platform_entropy_poll, NULL, in mbedtls_entropy_init()
98 mbedtls_entropy_add_source( ctx, mbedtls_hardclock_poll, NULL, in mbedtls_entropy_init()
103 mbedtls_entropy_add_source( ctx, mbedtls_havege_poll, &ctx->havege_data, in mbedtls_entropy_init()
[all …]
Dssl_ticket.c50 void mbedtls_ssl_ticket_init( mbedtls_ssl_ticket_context *ctx ) in mbedtls_ssl_ticket_init() argument
52 memset( ctx, 0, sizeof( mbedtls_ssl_ticket_context ) ); in mbedtls_ssl_ticket_init()
55 mbedtls_mutex_init( &ctx->mutex ); in mbedtls_ssl_ticket_init()
64 static int ssl_ticket_gen_key( mbedtls_ssl_ticket_context *ctx, in ssl_ticket_gen_key() argument
69 mbedtls_ssl_ticket_key *key = ctx->keys + index; in ssl_ticket_gen_key()
75 if( ( ret = ctx->f_rng( ctx->p_rng, key->name, sizeof( key->name ) ) ) != 0 ) in ssl_ticket_gen_key()
78 if( ( ret = ctx->f_rng( ctx->p_rng, buf, sizeof( buf ) ) ) != 0 ) in ssl_ticket_gen_key()
82 ret = mbedtls_cipher_setkey( &key->ctx, buf, in ssl_ticket_gen_key()
83 mbedtls_cipher_get_key_bitlen( &key->ctx ), in ssl_ticket_gen_key()
94 static int ssl_ticket_update_keys( mbedtls_ssl_ticket_context *ctx ) in ssl_ticket_update_keys() argument
[all …]
Dgcm.c88 void mbedtls_gcm_init( mbedtls_gcm_context *ctx ) in mbedtls_gcm_init() argument
90 memset( ctx, 0, sizeof( mbedtls_gcm_context ) ); in mbedtls_gcm_init()
101 static int gcm_gen_table( mbedtls_gcm_context *ctx ) in gcm_gen_table() argument
110 if( ( ret = mbedtls_cipher_update( &ctx->cipher_ctx, h, 16, h, &olen ) ) != 0 ) in gcm_gen_table()
123 ctx->HL[8] = vl; in gcm_gen_table()
124 ctx->HH[8] = vh; in gcm_gen_table()
133 ctx->HH[0] = 0; in gcm_gen_table()
134 ctx->HL[0] = 0; in gcm_gen_table()
142 ctx->HL[i] = vl; in gcm_gen_table()
143 ctx->HH[i] = vh; in gcm_gen_table()
[all …]
Dsha512.c95 void mbedtls_sha512_init( mbedtls_sha512_context *ctx ) in mbedtls_sha512_init() argument
97 memset( ctx, 0, sizeof( mbedtls_sha512_context ) ); in mbedtls_sha512_init()
100 void mbedtls_sha512_free( mbedtls_sha512_context *ctx ) in mbedtls_sha512_free() argument
102 if( ctx == NULL ) in mbedtls_sha512_free()
105 mbedtls_zeroize( ctx, sizeof( mbedtls_sha512_context ) ); in mbedtls_sha512_free()
117 void mbedtls_sha512_starts( mbedtls_sha512_context *ctx, int is384 ) in mbedtls_sha512_starts() argument
119 ctx->total[0] = 0; in mbedtls_sha512_starts()
120 ctx->total[1] = 0; in mbedtls_sha512_starts()
125 ctx->state[0] = UL64(0x6A09E667F3BCC908); in mbedtls_sha512_starts()
126 ctx->state[1] = UL64(0xBB67AE8584CAA73B); in mbedtls_sha512_starts()
[all …]
Dcipher_wrap.c80 void *ctx = mbedtls_calloc( 1, sizeof( mbedtls_gcm_context ) ); in gcm_ctx_alloc() local
82 if( ctx != NULL ) in gcm_ctx_alloc()
83 mbedtls_gcm_init( (mbedtls_gcm_context *) ctx ); in gcm_ctx_alloc()
85 return( ctx ); in gcm_ctx_alloc()
88 static void gcm_ctx_free( void *ctx ) in gcm_ctx_free() argument
90 mbedtls_gcm_free( ctx ); in gcm_ctx_free()
91 mbedtls_free( ctx ); in gcm_ctx_free()
99 void *ctx = mbedtls_calloc( 1, sizeof( mbedtls_ccm_context ) ); in ccm_ctx_alloc() local
101 if( ctx != NULL ) in ccm_ctx_alloc()
102 mbedtls_ccm_init( (mbedtls_ccm_context *) ctx ); in ccm_ctx_alloc()
[all …]
Dctr_drbg.c60 void mbedtls_ctr_drbg_init( mbedtls_ctr_drbg_context *ctx ) in mbedtls_ctr_drbg_init() argument
62 memset( ctx, 0, sizeof( mbedtls_ctr_drbg_context ) ); in mbedtls_ctr_drbg_init()
65 mbedtls_mutex_init( &ctx->mutex ); in mbedtls_ctr_drbg_init()
74 mbedtls_ctr_drbg_context *ctx, in mbedtls_ctr_drbg_seed_entropy_len() argument
86 mbedtls_aes_init( &ctx->aes_ctx ); in mbedtls_ctr_drbg_seed_entropy_len()
88 ctx->f_entropy = f_entropy; in mbedtls_ctr_drbg_seed_entropy_len()
89 ctx->p_entropy = p_entropy; in mbedtls_ctr_drbg_seed_entropy_len()
91 ctx->entropy_len = entropy_len; in mbedtls_ctr_drbg_seed_entropy_len()
92 ctx->reseed_interval = MBEDTLS_CTR_DRBG_RESEED_INTERVAL; in mbedtls_ctr_drbg_seed_entropy_len()
97 mbedtls_aes_setkey_enc( &ctx->aes_ctx, key, MBEDTLS_CTR_DRBG_KEYBITS ); in mbedtls_ctr_drbg_seed_entropy_len()
[all …]
Dpk_wrap.c66 static size_t rsa_get_bitlen( const void *ctx ) in rsa_get_bitlen() argument
68 return( 8 * ((const mbedtls_rsa_context *) ctx)->len ); in rsa_get_bitlen()
71 static int rsa_verify_wrap( void *ctx, mbedtls_md_type_t md_alg, in rsa_verify_wrap() argument
77 if( sig_len < ((mbedtls_rsa_context *) ctx)->len ) in rsa_verify_wrap()
80 if( ( ret = mbedtls_rsa_pkcs1_verify( (mbedtls_rsa_context *) ctx, NULL, NULL, in rsa_verify_wrap()
85 if( sig_len > ((mbedtls_rsa_context *) ctx)->len ) in rsa_verify_wrap()
91 static int rsa_sign_wrap( void *ctx, mbedtls_md_type_t md_alg, in rsa_sign_wrap() argument
96 *sig_len = ((mbedtls_rsa_context *) ctx)->len; in rsa_sign_wrap()
98 return( mbedtls_rsa_pkcs1_sign( (mbedtls_rsa_context *) ctx, f_rng, p_rng, MBEDTLS_RSA_PRIVATE, in rsa_sign_wrap()
102 static int rsa_decrypt_wrap( void *ctx, in rsa_decrypt_wrap() argument
[all …]
Drsa.c67 void mbedtls_rsa_init( mbedtls_rsa_context *ctx, in mbedtls_rsa_init() argument
71 memset( ctx, 0, sizeof( mbedtls_rsa_context ) ); in mbedtls_rsa_init()
73 mbedtls_rsa_set_padding( ctx, padding, hash_id ); in mbedtls_rsa_init()
76 mbedtls_mutex_init( &ctx->mutex ); in mbedtls_rsa_init()
83 void mbedtls_rsa_set_padding( mbedtls_rsa_context *ctx, int padding, int hash_id ) in mbedtls_rsa_set_padding() argument
85 ctx->padding = padding; in mbedtls_rsa_set_padding()
86 ctx->hash_id = hash_id; in mbedtls_rsa_set_padding()
94 int mbedtls_rsa_gen_key( mbedtls_rsa_context *ctx, in mbedtls_rsa_gen_key() argument
115 MBEDTLS_MPI_CHK( mbedtls_mpi_lset( &ctx->E, exponent ) ); in mbedtls_rsa_gen_key()
119 MBEDTLS_MPI_CHK( mbedtls_mpi_gen_prime( &ctx->P, nbits >> 1, 0, in mbedtls_rsa_gen_key()
[all …]
Dsha256.c81 void mbedtls_sha256_init( mbedtls_sha256_context *ctx ) in mbedtls_sha256_init() argument
83 memset( ctx, 0, sizeof( mbedtls_sha256_context ) ); in mbedtls_sha256_init()
86 void mbedtls_sha256_free( mbedtls_sha256_context *ctx ) in mbedtls_sha256_free() argument
88 if( ctx == NULL ) in mbedtls_sha256_free()
91 mbedtls_zeroize( ctx, sizeof( mbedtls_sha256_context ) ); in mbedtls_sha256_free()
103 void mbedtls_sha256_starts( mbedtls_sha256_context *ctx, int is224 ) in mbedtls_sha256_starts() argument
105 ctx->total[0] = 0; in mbedtls_sha256_starts()
106 ctx->total[1] = 0; in mbedtls_sha256_starts()
111 ctx->state[0] = 0x6A09E667; in mbedtls_sha256_starts()
112 ctx->state[1] = 0xBB67AE85; in mbedtls_sha256_starts()
[all …]
Dx509write_crt.c52 void mbedtls_x509write_crt_init( mbedtls_x509write_cert *ctx ) in mbedtls_x509write_crt_init() argument
54 memset( ctx, 0, sizeof(mbedtls_x509write_cert) ); in mbedtls_x509write_crt_init()
56 mbedtls_mpi_init( &ctx->serial ); in mbedtls_x509write_crt_init()
57 ctx->version = MBEDTLS_X509_CRT_VERSION_3; in mbedtls_x509write_crt_init()
60 void mbedtls_x509write_crt_free( mbedtls_x509write_cert *ctx ) in mbedtls_x509write_crt_free() argument
62 mbedtls_mpi_free( &ctx->serial ); in mbedtls_x509write_crt_free()
64 mbedtls_asn1_free_named_data_list( &ctx->subject ); in mbedtls_x509write_crt_free()
65 mbedtls_asn1_free_named_data_list( &ctx->issuer ); in mbedtls_x509write_crt_free()
66 mbedtls_asn1_free_named_data_list( &ctx->extensions ); in mbedtls_x509write_crt_free()
68 mbedtls_zeroize( ctx, sizeof(mbedtls_x509write_cert) ); in mbedtls_x509write_crt_free()
[all …]
Dssl_cookie.c78 void mbedtls_ssl_cookie_init( mbedtls_ssl_cookie_ctx *ctx ) in mbedtls_ssl_cookie_init() argument
80 mbedtls_md_init( &ctx->hmac_ctx ); in mbedtls_ssl_cookie_init()
82 ctx->serial = 0; in mbedtls_ssl_cookie_init()
84 ctx->timeout = MBEDTLS_SSL_COOKIE_TIMEOUT; in mbedtls_ssl_cookie_init()
87 mbedtls_mutex_init( &ctx->mutex ); in mbedtls_ssl_cookie_init()
91 void mbedtls_ssl_cookie_set_timeout( mbedtls_ssl_cookie_ctx *ctx, unsigned long delay ) in mbedtls_ssl_cookie_set_timeout() argument
93 ctx->timeout = delay; in mbedtls_ssl_cookie_set_timeout()
96 void mbedtls_ssl_cookie_free( mbedtls_ssl_cookie_ctx *ctx ) in mbedtls_ssl_cookie_free() argument
98 mbedtls_md_free( &ctx->hmac_ctx ); in mbedtls_ssl_cookie_free()
101 mbedtls_mutex_init( &ctx->mutex ); in mbedtls_ssl_cookie_free()
[all …]
Decjpake.c47 #define ID_MINE ( ecjpake_id[ ctx->role ] )
48 #define ID_PEER ( ecjpake_id[ 1 - ctx->role ] )
53 void mbedtls_ecjpake_init( mbedtls_ecjpake_context *ctx ) in mbedtls_ecjpake_init() argument
55 if( ctx == NULL ) in mbedtls_ecjpake_init()
58 ctx->md_info = NULL; in mbedtls_ecjpake_init()
59 mbedtls_ecp_group_init( &ctx->grp ); in mbedtls_ecjpake_init()
60 ctx->point_format = MBEDTLS_ECP_PF_UNCOMPRESSED; in mbedtls_ecjpake_init()
62 mbedtls_ecp_point_init( &ctx->Xm1 ); in mbedtls_ecjpake_init()
63 mbedtls_ecp_point_init( &ctx->Xm2 ); in mbedtls_ecjpake_init()
64 mbedtls_ecp_point_init( &ctx->Xp1 ); in mbedtls_ecjpake_init()
[all …]
/net-tools-3.7.0/tinydtls-0.8.2/
Dhmac.c51 dtls_hmac_context_free(dtls_hmac_context_t *ctx) { in dtls_hmac_context_free() argument
52 free(ctx); in dtls_hmac_context_free()
65 dtls_hmac_context_free(dtls_hmac_context_t *ctx) { in dtls_hmac_context_free() argument
66 memb_free(&hmac_context_storage, ctx); in dtls_hmac_context_free()
76 dtls_hmac_update(dtls_hmac_context_t *ctx, in dtls_hmac_update() argument
78 assert(ctx); in dtls_hmac_update()
79 dtls_hash_update(&ctx->data, input, ilen); in dtls_hmac_update()
84 dtls_hmac_context_t *ctx; in dtls_hmac_new() local
86 ctx = dtls_hmac_context_new(); in dtls_hmac_new()
87 if (ctx) in dtls_hmac_new()
[all …]
/net-tools-3.7.0/mbedtls-2.4.0/include/mbedtls/
Dcipher.h305 void mbedtls_cipher_init( mbedtls_cipher_context_t *ctx );
312 void mbedtls_cipher_free( mbedtls_cipher_context_t *ctx );
330 int mbedtls_cipher_setup( mbedtls_cipher_context_t *ctx, const mbedtls_cipher_info_t *cipher_info );
340 static inline unsigned int mbedtls_cipher_get_block_size( const mbedtls_cipher_context_t *ctx ) in mbedtls_cipher_get_block_size() argument
342 if( NULL == ctx || NULL == ctx->cipher_info ) in mbedtls_cipher_get_block_size()
345 return ctx->cipher_info->block_size; in mbedtls_cipher_get_block_size()
357 … inline mbedtls_cipher_mode_t mbedtls_cipher_get_cipher_mode( const mbedtls_cipher_context_t *ctx ) in mbedtls_cipher_get_cipher_mode() argument
359 if( NULL == ctx || NULL == ctx->cipher_info ) in mbedtls_cipher_get_cipher_mode()
362 return ctx->cipher_info->mode; in mbedtls_cipher_get_cipher_mode()
374 static inline int mbedtls_cipher_get_iv_size( const mbedtls_cipher_context_t *ctx ) in mbedtls_cipher_get_iv_size() argument
[all …]
/net-tools-3.7.0/mbedtls-2.4.0/tests/suites/
Dtest_suite_pkcs1_v15.function21 mbedtls_rsa_context ctx;
28 mbedtls_rsa_init( &ctx, MBEDTLS_RSA_PKCS_V15, hash );
33 ctx.len = mod / 8 + ( ( mod % 8 ) ? 1 : 0 );
34 TEST_ASSERT( mbedtls_mpi_read_string( &ctx.N, radix_N, input_N ) == 0 );
35 TEST_ASSERT( mbedtls_mpi_read_string( &ctx.E, radix_E, input_E ) == 0 );
37 TEST_ASSERT( mbedtls_rsa_check_pubkey( &ctx ) == 0 );
41 …TEST_ASSERT( mbedtls_rsa_pkcs1_encrypt( &ctx, &rnd_buffer_rand, &info, MBEDTLS_RSA_PUBLIC, msg_len…
44 hexify( output_str, output, ctx.len );
50 mbedtls_rsa_free( &ctx );
64 mbedtls_rsa_context ctx;
[all …]
Dtest_suite_pkcs1_v21.function21 mbedtls_rsa_context ctx;
28 mbedtls_rsa_init( &ctx, MBEDTLS_RSA_PKCS_V21, hash );
33 ctx.len = mod / 8 + ( ( mod % 8 ) ? 1 : 0 );
34 TEST_ASSERT( mbedtls_mpi_read_string( &ctx.N, radix_N, input_N ) == 0 );
35 TEST_ASSERT( mbedtls_mpi_read_string( &ctx.E, radix_E, input_E ) == 0 );
37 TEST_ASSERT( mbedtls_rsa_check_pubkey( &ctx ) == 0 );
41 …TEST_ASSERT( mbedtls_rsa_pkcs1_encrypt( &ctx, &rnd_buffer_rand, &info, MBEDTLS_RSA_PUBLIC, msg_len…
44 hexify( output_str, output, ctx.len );
50 mbedtls_rsa_free( &ctx );
64 mbedtls_rsa_context ctx;
[all …]
Dtest_suite_rsa.function28 mbedtls_rsa_context ctx;
34 mbedtls_rsa_init( &ctx, padding_mode, 0 );
42 ctx.len = mod / 8;
43 TEST_ASSERT( mbedtls_mpi_read_string( &ctx.P, radix_P, input_P ) == 0 );
44 TEST_ASSERT( mbedtls_mpi_read_string( &ctx.Q, radix_Q, input_Q ) == 0 );
45 TEST_ASSERT( mbedtls_mpi_read_string( &ctx.N, radix_N, input_N ) == 0 );
46 TEST_ASSERT( mbedtls_mpi_read_string( &ctx.E, radix_E, input_E ) == 0 );
48 TEST_ASSERT( mbedtls_mpi_sub_int( &P1, &ctx.P, 1 ) == 0 );
49 TEST_ASSERT( mbedtls_mpi_sub_int( &Q1, &ctx.Q, 1 ) == 0 );
51 TEST_ASSERT( mbedtls_mpi_gcd( &G, &ctx.E, &H ) == 0 );
[all …]

1234567