Lines Matching refs:mechanism
250 aes_check_mech_param(crypto_mechanism_t *mechanism, aes_ctx_t **ctx, int kmflag) in aes_check_mech_param() argument
258 switch (mechanism->cm_type) { in aes_check_mech_param()
287 if (param_required && mechanism->cm_param != NULL && in aes_check_mech_param()
288 mechanism->cm_param_len != param_len) { in aes_check_mech_param()
337 aes_encrypt_init(crypto_ctx_t *ctx, crypto_mechanism_t *mechanism, in aes_encrypt_init() argument
340 return (aes_common_init(ctx, mechanism, key, template, req, B_TRUE)); in aes_encrypt_init()
344 aes_decrypt_init(crypto_ctx_t *ctx, crypto_mechanism_t *mechanism, in aes_decrypt_init() argument
347 return (aes_common_init(ctx, mechanism, key, template, req, B_FALSE)); in aes_decrypt_init()
356 aes_common_init(crypto_ctx_t *ctx, crypto_mechanism_t *mechanism, in aes_common_init() argument
372 if ((rv = aes_check_mech_param(mechanism, &aes_ctx, kmflag)) in aes_common_init()
376 rv = aes_common_init_ctx(aes_ctx, template, mechanism, key, kmflag, in aes_common_init()
960 crypto_session_id_t session_id, crypto_mechanism_t *mechanism, in aes_encrypt_atomic() argument
976 switch (mechanism->cm_type) { in aes_encrypt_atomic()
987 if ((ret = aes_check_mech_param(mechanism, NULL, 0)) != CRYPTO_SUCCESS) in aes_encrypt_atomic()
992 ret = aes_common_init_ctx(&aes_ctx, template, mechanism, key, in aes_encrypt_atomic()
997 switch (mechanism->cm_type) { in aes_encrypt_atomic()
1043 if (mechanism->cm_type == AES_CCM_MECH_INFO_TYPE) { in aes_encrypt_atomic()
1050 } else if (mechanism->cm_type == AES_GCM_MECH_INFO_TYPE || in aes_encrypt_atomic()
1051 mechanism->cm_type == AES_GMAC_MECH_INFO_TYPE) { in aes_encrypt_atomic()
1058 } else if (mechanism->cm_type == AES_CTR_MECH_INFO_TYPE) { in aes_encrypt_atomic()
1090 crypto_session_id_t session_id, crypto_mechanism_t *mechanism, in aes_decrypt_atomic() argument
1106 switch (mechanism->cm_type) { in aes_decrypt_atomic()
1117 if ((ret = aes_check_mech_param(mechanism, NULL, 0)) != CRYPTO_SUCCESS) in aes_decrypt_atomic()
1122 ret = aes_common_init_ctx(&aes_ctx, template, mechanism, key, in aes_decrypt_atomic()
1127 switch (mechanism->cm_type) { in aes_decrypt_atomic()
1153 if (mechanism->cm_type == AES_GCM_MECH_INFO_TYPE || in aes_decrypt_atomic()
1154 mechanism->cm_type == AES_GMAC_MECH_INFO_TYPE) in aes_decrypt_atomic()
1178 if (mechanism->cm_type == AES_CCM_MECH_INFO_TYPE) { in aes_decrypt_atomic()
1194 } else if (mechanism->cm_type == AES_GCM_MECH_INFO_TYPE || in aes_decrypt_atomic()
1195 mechanism->cm_type == AES_GMAC_MECH_INFO_TYPE) { in aes_decrypt_atomic()
1207 } else if (mechanism->cm_type != AES_CTR_MECH_INFO_TYPE) { in aes_decrypt_atomic()
1256 crypto_mechanism_t *mechanism, crypto_key_t *key, in aes_create_ctx_template() argument
1263 if (mechanism->cm_type != AES_ECB_MECH_INFO_TYPE && in aes_create_ctx_template()
1264 mechanism->cm_type != AES_CBC_MECH_INFO_TYPE && in aes_create_ctx_template()
1265 mechanism->cm_type != AES_CTR_MECH_INFO_TYPE && in aes_create_ctx_template()
1266 mechanism->cm_type != AES_CCM_MECH_INFO_TYPE && in aes_create_ctx_template()
1267 mechanism->cm_type != AES_GCM_MECH_INFO_TYPE && in aes_create_ctx_template()
1268 mechanism->cm_type != AES_GMAC_MECH_INFO_TYPE) in aes_create_ctx_template()
1315 crypto_mechanism_t *mechanism, crypto_key_t *key, int kmflag, in aes_common_init_ctx() argument
1341 switch (mechanism->cm_type) { in aes_common_init_ctx()
1343 rv = cbc_init_ctx((cbc_ctx_t *)aes_ctx, mechanism->cm_param, in aes_common_init_ctx()
1344 mechanism->cm_param_len, AES_BLOCK_LEN, aes_copy_block64); in aes_common_init_ctx()
1349 if (mechanism->cm_param == NULL || in aes_common_init_ctx()
1350 mechanism->cm_param_len != sizeof (CK_AES_CTR_PARAMS)) { in aes_common_init_ctx()
1353 pp = (CK_AES_CTR_PARAMS *)(void *)mechanism->cm_param; in aes_common_init_ctx()
1359 if (mechanism->cm_param == NULL || in aes_common_init_ctx()
1360 mechanism->cm_param_len != sizeof (CK_AES_CCM_PARAMS)) { in aes_common_init_ctx()
1363 rv = ccm_init_ctx((ccm_ctx_t *)aes_ctx, mechanism->cm_param, in aes_common_init_ctx()
1368 if (mechanism->cm_param == NULL || in aes_common_init_ctx()
1369 mechanism->cm_param_len != sizeof (CK_AES_GCM_PARAMS)) { in aes_common_init_ctx()
1372 rv = gcm_init_ctx((gcm_ctx_t *)aes_ctx, mechanism->cm_param, in aes_common_init_ctx()
1377 if (mechanism->cm_param == NULL || in aes_common_init_ctx()
1378 mechanism->cm_param_len != sizeof (CK_AES_GMAC_PARAMS)) { in aes_common_init_ctx()
1381 rv = gmac_init_ctx((gcm_ctx_t *)aes_ctx, mechanism->cm_param, in aes_common_init_ctx()
1432 crypto_session_id_t session_id, crypto_mechanism_t *mechanism, in aes_mac_atomic() argument
1440 if ((rv = process_gmac_mech(mechanism, data, &gcm_params)) in aes_mac_atomic()
1454 crypto_session_id_t session_id, crypto_mechanism_t *mechanism, in aes_mac_verify_atomic() argument
1462 if ((rv = process_gmac_mech(mechanism, data, &gcm_params)) in aes_mac_verify_atomic()