• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /freebsd-13-stable/sys/opencrypto/

Lines Matching refs:csp

105 	const struct crypto_session_params *csp;
135 csp = crypto_get_params(crp->crp_session);
137 crp->crp_cipher_key, csp->csp_cipher_klen);
320 const struct crypto_session_params *csp;
330 csp = crypto_get_params(crp->crp_session);
333 csp->csp_auth_klen);
357 if (csp->csp_flags & CSP_F_ESN)
977 const struct crypto_session_params *csp)
984 txf = crypto_cipher(csp);
985 MPASS(txf->ivsize == csp->csp_ivlen);
992 if (csp->csp_cipher_key != NULL) {
994 csp->csp_cipher_key, csp->csp_cipher_klen);
1004 const struct crypto_session_params *csp)
1011 axf = crypto_auth_hash(csp);
1013 if (csp->csp_auth_mlen < 0 || csp->csp_auth_mlen > axf->hashsize)
1015 if (csp->csp_auth_mlen == 0)
1018 swa->sw_mlen = csp->csp_auth_mlen;
1023 switch (csp->csp_auth_alg) {
1036 if (csp->csp_auth_key != NULL) {
1037 swcr_authprepare(axf, swa, csp->csp_auth_key,
1038 csp->csp_auth_klen);
1041 if (csp->csp_mode == CSP_MODE_DIGEST)
1050 if (csp->csp_mode == CSP_MODE_DIGEST)
1055 axf->Setkey(swa->sw_ictx, csp->csp_auth_key,
1056 csp->csp_auth_klen);
1057 if (csp->csp_mode == CSP_MODE_DIGEST)
1067 if (csp->csp_auth_klen == 0 || csp->csp_auth_key != NULL)
1068 axf->Setkey(swa->sw_ictx, csp->csp_auth_key,
1069 csp->csp_auth_klen);
1071 if (csp->csp_mode == CSP_MODE_DIGEST)
1076 axf->Setkey(swa->sw_ictx, csp->csp_auth_key,
1077 csp->csp_auth_klen);
1078 if (csp->csp_mode == CSP_MODE_DIGEST)
1088 const struct crypto_session_params *csp)
1093 if (csp->csp_ivlen != AES_GCM_IV_LEN)
1098 switch (csp->csp_cipher_klen * 8) {
1112 if (csp->csp_auth_mlen < 0 || csp->csp_auth_mlen > axf->hashsize)
1114 if (csp->csp_auth_mlen == 0)
1117 swa->sw_mlen = csp->csp_auth_mlen;
1122 if (csp->csp_cipher_key != NULL)
1123 axf->Setkey(swa->sw_ictx, csp->csp_cipher_key,
1124 csp->csp_cipher_klen);
1127 return (swcr_setup_cipher(ses, csp));
1132 const struct crypto_session_params *csp)
1137 if (csp->csp_ivlen != AES_CCM_IV_LEN)
1142 switch (csp->csp_cipher_klen * 8) {
1156 if (csp->csp_auth_mlen < 0 || csp->csp_auth_mlen > axf->hashsize)
1158 if (csp->csp_auth_mlen == 0)
1161 swa->sw_mlen = csp->csp_auth_mlen;
1166 if (csp->csp_cipher_key != NULL)
1167 axf->Setkey(swa->sw_ictx, csp->csp_cipher_key,
1168 csp->csp_cipher_klen);
1171 return (swcr_setup_cipher(ses, csp));
1175 swcr_auth_supported(const struct crypto_session_params *csp)
1179 axf = crypto_auth_hash(csp);
1182 switch (csp->csp_auth_alg) {
1192 switch (csp->csp_auth_klen * 8) {
1200 if (csp->csp_auth_key == NULL)
1202 if (csp->csp_ivlen != AES_GCM_IV_LEN)
1206 if (csp->csp_auth_klen != POLY1305_KEY_LEN)
1210 switch (csp->csp_auth_klen * 8) {
1218 if (csp->csp_auth_key == NULL)
1220 if (csp->csp_ivlen != AES_CCM_IV_LEN)
1228 swcr_cipher_supported(const struct crypto_session_params *csp)
1232 txf = crypto_cipher(csp);
1235 if (csp->csp_cipher_alg != CRYPTO_NULL_CBC &&
1236 txf->ivsize != csp->csp_ivlen)
1244 swcr_probesession(device_t dev, const struct crypto_session_params *csp)
1246 if ((csp->csp_flags & ~(SUPPORTED_SES)) != 0)
1248 switch (csp->csp_mode) {
1250 switch (csp->csp_cipher_alg) {
1258 switch (csp->csp_cipher_alg) {
1263 if (!swcr_cipher_supported(csp))
1269 if (!swcr_auth_supported(csp))
1273 switch (csp->csp_cipher_alg) {
1283 switch (csp->csp_cipher_alg) {
1288 switch (csp->csp_auth_alg) {
1294 if (!swcr_cipher_supported(csp) ||
1295 !swcr_auth_supported(csp))
1310 const struct crypto_session_params *csp)
1324 switch (csp->csp_mode) {
1326 switch (csp->csp_cipher_alg) {
1339 switch (csp->csp_cipher_alg) {
1349 error = swcr_setup_cipher(ses, csp);
1355 error = swcr_setup_auth(ses, csp);
1358 switch (csp->csp_cipher_alg) {
1360 error = swcr_setup_gcm(ses, csp);
1365 error = swcr_setup_ccm(ses, csp);
1377 switch (csp->csp_cipher_alg) {
1382 switch (csp->csp_auth_alg) {
1389 error = swcr_setup_auth(ses, csp);
1392 if (csp->csp_cipher_alg == CRYPTO_NULL_CBC) {
1398 error = swcr_setup_cipher(ses, csp);