Home
last modified time | relevance | path

Searched refs:cipher_info (Results 1 – 14 of 14) sorted by relevance

/net-tools-3.4.0/mbedtls-2.4.0/library/
Dcipher.c150 ctx->cipher_info->base->ctx_free_func( ctx->cipher_ctx ); in mbedtls_cipher_free()
155 int mbedtls_cipher_setup( mbedtls_cipher_context_t *ctx, const mbedtls_cipher_info_t *cipher_info ) in mbedtls_cipher_setup() argument
157 if( NULL == cipher_info || NULL == ctx ) in mbedtls_cipher_setup()
162 if( NULL == ( ctx->cipher_ctx = cipher_info->base->ctx_alloc_func() ) ) in mbedtls_cipher_setup()
165 ctx->cipher_info = cipher_info; in mbedtls_cipher_setup()
184 if( NULL == ctx || NULL == ctx->cipher_info ) in mbedtls_cipher_setkey()
187 if( ( ctx->cipher_info->flags & MBEDTLS_CIPHER_VARIABLE_KEY_LEN ) == 0 && in mbedtls_cipher_setkey()
188 (int) ctx->cipher_info->key_bitlen != key_bitlen ) in mbedtls_cipher_setkey()
200 MBEDTLS_MODE_CFB == ctx->cipher_info->mode || in mbedtls_cipher_setkey()
201 MBEDTLS_MODE_CTR == ctx->cipher_info->mode ) in mbedtls_cipher_setkey()
[all …]
Dcmac.c147 block_size = ctx->cipher_info->block_size; in cmac_generate_subkeys()
209 if( ctx == NULL || ctx->cipher_info == NULL || key == NULL ) in mbedtls_cipher_cmac_starts()
216 type = ctx->cipher_info->type; in mbedtls_cipher_cmac_starts()
250 if( ctx == NULL || ctx->cipher_info == NULL || input == NULL || in mbedtls_cipher_cmac_update()
255 block_size = ctx->cipher_info->block_size; in mbedtls_cipher_cmac_update()
320 if( ctx == NULL || ctx->cipher_info == NULL || ctx->cmac_ctx == NULL || in mbedtls_cipher_cmac_finish()
325 block_size = ctx->cipher_info->block_size; in mbedtls_cipher_cmac_finish()
374 if( ctx == NULL || ctx->cipher_info == NULL || ctx->cmac_ctx == NULL ) in mbedtls_cipher_cmac_reset()
389 int mbedtls_cipher_cmac( const mbedtls_cipher_info_t *cipher_info, in mbedtls_cipher_cmac() argument
397 if( cipher_info == NULL || key == NULL || input == NULL || output == NULL ) in mbedtls_cipher_cmac()
[all …]
Dssl_ticket.c128 const mbedtls_cipher_info_t *cipher_info; in mbedtls_ssl_ticket_setup() local
135 cipher_info = mbedtls_cipher_info_from_type( cipher); in mbedtls_ssl_ticket_setup()
136 if( cipher_info == NULL ) in mbedtls_ssl_ticket_setup()
139 if( cipher_info->mode != MBEDTLS_MODE_GCM && in mbedtls_ssl_ticket_setup()
140 cipher_info->mode != MBEDTLS_MODE_CCM ) in mbedtls_ssl_ticket_setup()
145 if( cipher_info->key_bitlen > 8 * MAX_KEY_BYTES ) in mbedtls_ssl_ticket_setup()
148 if( ( ret = mbedtls_cipher_setup( &ctx->keys[0].ctx, cipher_info ) ) != 0 || in mbedtls_ssl_ticket_setup()
149 ( ret = mbedtls_cipher_setup( &ctx->keys[1].ctx, cipher_info ) ) != 0 ) in mbedtls_ssl_ticket_setup()
Dpkcs12.c185 const mbedtls_cipher_info_t *cipher_info; in mbedtls_pkcs12_pbe() local
189 cipher_info = mbedtls_cipher_info_from_type( cipher_type ); in mbedtls_pkcs12_pbe()
190 if( cipher_info == NULL ) in mbedtls_pkcs12_pbe()
193 keylen = cipher_info->key_bitlen / 8; in mbedtls_pkcs12_pbe()
197 iv, cipher_info->iv_size ) ) != 0 ) in mbedtls_pkcs12_pbe()
204 if( ( ret = mbedtls_cipher_setup( &cipher_ctx, cipher_info ) ) != 0 ) in mbedtls_pkcs12_pbe()
210 if( ( ret = mbedtls_cipher_set_iv( &cipher_ctx, iv, cipher_info->iv_size ) ) != 0 ) in mbedtls_pkcs12_pbe()
Dpkcs5.c124 const mbedtls_cipher_info_t *cipher_info; in mbedtls_pkcs5_pbes2() local
170 cipher_info = mbedtls_cipher_info_from_type( cipher_alg ); in mbedtls_pkcs5_pbes2()
171 if( cipher_info == NULL ) in mbedtls_pkcs5_pbes2()
178 keylen = cipher_info->key_bitlen / 8; in mbedtls_pkcs5_pbes2()
181 enc_scheme_params.len != cipher_info->iv_size ) in mbedtls_pkcs5_pbes2()
200 if( ( ret = mbedtls_cipher_setup( &cipher_ctx, cipher_info ) ) != 0 ) in mbedtls_pkcs5_pbes2()
Dccm.c74 const mbedtls_cipher_info_t *cipher_info; in mbedtls_ccm_setkey() local
76 cipher_info = mbedtls_cipher_info_from_values( cipher, keybits, MBEDTLS_MODE_ECB ); in mbedtls_ccm_setkey()
77 if( cipher_info == NULL ) in mbedtls_ccm_setkey()
80 if( cipher_info->block_size != 16 ) in mbedtls_ccm_setkey()
85 if( ( ret = mbedtls_cipher_setup( &ctx->cipher_ctx, cipher_info ) ) != 0 ) in mbedtls_ccm_setkey()
Dgcm.c167 const mbedtls_cipher_info_t *cipher_info; in mbedtls_gcm_setkey() local
169 cipher_info = mbedtls_cipher_info_from_values( cipher, keybits, MBEDTLS_MODE_ECB ); in mbedtls_gcm_setkey()
170 if( cipher_info == NULL ) in mbedtls_gcm_setkey()
173 if( cipher_info->block_size != 16 ) in mbedtls_gcm_setkey()
178 if( ( ret = mbedtls_cipher_setup( &ctx->cipher_ctx, cipher_info ) ) != 0 ) in mbedtls_gcm_setkey()
Dssl_tls.c494 const mbedtls_cipher_info_t *cipher_info; in mbedtls_ssl_derive_keys() local
503 cipher_info = mbedtls_cipher_info_from_type( transform->ciphersuite_info->cipher ); in mbedtls_ssl_derive_keys()
504 if( cipher_info == NULL ) in mbedtls_ssl_derive_keys()
678 transform->keylen = cipher_info->key_bitlen / 8; in mbedtls_ssl_derive_keys()
680 if( cipher_info->mode == MBEDTLS_MODE_GCM || in mbedtls_ssl_derive_keys()
681 cipher_info->mode == MBEDTLS_MODE_CCM ) in mbedtls_ssl_derive_keys()
717 transform->ivlen = cipher_info->iv_size; in mbedtls_ssl_derive_keys()
720 if( cipher_info->mode == MBEDTLS_MODE_STREAM ) in mbedtls_ssl_derive_keys()
734 + cipher_info->block_size; in mbedtls_ssl_derive_keys()
740 + cipher_info->block_size in mbedtls_ssl_derive_keys()
[all …]
/net-tools-3.4.0/mbedtls-2.4.0/include/mbedtls/
Dcipher.h221 const mbedtls_cipher_info_t *cipher_info; member
330 int mbedtls_cipher_setup( mbedtls_cipher_context_t *ctx, const mbedtls_cipher_info_t *cipher_info );
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()
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()
376 if( NULL == ctx || NULL == ctx->cipher_info ) in mbedtls_cipher_get_iv_size()
382 return (int) ctx->cipher_info->iv_size; in mbedtls_cipher_get_iv_size()
395 if( NULL == ctx || NULL == ctx->cipher_info ) in mbedtls_cipher_get_type()
398 return ctx->cipher_info->type; in mbedtls_cipher_get_type()
[all …]
Dcmac.h130 int mbedtls_cipher_cmac( const mbedtls_cipher_info_t *cipher_info,
/net-tools-3.4.0/mbedtls-2.4.0/tests/suites/
Dtest_suite_cmac.function22 const mbedtls_cipher_info_t *cipher_info;
33 cipher_info = mbedtls_cipher_info_from_type( MBEDTLS_CIPHER_AES_128_ECB );
34 TEST_ASSERT( mbedtls_cipher_setup( &ctx, cipher_info ) == 0 );
63 TEST_ASSERT( mbedtls_cipher_cmac( cipher_info,
69 TEST_ASSERT( mbedtls_cipher_cmac( cipher_info,
75 TEST_ASSERT( mbedtls_cipher_cmac( cipher_info,
105 const mbedtls_cipher_info_t *cipher_info;
113 TEST_ASSERT( ( cipher_info = mbedtls_cipher_info_from_type( cipher_type ) )
117 TEST_ASSERT( ( result == mbedtls_cipher_cmac( cipher_info, key, key_size,
138 const mbedtls_cipher_info_t *cipher_info;
[all …]
Dtest_suite_cipher.function97 const mbedtls_cipher_info_t *cipher_info;
110 cipher_info = mbedtls_cipher_info_from_type( MBEDTLS_CIPHER_AES_128_ECB );
111 TEST_ASSERT( NULL != cipher_info );
113 TEST_ASSERT( 0 == mbedtls_cipher_setup( &ctx, cipher_info ) );
145 const mbedtls_cipher_info_t *cipher_info;
158 cipher_info = mbedtls_cipher_info_from_type( cipher_id );
159 TEST_ASSERT( NULL != cipher_info );
160 TEST_ASSERT( mbedtls_cipher_info_from_string( cipher_string ) == cipher_info );
163 TEST_ASSERT( 0 == mbedtls_cipher_setup( &ctx_dec, cipher_info ) );
164 TEST_ASSERT( 0 == mbedtls_cipher_setup( &ctx_enc, cipher_info ) );
[all …]
/net-tools-3.4.0/mbedtls-2.4.0/programs/aes/
Dcrypt_and_hash.c89 const mbedtls_cipher_info_t *cipher_info; in main() local
118 cipher_info = mbedtls_cipher_info_from_type( *list ); in main()
119 mbedtls_printf( " %s\n", cipher_info->name ); in main()
169 cipher_info = mbedtls_cipher_info_from_string( argv[4] ); in main()
170 if( cipher_info == NULL ) in main()
175 if( ( ret = mbedtls_cipher_setup( &cipher_ctx, cipher_info) ) != 0 ) in main()
308 if( mbedtls_cipher_setkey( &cipher_ctx, digest, cipher_info->key_bitlen, in main()
407 if( cipher_info->mode != MBEDTLS_MODE_GCM && in main()
449 if( mbedtls_cipher_setkey( &cipher_ctx, digest, cipher_info->key_bitlen, in main()
/net-tools-3.4.0/mbedtls-2.4.0/programs/test/
Dbenchmark.c396 const mbedtls_cipher_info_t *cipher_info; in main() local
401 cipher_info = mbedtls_cipher_info_from_type( MBEDTLS_CIPHER_DES_EDE3_ECB ); in main()
404 mbedtls_cipher_cmac( cipher_info, tmp, 192, buf, in main()
481 const mbedtls_cipher_info_t *cipher_info; in main() local
494 cipher_info = mbedtls_cipher_info_from_type( cipher_type ); in main()
497 mbedtls_cipher_cmac( cipher_info, tmp, keysize, in main()