Lines Matching refs:mechanism

268 aes_check_mech_param(crypto_mechanism_t *mechanism, aes_ctx_t **ctx, int kmflag)
276 switch (mechanism->cm_type) {
305 if (param_required && mechanism->cm_param != NULL &&
306 mechanism->cm_param_len != param_len) {
359 aes_encrypt_init(crypto_ctx_t *ctx, crypto_mechanism_t *mechanism,
362 return (aes_common_init(ctx, mechanism, key, template, req, B_TRUE));
366 aes_decrypt_init(crypto_ctx_t *ctx, crypto_mechanism_t *mechanism,
369 return (aes_common_init(ctx, mechanism, key, template, req, B_FALSE));
378 aes_common_init(crypto_ctx_t *ctx, crypto_mechanism_t *mechanism,
397 if ((rv = aes_check_mech_param(mechanism, &aes_ctx, kmflag))
401 rv = aes_common_init_ctx(aes_ctx, template, mechanism, key, kmflag,
1005 crypto_session_id_t session_id, crypto_mechanism_t *mechanism,
1021 switch (mechanism->cm_type) {
1032 if ((ret = aes_check_mech_param(mechanism, NULL, 0)) != CRYPTO_SUCCESS)
1037 ret = aes_common_init_ctx(&aes_ctx, template, mechanism, key,
1042 switch (mechanism->cm_type) {
1088 if (mechanism->cm_type == AES_CCM_MECH_INFO_TYPE) {
1095 } else if (mechanism->cm_type == AES_GCM_MECH_INFO_TYPE ||
1096 mechanism->cm_type == AES_GMAC_MECH_INFO_TYPE) {
1103 } else if (mechanism->cm_type == AES_CTR_MECH_INFO_TYPE) {
1135 crypto_session_id_t session_id, crypto_mechanism_t *mechanism,
1151 switch (mechanism->cm_type) {
1162 if ((ret = aes_check_mech_param(mechanism, NULL, 0)) != CRYPTO_SUCCESS)
1167 ret = aes_common_init_ctx(&aes_ctx, template, mechanism, key,
1172 switch (mechanism->cm_type) {
1198 if (mechanism->cm_type == AES_GCM_MECH_INFO_TYPE ||
1199 mechanism->cm_type == AES_GMAC_MECH_INFO_TYPE)
1223 if (mechanism->cm_type == AES_CCM_MECH_INFO_TYPE) {
1239 } else if (mechanism->cm_type == AES_GCM_MECH_INFO_TYPE ||
1240 mechanism->cm_type == AES_GMAC_MECH_INFO_TYPE) {
1252 } else if (mechanism->cm_type != AES_CTR_MECH_INFO_TYPE) {
1301 crypto_mechanism_t *mechanism, crypto_key_t *key,
1311 if (mechanism->cm_type != AES_ECB_MECH_INFO_TYPE &&
1312 mechanism->cm_type != AES_CBC_MECH_INFO_TYPE &&
1313 mechanism->cm_type != AES_CTR_MECH_INFO_TYPE &&
1314 mechanism->cm_type != AES_CCM_MECH_INFO_TYPE &&
1315 mechanism->cm_type != AES_GCM_MECH_INFO_TYPE &&
1316 mechanism->cm_type != AES_GMAC_MECH_INFO_TYPE)
1370 crypto_mechanism_t *mechanism, crypto_key_t *key, int kmflag,
1399 switch (mechanism->cm_type) {
1401 rv = cbc_init_ctx((cbc_ctx_t *)aes_ctx, mechanism->cm_param,
1402 mechanism->cm_param_len, AES_BLOCK_LEN, aes_copy_block64);
1407 if (mechanism->cm_param == NULL ||
1408 mechanism->cm_param_len != sizeof (CK_AES_CTR_PARAMS)) {
1411 pp = (CK_AES_CTR_PARAMS *)(void *)mechanism->cm_param;
1417 if (mechanism->cm_param == NULL ||
1418 mechanism->cm_param_len != sizeof (CK_AES_CCM_PARAMS)) {
1421 rv = ccm_init_ctx((ccm_ctx_t *)aes_ctx, mechanism->cm_param,
1426 if (mechanism->cm_param == NULL ||
1427 mechanism->cm_param_len != sizeof (CK_AES_GCM_PARAMS)) {
1430 rv = gcm_init_ctx((gcm_ctx_t *)aes_ctx, mechanism->cm_param,
1435 if (mechanism->cm_param == NULL ||
1436 mechanism->cm_param_len != sizeof (CK_AES_GMAC_PARAMS)) {
1439 rv = gmac_init_ctx((gcm_ctx_t *)aes_ctx, mechanism->cm_param,
1492 crypto_session_id_t session_id, crypto_mechanism_t *mechanism,
1500 if ((rv = process_gmac_mech(mechanism, data, &gcm_params))
1514 crypto_session_id_t session_id, crypto_mechanism_t *mechanism,
1522 if ((rv = process_gmac_mech(mechanism, data, &gcm_params))