Lines Matching refs:csp
102 const struct crypto_session_params *csp; in swcr_encdec() local
118 csp = crypto_get_params(crp->crp_session); in swcr_encdec()
136 csp->csp_cipher_klen); in swcr_encdec()
143 exf->reinit(ctx, blk, csp->csp_ivlen); in swcr_encdec()
249 const struct crypto_session_params *csp; in swcr_authcompute() local
258 csp = crypto_get_params(crp->crp_session); in swcr_authcompute()
262 csp->csp_auth_klen, &s.ctx); in swcr_authcompute()
266 csp->csp_auth_klen); in swcr_authcompute()
290 if (csp->csp_flags & CSP_F_ESN) in swcr_authcompute()
297 csp->csp_auth_klen, &s.ctx); in swcr_authcompute()
682 const struct crypto_session_params *csp; in swcr_ccm_cbc_mac() local
687 csp = crypto_get_params(crp->crp_session); in swcr_ccm_cbc_mac()
693 axf->Setkey(&s.ctx, crp->crp_auth_key, csp->csp_auth_klen); in swcr_ccm_cbc_mac()
698 ivlen = csp->csp_ivlen; in swcr_ccm_cbc_mac()
735 const struct crypto_session_params *csp; in swcr_ccm() local
753 csp = crypto_get_params(crp->crp_session); in swcr_ccm()
761 if (crp->crp_payload_length > ccm_max_payload_length(csp)) in swcr_ccm()
767 ivlen = csp->csp_ivlen; in swcr_ccm()
960 const struct crypto_session_params *csp; in swcr_chacha20_poly1305() local
987 csp = crypto_get_params(crp->crp_session); in swcr_chacha20_poly1305()
992 csp->csp_cipher_klen); in swcr_chacha20_poly1305()
995 exf->reinit(ctx, crp->crp_iv, csp->csp_ivlen); in swcr_chacha20_poly1305()
1269 const struct crypto_session_params *csp) in swcr_setup_cipher() argument
1276 txf = crypto_cipher(csp); in swcr_setup_cipher()
1277 if (csp->csp_cipher_key != NULL) { in swcr_setup_cipher()
1285 csp->csp_cipher_key, csp->csp_cipher_klen); in swcr_setup_cipher()
1295 const struct crypto_session_params *csp) in swcr_setup_auth() argument
1302 axf = crypto_auth_hash(csp); in swcr_setup_auth()
1304 if (csp->csp_auth_mlen < 0 || csp->csp_auth_mlen > axf->hashsize) in swcr_setup_auth()
1306 if (csp->csp_auth_mlen == 0) in swcr_setup_auth()
1309 swa->sw_mlen = csp->csp_auth_mlen; in swcr_setup_auth()
1310 if (csp->csp_auth_klen == 0 || csp->csp_auth_key != NULL) { in swcr_setup_auth()
1317 switch (csp->csp_auth_alg) { in swcr_setup_auth()
1325 if (csp->csp_auth_key != NULL) { in swcr_setup_auth()
1330 hmac_init_ipad(axf, csp->csp_auth_key, in swcr_setup_auth()
1331 csp->csp_auth_klen, swa->sw_ictx); in swcr_setup_auth()
1332 hmac_init_opad(axf, csp->csp_auth_key, in swcr_setup_auth()
1333 csp->csp_auth_klen, swa->sw_octx); in swcr_setup_auth()
1348 if (csp->csp_auth_key != NULL) { in swcr_setup_auth()
1350 axf->Setkey(swa->sw_ictx, csp->csp_auth_key, in swcr_setup_auth()
1351 csp->csp_auth_klen); in swcr_setup_auth()
1360 if (csp->csp_auth_klen == 0) in swcr_setup_auth()
1362 else if (csp->csp_auth_key != NULL) in swcr_setup_auth()
1363 axf->Setkey(swa->sw_ictx, csp->csp_auth_key, in swcr_setup_auth()
1364 csp->csp_auth_klen); in swcr_setup_auth()
1368 if (csp->csp_mode == CSP_MODE_DIGEST) { in swcr_setup_auth()
1369 switch (csp->csp_auth_alg) { in swcr_setup_auth()
1386 const struct crypto_session_params *csp) in swcr_setup_aead() argument
1391 error = swcr_setup_cipher(ses, csp); in swcr_setup_aead()
1396 if (csp->csp_auth_mlen == 0) in swcr_setup_aead()
1399 swa->sw_mlen = csp->csp_auth_mlen; in swcr_setup_aead()
1404 swcr_auth_supported(const struct crypto_session_params *csp) in swcr_auth_supported() argument
1408 axf = crypto_auth_hash(csp); in swcr_auth_supported()
1411 switch (csp->csp_auth_alg) { in swcr_auth_supported()
1421 switch (csp->csp_auth_klen * 8) { in swcr_auth_supported()
1429 if (csp->csp_auth_key == NULL) in swcr_auth_supported()
1431 if (csp->csp_ivlen != AES_GCM_IV_LEN) in swcr_auth_supported()
1435 if (csp->csp_auth_klen != POLY1305_KEY_LEN) in swcr_auth_supported()
1439 switch (csp->csp_auth_klen * 8) { in swcr_auth_supported()
1447 if (csp->csp_auth_key == NULL) in swcr_auth_supported()
1455 swcr_cipher_supported(const struct crypto_session_params *csp) in swcr_cipher_supported() argument
1459 txf = crypto_cipher(csp); in swcr_cipher_supported()
1462 if (csp->csp_cipher_alg != CRYPTO_NULL_CBC && in swcr_cipher_supported()
1463 txf->ivsize != csp->csp_ivlen) in swcr_cipher_supported()
1471 swcr_probesession(device_t dev, const struct crypto_session_params *csp) in swcr_probesession() argument
1473 if ((csp->csp_flags & ~(SUPPORTED_SES)) != 0) in swcr_probesession()
1475 switch (csp->csp_mode) { in swcr_probesession()
1477 switch (csp->csp_cipher_alg) { in swcr_probesession()
1485 switch (csp->csp_cipher_alg) { in swcr_probesession()
1492 if (!swcr_cipher_supported(csp)) in swcr_probesession()
1498 if (!swcr_auth_supported(csp)) in swcr_probesession()
1502 switch (csp->csp_cipher_alg) { in swcr_probesession()
1505 switch (csp->csp_cipher_klen * 8) { in swcr_probesession()
1523 switch (csp->csp_cipher_alg) { in swcr_probesession()
1530 switch (csp->csp_auth_alg) { in swcr_probesession()
1536 if (!swcr_cipher_supported(csp) || in swcr_probesession()
1537 !swcr_auth_supported(csp)) in swcr_probesession()
1552 const struct crypto_session_params *csp) in swcr_newsession() argument
1561 switch (csp->csp_mode) { in swcr_newsession()
1563 switch (csp->csp_cipher_alg) { in swcr_newsession()
1576 switch (csp->csp_cipher_alg) { in swcr_newsession()
1588 error = swcr_setup_cipher(ses, csp); in swcr_newsession()
1594 error = swcr_setup_auth(ses, csp); in swcr_newsession()
1597 switch (csp->csp_cipher_alg) { in swcr_newsession()
1599 error = swcr_setup_aead(ses, csp); in swcr_newsession()
1604 error = swcr_setup_aead(ses, csp); in swcr_newsession()
1610 error = swcr_setup_aead(ses, csp); in swcr_newsession()
1622 switch (csp->csp_cipher_alg) { in swcr_newsession()
1629 switch (csp->csp_auth_alg) { in swcr_newsession()
1636 error = swcr_setup_auth(ses, csp); in swcr_newsession()
1639 if (csp->csp_cipher_alg == CRYPTO_NULL_CBC) { in swcr_newsession()
1645 error = swcr_setup_cipher(ses, csp); in swcr_newsession()