Lines Matching refs:ctx
80 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()
104 return( ctx ); in ccm_ctx_alloc()
107 static void ccm_ctx_free( void *ctx ) in ccm_ctx_free() argument
109 mbedtls_ccm_free( ctx ); in ccm_ctx_free()
110 mbedtls_free( ctx ); in ccm_ctx_free()
116 static int aes_crypt_ecb_wrap( void *ctx, mbedtls_operation_t operation, in aes_crypt_ecb_wrap() argument
119 return mbedtls_aes_crypt_ecb( (mbedtls_aes_context *) ctx, operation, input, output ); in aes_crypt_ecb_wrap()
123 static int aes_crypt_cbc_wrap( void *ctx, mbedtls_operation_t operation, size_t length, in aes_crypt_cbc_wrap() argument
126 return mbedtls_aes_crypt_cbc( (mbedtls_aes_context *) ctx, operation, length, iv, input, in aes_crypt_cbc_wrap()
132 static int aes_crypt_cfb128_wrap( void *ctx, mbedtls_operation_t operation, in aes_crypt_cfb128_wrap() argument
136 return mbedtls_aes_crypt_cfb128( (mbedtls_aes_context *) ctx, operation, length, iv_off, iv, in aes_crypt_cfb128_wrap()
142 static int aes_crypt_ctr_wrap( void *ctx, size_t length, size_t *nc_off, in aes_crypt_ctr_wrap() argument
146 return mbedtls_aes_crypt_ctr( (mbedtls_aes_context *) ctx, length, nc_off, nonce_counter, in aes_crypt_ctr_wrap()
151 static int aes_setkey_dec_wrap( void *ctx, const unsigned char *key, in aes_setkey_dec_wrap() argument
154 return mbedtls_aes_setkey_dec( (mbedtls_aes_context *) ctx, key, key_bitlen ); in aes_setkey_dec_wrap()
157 static int aes_setkey_enc_wrap( void *ctx, const unsigned char *key, in aes_setkey_enc_wrap() argument
160 return mbedtls_aes_setkey_enc( (mbedtls_aes_context *) ctx, key, key_bitlen ); in aes_setkey_enc_wrap()
175 static void aes_ctx_free( void *ctx ) in aes_ctx_free() argument
177 mbedtls_aes_free( (mbedtls_aes_context *) ctx ); in aes_ctx_free()
178 mbedtls_free( ctx ); in aes_ctx_free()
341 static int gcm_aes_setkey_wrap( void *ctx, const unsigned char *key, in gcm_aes_setkey_wrap() argument
344 return mbedtls_gcm_setkey( (mbedtls_gcm_context *) ctx, MBEDTLS_CIPHER_ID_AES, in gcm_aes_setkey_wrap()
404 static int ccm_aes_setkey_wrap( void *ctx, const unsigned char *key, in ccm_aes_setkey_wrap() argument
407 return mbedtls_ccm_setkey( (mbedtls_ccm_context *) ctx, MBEDTLS_CIPHER_ID_AES, in ccm_aes_setkey_wrap()
470 static int camellia_crypt_ecb_wrap( void *ctx, mbedtls_operation_t operation, in camellia_crypt_ecb_wrap() argument
473 return mbedtls_camellia_crypt_ecb( (mbedtls_camellia_context *) ctx, operation, input, in camellia_crypt_ecb_wrap()
478 static int camellia_crypt_cbc_wrap( void *ctx, mbedtls_operation_t operation, in camellia_crypt_cbc_wrap() argument
482 return mbedtls_camellia_crypt_cbc( (mbedtls_camellia_context *) ctx, operation, length, iv, in camellia_crypt_cbc_wrap()
488 static int camellia_crypt_cfb128_wrap( void *ctx, mbedtls_operation_t operation, in camellia_crypt_cfb128_wrap() argument
492 return mbedtls_camellia_crypt_cfb128( (mbedtls_camellia_context *) ctx, operation, length, in camellia_crypt_cfb128_wrap()
498 static int camellia_crypt_ctr_wrap( void *ctx, size_t length, size_t *nc_off, in camellia_crypt_ctr_wrap() argument
502 return mbedtls_camellia_crypt_ctr( (mbedtls_camellia_context *) ctx, length, nc_off, in camellia_crypt_ctr_wrap()
507 static int camellia_setkey_dec_wrap( void *ctx, const unsigned char *key, in camellia_setkey_dec_wrap() argument
510 return mbedtls_camellia_setkey_dec( (mbedtls_camellia_context *) ctx, key, key_bitlen ); in camellia_setkey_dec_wrap()
513 static int camellia_setkey_enc_wrap( void *ctx, const unsigned char *key, in camellia_setkey_enc_wrap() argument
516 return mbedtls_camellia_setkey_enc( (mbedtls_camellia_context *) ctx, key, key_bitlen ); in camellia_setkey_enc_wrap()
521 mbedtls_camellia_context *ctx; in camellia_ctx_alloc() local
522 ctx = mbedtls_calloc( 1, sizeof( mbedtls_camellia_context ) ); in camellia_ctx_alloc()
524 if( ctx == NULL ) in camellia_ctx_alloc()
527 mbedtls_camellia_init( ctx ); in camellia_ctx_alloc()
529 return( ctx ); in camellia_ctx_alloc()
532 static void camellia_ctx_free( void *ctx ) in camellia_ctx_free() argument
534 mbedtls_camellia_free( (mbedtls_camellia_context *) ctx ); in camellia_ctx_free()
535 mbedtls_free( ctx ); in camellia_ctx_free()
698 static int gcm_camellia_setkey_wrap( void *ctx, const unsigned char *key, in gcm_camellia_setkey_wrap() argument
701 return mbedtls_gcm_setkey( (mbedtls_gcm_context *) ctx, MBEDTLS_CIPHER_ID_CAMELLIA, in gcm_camellia_setkey_wrap()
761 static int ccm_camellia_setkey_wrap( void *ctx, const unsigned char *key, in ccm_camellia_setkey_wrap() argument
764 return mbedtls_ccm_setkey( (mbedtls_ccm_context *) ctx, MBEDTLS_CIPHER_ID_CAMELLIA, in ccm_camellia_setkey_wrap()
827 static int des_crypt_ecb_wrap( void *ctx, mbedtls_operation_t operation, in des_crypt_ecb_wrap() argument
831 return mbedtls_des_crypt_ecb( (mbedtls_des_context *) ctx, input, output ); in des_crypt_ecb_wrap()
834 static int des3_crypt_ecb_wrap( void *ctx, mbedtls_operation_t operation, in des3_crypt_ecb_wrap() argument
838 return mbedtls_des3_crypt_ecb( (mbedtls_des3_context *) ctx, input, output ); in des3_crypt_ecb_wrap()
842 static int des_crypt_cbc_wrap( void *ctx, mbedtls_operation_t operation, size_t length, in des_crypt_cbc_wrap() argument
845 return mbedtls_des_crypt_cbc( (mbedtls_des_context *) ctx, operation, length, iv, input, in des_crypt_cbc_wrap()
851 static int des3_crypt_cbc_wrap( void *ctx, mbedtls_operation_t operation, size_t length, in des3_crypt_cbc_wrap() argument
854 return mbedtls_des3_crypt_cbc( (mbedtls_des3_context *) ctx, operation, length, iv, input, in des3_crypt_cbc_wrap()
859 static int des_setkey_dec_wrap( void *ctx, const unsigned char *key, in des_setkey_dec_wrap() argument
864 return mbedtls_des_setkey_dec( (mbedtls_des_context *) ctx, key ); in des_setkey_dec_wrap()
867 static int des_setkey_enc_wrap( void *ctx, const unsigned char *key, in des_setkey_enc_wrap() argument
872 return mbedtls_des_setkey_enc( (mbedtls_des_context *) ctx, key ); in des_setkey_enc_wrap()
875 static int des3_set2key_dec_wrap( void *ctx, const unsigned char *key, in des3_set2key_dec_wrap() argument
880 return mbedtls_des3_set2key_dec( (mbedtls_des3_context *) ctx, key ); in des3_set2key_dec_wrap()
883 static int des3_set2key_enc_wrap( void *ctx, const unsigned char *key, in des3_set2key_enc_wrap() argument
888 return mbedtls_des3_set2key_enc( (mbedtls_des3_context *) ctx, key ); in des3_set2key_enc_wrap()
891 static int des3_set3key_dec_wrap( void *ctx, const unsigned char *key, in des3_set3key_dec_wrap() argument
896 return mbedtls_des3_set3key_dec( (mbedtls_des3_context *) ctx, key ); in des3_set3key_dec_wrap()
899 static int des3_set3key_enc_wrap( void *ctx, const unsigned char *key, in des3_set3key_enc_wrap() argument
904 return mbedtls_des3_set3key_enc( (mbedtls_des3_context *) ctx, key ); in des3_set3key_enc_wrap()
919 static void des_ctx_free( void *ctx ) in des_ctx_free() argument
921 mbedtls_des_free( (mbedtls_des_context *) ctx ); in des_ctx_free()
922 mbedtls_free( ctx ); in des_ctx_free()
938 static void des3_ctx_free( void *ctx ) in des3_ctx_free() argument
940 mbedtls_des3_free( (mbedtls_des3_context *) ctx ); in des3_ctx_free()
941 mbedtls_free( ctx ); in des3_ctx_free()
1081 static int blowfish_crypt_ecb_wrap( void *ctx, mbedtls_operation_t operation, in blowfish_crypt_ecb_wrap() argument
1084 return mbedtls_blowfish_crypt_ecb( (mbedtls_blowfish_context *) ctx, operation, input, in blowfish_crypt_ecb_wrap()
1089 static int blowfish_crypt_cbc_wrap( void *ctx, mbedtls_operation_t operation, in blowfish_crypt_cbc_wrap() argument
1093 return mbedtls_blowfish_crypt_cbc( (mbedtls_blowfish_context *) ctx, operation, length, iv, in blowfish_crypt_cbc_wrap()
1099 static int blowfish_crypt_cfb64_wrap( void *ctx, mbedtls_operation_t operation, in blowfish_crypt_cfb64_wrap() argument
1103 return mbedtls_blowfish_crypt_cfb64( (mbedtls_blowfish_context *) ctx, operation, length, in blowfish_crypt_cfb64_wrap()
1109 static int blowfish_crypt_ctr_wrap( void *ctx, size_t length, size_t *nc_off, in blowfish_crypt_ctr_wrap() argument
1113 return mbedtls_blowfish_crypt_ctr( (mbedtls_blowfish_context *) ctx, length, nc_off, in blowfish_crypt_ctr_wrap()
1118 static int blowfish_setkey_wrap( void *ctx, const unsigned char *key, in blowfish_setkey_wrap() argument
1121 return mbedtls_blowfish_setkey( (mbedtls_blowfish_context *) ctx, key, key_bitlen ); in blowfish_setkey_wrap()
1126 mbedtls_blowfish_context *ctx; in blowfish_ctx_alloc() local
1127 ctx = mbedtls_calloc( 1, sizeof( mbedtls_blowfish_context ) ); in blowfish_ctx_alloc()
1129 if( ctx == NULL ) in blowfish_ctx_alloc()
1132 mbedtls_blowfish_init( ctx ); in blowfish_ctx_alloc()
1134 return( ctx ); in blowfish_ctx_alloc()
1137 static void blowfish_ctx_free( void *ctx ) in blowfish_ctx_free() argument
1139 mbedtls_blowfish_free( (mbedtls_blowfish_context *) ctx ); in blowfish_ctx_free()
1140 mbedtls_free( ctx ); in blowfish_ctx_free()
1216 static int arc4_crypt_stream_wrap( void *ctx, size_t length, in arc4_crypt_stream_wrap() argument
1220 return( mbedtls_arc4_crypt( (mbedtls_arc4_context *) ctx, length, input, output ) ); in arc4_crypt_stream_wrap()
1223 static int arc4_setkey_wrap( void *ctx, const unsigned char *key, in arc4_setkey_wrap() argument
1230 mbedtls_arc4_setup( (mbedtls_arc4_context *) ctx, key, key_bitlen / 8 ); in arc4_setkey_wrap()
1236 mbedtls_arc4_context *ctx; in arc4_ctx_alloc() local
1237 ctx = mbedtls_calloc( 1, sizeof( mbedtls_arc4_context ) ); in arc4_ctx_alloc()
1239 if( ctx == NULL ) in arc4_ctx_alloc()
1242 mbedtls_arc4_init( ctx ); in arc4_ctx_alloc()
1244 return( ctx ); in arc4_ctx_alloc()
1247 static void arc4_ctx_free( void *ctx ) in arc4_ctx_free() argument
1249 mbedtls_arc4_free( (mbedtls_arc4_context *) ctx ); in arc4_ctx_free()
1250 mbedtls_free( ctx ); in arc4_ctx_free()
1287 static int null_crypt_stream( void *ctx, size_t length, in null_crypt_stream() argument
1291 ((void) ctx); in null_crypt_stream()
1296 static int null_setkey( void *ctx, const unsigned char *key, in null_setkey() argument
1299 ((void) ctx); in null_setkey()
1311 static void null_ctx_free( void *ctx ) in null_ctx_free() argument
1313 ((void) ctx); in null_ctx_free()