Lines Matching full:mechanism
40 * Mechanism info structure passed to KCF during registration.
118 aes_check_mech_param(crypto_mechanism_t *mechanism, aes_ctx_t **ctx) in aes_check_mech_param() argument
126 switch (mechanism->cm_type) { in aes_check_mech_param()
138 if (param_required && mechanism->cm_param != NULL && in aes_check_mech_param()
139 mechanism->cm_param_len != param_len) { in aes_check_mech_param()
172 aes_encrypt_atomic(crypto_mechanism_t *mechanism, in aes_encrypt_atomic() argument
186 if ((ret = aes_check_mech_param(mechanism, NULL)) != CRYPTO_SUCCESS) in aes_encrypt_atomic()
189 ret = aes_common_init_ctx(&aes_ctx, template, mechanism, key, in aes_encrypt_atomic()
194 switch (mechanism->cm_type) { in aes_encrypt_atomic()
232 if (mechanism->cm_type == AES_CCM_MECH_INFO_TYPE) { in aes_encrypt_atomic()
239 } else if (mechanism->cm_type == AES_GCM_MECH_INFO_TYPE) { in aes_encrypt_atomic()
271 aes_decrypt_atomic(crypto_mechanism_t *mechanism, in aes_decrypt_atomic() argument
285 if ((ret = aes_check_mech_param(mechanism, NULL)) != CRYPTO_SUCCESS) in aes_decrypt_atomic()
288 ret = aes_common_init_ctx(&aes_ctx, template, mechanism, key, in aes_decrypt_atomic()
293 switch (mechanism->cm_type) { in aes_decrypt_atomic()
331 if (mechanism->cm_type == AES_CCM_MECH_INFO_TYPE) { in aes_decrypt_atomic()
347 } else if (mechanism->cm_type == AES_GCM_MECH_INFO_TYPE) { in aes_decrypt_atomic()
387 aes_create_ctx_template(crypto_mechanism_t *mechanism, crypto_key_t *key, in aes_create_ctx_template() argument
394 if (mechanism->cm_type != AES_CCM_MECH_INFO_TYPE && in aes_create_ctx_template()
395 mechanism->cm_type != AES_GCM_MECH_INFO_TYPE) in aes_create_ctx_template()
442 crypto_mechanism_t *mechanism, crypto_key_t *key, int kmflag, in aes_common_init_ctx() argument
468 switch (mechanism->cm_type) { in aes_common_init_ctx()
470 if (mechanism->cm_param == NULL || in aes_common_init_ctx()
471 mechanism->cm_param_len != sizeof (CK_AES_CCM_PARAMS)) { in aes_common_init_ctx()
474 rv = ccm_init_ctx((ccm_ctx_t *)aes_ctx, mechanism->cm_param, in aes_common_init_ctx()
479 if (mechanism->cm_param == NULL || in aes_common_init_ctx()
480 mechanism->cm_param_len != sizeof (CK_AES_GCM_PARAMS)) { in aes_common_init_ctx()
483 rv = gcm_init_ctx((gcm_ctx_t *)aes_ctx, mechanism->cm_param, in aes_common_init_ctx()