Lines Matching refs:mechanism

119 aes_check_mech_param(crypto_mechanism_t *mechanism, aes_ctx_t **ctx)  in aes_check_mech_param()  argument
127 switch (mechanism->cm_type) { in aes_check_mech_param()
139 if (param_required && mechanism->cm_param != NULL && in aes_check_mech_param()
140 mechanism->cm_param_len != param_len) { in aes_check_mech_param()
173 aes_encrypt_atomic(crypto_mechanism_t *mechanism, in aes_encrypt_atomic() argument
187 if ((ret = aes_check_mech_param(mechanism, NULL)) != CRYPTO_SUCCESS) in aes_encrypt_atomic()
190 ret = aes_common_init_ctx(&aes_ctx, template, mechanism, key, in aes_encrypt_atomic()
195 switch (mechanism->cm_type) { in aes_encrypt_atomic()
233 if (mechanism->cm_type == AES_CCM_MECH_INFO_TYPE) { in aes_encrypt_atomic()
240 } else if (mechanism->cm_type == AES_GCM_MECH_INFO_TYPE) { in aes_encrypt_atomic()
272 aes_decrypt_atomic(crypto_mechanism_t *mechanism, in aes_decrypt_atomic() argument
286 if ((ret = aes_check_mech_param(mechanism, NULL)) != CRYPTO_SUCCESS) in aes_decrypt_atomic()
289 ret = aes_common_init_ctx(&aes_ctx, template, mechanism, key, in aes_decrypt_atomic()
294 switch (mechanism->cm_type) { in aes_decrypt_atomic()
332 if (mechanism->cm_type == AES_CCM_MECH_INFO_TYPE) { in aes_decrypt_atomic()
348 } else if (mechanism->cm_type == AES_GCM_MECH_INFO_TYPE) { in aes_decrypt_atomic()
388 aes_create_ctx_template(crypto_mechanism_t *mechanism, crypto_key_t *key, in aes_create_ctx_template() argument
395 if (mechanism->cm_type != AES_CCM_MECH_INFO_TYPE && in aes_create_ctx_template()
396 mechanism->cm_type != AES_GCM_MECH_INFO_TYPE) in aes_create_ctx_template()
443 crypto_mechanism_t *mechanism, crypto_key_t *key, int kmflag, in aes_common_init_ctx() argument
469 switch (mechanism->cm_type) { in aes_common_init_ctx()
471 if (mechanism->cm_param == NULL || in aes_common_init_ctx()
472 mechanism->cm_param_len != sizeof (CK_AES_CCM_PARAMS)) { in aes_common_init_ctx()
475 rv = ccm_init_ctx((ccm_ctx_t *)aes_ctx, mechanism->cm_param, in aes_common_init_ctx()
480 if (mechanism->cm_param == NULL || in aes_common_init_ctx()
481 mechanism->cm_param_len != sizeof (CK_AES_GCM_PARAMS)) { in aes_common_init_ctx()
484 rv = gcm_init_ctx((gcm_ctx_t *)aes_ctx, mechanism->cm_param, in aes_common_init_ctx()