Lines Matching refs:csp
101 const struct crypto_session_params *csp; in swcr_encdec() local
117 csp = crypto_get_params(crp->crp_session); in swcr_encdec()
135 csp->csp_cipher_klen); in swcr_encdec()
142 exf->reinit(ctx, blk, csp->csp_ivlen); in swcr_encdec()
248 const struct crypto_session_params *csp; in swcr_authcompute() local
257 csp = crypto_get_params(crp->crp_session); in swcr_authcompute()
261 csp->csp_auth_klen, &s.ctx); in swcr_authcompute()
265 csp->csp_auth_klen); in swcr_authcompute()
289 if (csp->csp_flags & CSP_F_ESN) in swcr_authcompute()
296 csp->csp_auth_klen, &s.ctx); in swcr_authcompute()
681 const struct crypto_session_params *csp; in swcr_ccm_cbc_mac() local
686 csp = crypto_get_params(crp->crp_session); in swcr_ccm_cbc_mac()
692 axf->Setkey(&s.ctx, crp->crp_auth_key, csp->csp_auth_klen); in swcr_ccm_cbc_mac()
697 ivlen = csp->csp_ivlen; in swcr_ccm_cbc_mac()
734 const struct crypto_session_params *csp; in swcr_ccm() local
752 csp = crypto_get_params(crp->crp_session); in swcr_ccm()
760 if (crp->crp_payload_length > ccm_max_payload_length(csp)) in swcr_ccm()
766 ivlen = csp->csp_ivlen; in swcr_ccm()
959 const struct crypto_session_params *csp; in swcr_chacha20_poly1305() local
986 csp = crypto_get_params(crp->crp_session); in swcr_chacha20_poly1305()
991 csp->csp_cipher_klen); in swcr_chacha20_poly1305()
994 exf->reinit(ctx, crp->crp_iv, csp->csp_ivlen); in swcr_chacha20_poly1305()
1268 const struct crypto_session_params *csp) in swcr_setup_cipher() argument
1275 txf = crypto_cipher(csp); in swcr_setup_cipher()
1276 if (csp->csp_cipher_key != NULL) { in swcr_setup_cipher()
1284 csp->csp_cipher_key, csp->csp_cipher_klen); in swcr_setup_cipher()
1294 const struct crypto_session_params *csp) in swcr_setup_auth() argument
1301 axf = crypto_auth_hash(csp); in swcr_setup_auth()
1303 if (csp->csp_auth_mlen < 0 || csp->csp_auth_mlen > axf->hashsize) in swcr_setup_auth()
1305 if (csp->csp_auth_mlen == 0) in swcr_setup_auth()
1308 swa->sw_mlen = csp->csp_auth_mlen; in swcr_setup_auth()
1309 if (csp->csp_auth_klen == 0 || csp->csp_auth_key != NULL) { in swcr_setup_auth()
1316 switch (csp->csp_auth_alg) { in swcr_setup_auth()
1324 if (csp->csp_auth_key != NULL) { in swcr_setup_auth()
1329 hmac_init_ipad(axf, csp->csp_auth_key, in swcr_setup_auth()
1330 csp->csp_auth_klen, swa->sw_ictx); in swcr_setup_auth()
1331 hmac_init_opad(axf, csp->csp_auth_key, in swcr_setup_auth()
1332 csp->csp_auth_klen, swa->sw_octx); in swcr_setup_auth()
1347 if (csp->csp_auth_key != NULL) { in swcr_setup_auth()
1349 axf->Setkey(swa->sw_ictx, csp->csp_auth_key, in swcr_setup_auth()
1350 csp->csp_auth_klen); in swcr_setup_auth()
1359 if (csp->csp_auth_klen == 0) in swcr_setup_auth()
1361 else if (csp->csp_auth_key != NULL) in swcr_setup_auth()
1362 axf->Setkey(swa->sw_ictx, csp->csp_auth_key, in swcr_setup_auth()
1363 csp->csp_auth_klen); in swcr_setup_auth()
1367 if (csp->csp_mode == CSP_MODE_DIGEST) { in swcr_setup_auth()
1368 switch (csp->csp_auth_alg) { in swcr_setup_auth()
1385 const struct crypto_session_params *csp) in swcr_setup_aead() argument
1390 error = swcr_setup_cipher(ses, csp); in swcr_setup_aead()
1395 if (csp->csp_auth_mlen == 0) in swcr_setup_aead()
1398 swa->sw_mlen = csp->csp_auth_mlen; in swcr_setup_aead()
1403 swcr_auth_supported(const struct crypto_session_params *csp) in swcr_auth_supported() argument
1407 axf = crypto_auth_hash(csp); in swcr_auth_supported()
1410 switch (csp->csp_auth_alg) { in swcr_auth_supported()
1420 switch (csp->csp_auth_klen * 8) { in swcr_auth_supported()
1428 if (csp->csp_auth_key == NULL) in swcr_auth_supported()
1430 if (csp->csp_ivlen != AES_GCM_IV_LEN) in swcr_auth_supported()
1434 if (csp->csp_auth_klen != POLY1305_KEY_LEN) in swcr_auth_supported()
1438 switch (csp->csp_auth_klen * 8) { in swcr_auth_supported()
1446 if (csp->csp_auth_key == NULL) in swcr_auth_supported()
1454 swcr_cipher_supported(const struct crypto_session_params *csp) in swcr_cipher_supported() argument
1458 txf = crypto_cipher(csp); in swcr_cipher_supported()
1461 if (csp->csp_cipher_alg != CRYPTO_NULL_CBC && in swcr_cipher_supported()
1462 txf->ivsize != csp->csp_ivlen) in swcr_cipher_supported()
1470 swcr_probesession(device_t dev, const struct crypto_session_params *csp) in swcr_probesession() argument
1472 if ((csp->csp_flags & ~(SUPPORTED_SES)) != 0) in swcr_probesession()
1474 switch (csp->csp_mode) { in swcr_probesession()
1476 switch (csp->csp_cipher_alg) { in swcr_probesession()
1484 switch (csp->csp_cipher_alg) { in swcr_probesession()
1491 if (!swcr_cipher_supported(csp)) in swcr_probesession()
1497 if (!swcr_auth_supported(csp)) in swcr_probesession()
1501 switch (csp->csp_cipher_alg) { in swcr_probesession()
1504 switch (csp->csp_cipher_klen * 8) { in swcr_probesession()
1522 switch (csp->csp_cipher_alg) { in swcr_probesession()
1529 switch (csp->csp_auth_alg) { in swcr_probesession()
1535 if (!swcr_cipher_supported(csp) || in swcr_probesession()
1536 !swcr_auth_supported(csp)) in swcr_probesession()
1551 const struct crypto_session_params *csp) in swcr_newsession() argument
1560 switch (csp->csp_mode) { in swcr_newsession()
1562 switch (csp->csp_cipher_alg) { in swcr_newsession()
1575 switch (csp->csp_cipher_alg) { in swcr_newsession()
1587 error = swcr_setup_cipher(ses, csp); in swcr_newsession()
1593 error = swcr_setup_auth(ses, csp); in swcr_newsession()
1596 switch (csp->csp_cipher_alg) { in swcr_newsession()
1598 error = swcr_setup_aead(ses, csp); in swcr_newsession()
1603 error = swcr_setup_aead(ses, csp); in swcr_newsession()
1609 error = swcr_setup_aead(ses, csp); in swcr_newsession()
1621 switch (csp->csp_cipher_alg) { in swcr_newsession()
1628 switch (csp->csp_auth_alg) { in swcr_newsession()
1635 error = swcr_setup_auth(ses, csp); in swcr_newsession()
1638 if (csp->csp_cipher_alg == CRYPTO_NULL_CBC) { in swcr_newsession()
1644 error = swcr_setup_cipher(ses, csp); in swcr_newsession()