Lines Matching refs:mechanism

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