Lines Matching refs:mechanism

265 aes_check_mech_param(crypto_mechanism_t *mechanism, aes_ctx_t **ctx, int kmflag)
273 switch (mechanism->cm_type) {
306 if (param_required && mechanism->cm_param != NULL &&
307 mechanism->cm_param_len != param_len) {
356 aes_encrypt_init(crypto_ctx_t *ctx, crypto_mechanism_t *mechanism,
360 return (aes_common_init(ctx, mechanism, key, template, req, B_TRUE));
364 aes_decrypt_init(crypto_ctx_t *ctx, crypto_mechanism_t *mechanism,
368 return (aes_common_init(ctx, mechanism, key, template, req, B_FALSE));
377 aes_common_init(crypto_ctx_t *ctx, crypto_mechanism_t *mechanism,
393 if ((rv = aes_check_mech_param(mechanism, &aes_ctx, kmflag))
397 rv = aes_common_init_ctx(aes_ctx, template, mechanism, key, kmflag,
964 crypto_session_id_t session_id, crypto_mechanism_t *mechanism,
980 switch (mechanism->cm_type) {
992 if ((ret = aes_check_mech_param(mechanism, NULL, 0)) != CRYPTO_SUCCESS)
997 ret = aes_common_init_ctx(&aes_ctx, template, mechanism, key,
1002 switch (mechanism->cm_type) {
1051 switch (mechanism->cm_type) {
1117 crypto_session_id_t session_id, crypto_mechanism_t *mechanism,
1133 switch (mechanism->cm_type) {
1144 if ((ret = aes_check_mech_param(mechanism, NULL, 0)) != CRYPTO_SUCCESS)
1149 ret = aes_common_init_ctx(&aes_ctx, template, mechanism, key,
1154 switch (mechanism->cm_type) {
1180 if (mechanism->cm_type == AES_GCM_MECH_INFO_TYPE ||
1181 mechanism->cm_type == AES_GMAC_MECH_INFO_TYPE)
1205 switch (mechanism->cm_type) {
1282 crypto_mechanism_t *mechanism, crypto_key_t *key,
1289 if (mechanism->cm_type != AES_ECB_MECH_INFO_TYPE &&
1290 mechanism->cm_type != AES_CBC_MECH_INFO_TYPE &&
1291 mechanism->cm_type != AES_CMAC_MECH_INFO_TYPE &&
1292 mechanism->cm_type != AES_CTR_MECH_INFO_TYPE &&
1293 mechanism->cm_type != AES_CCM_MECH_INFO_TYPE &&
1294 mechanism->cm_type != AES_GCM_MECH_INFO_TYPE &&
1295 mechanism->cm_type != AES_GMAC_MECH_INFO_TYPE)
1342 crypto_mechanism_t *mechanism, crypto_key_t *key, int kmflag,
1368 switch (mechanism->cm_type) {
1370 rv = cbc_init_ctx((cbc_ctx_t *)aes_ctx, mechanism->cm_param,
1371 mechanism->cm_param_len, AES_BLOCK_LEN, aes_copy_block64);
1379 if (mechanism->cm_param == NULL ||
1380 mechanism->cm_param_len != sizeof (CK_AES_CTR_PARAMS)) {
1383 pp = (CK_AES_CTR_PARAMS *)(void *)mechanism->cm_param;
1389 if (mechanism->cm_param == NULL ||
1390 mechanism->cm_param_len != sizeof (CK_AES_CCM_PARAMS)) {
1393 rv = ccm_init_ctx((ccm_ctx_t *)aes_ctx, mechanism->cm_param,
1398 if (mechanism->cm_param == NULL ||
1399 mechanism->cm_param_len != sizeof (CK_AES_GCM_PARAMS)) {
1402 rv = gcm_init_ctx((gcm_ctx_t *)aes_ctx, mechanism->cm_param,
1407 if (mechanism->cm_param == NULL ||
1408 mechanism->cm_param_len != sizeof (CK_AES_GMAC_PARAMS)) {
1411 rv = gmac_init_ctx((gcm_ctx_t *)aes_ctx, mechanism->cm_param,
1461 aes_mac_init(crypto_ctx_t *ctx, crypto_mechanism_t *mechanism,
1465 return (aes_encrypt_init(ctx, mechanism,
1500 crypto_session_id_t session_id, crypto_mechanism_t *mechanism,
1508 if (mechanism->cm_type == AES_GMAC_MECH_INFO_TYPE) {
1509 if ((rv = process_gmac_mech(mechanism, data, &gcm_params))
1521 return (aes_encrypt_atomic(provider, session_id, mechanism,
1527 crypto_session_id_t session_id, crypto_mechanism_t *mechanism,
1537 if (mechanism->cm_type == AES_GMAC_MECH_INFO_TYPE) {
1538 if ((rv = process_gmac_mech(mechanism, data, &gcm_params))