Lines Matching refs:sw

84 swcr_encdec(struct cryptodesc *crd, struct swcr_data *sw, caddr_t buf,
99 exf = sw->sw_exf;
136 if (sw->sw_kschedule)
137 exf->zerokey(&(sw->sw_kschedule));
139 error = exf->setkey(&sw->sw_kschedule,
172 exf->reinit(sw->sw_kschedule, iv);
196 exf->encrypt(sw->sw_kschedule,
199 exf->decrypt(sw->sw_kschedule,
207 exf->encrypt(sw->sw_kschedule, blk);
223 exf->decrypt(sw->sw_kschedule, blk);
261 exf->encrypt(sw->sw_kschedule,
264 exf->decrypt(sw->sw_kschedule,
272 exf->encrypt(sw->sw_kschedule, idat);
282 exf->decrypt(sw->sw_kschedule, idat);
321 swcr_authprepare(struct auth_hash *axf, struct swcr_data *sw, u_char *key,
339 axf->Init(sw->sw_ictx);
340 axf->Update(sw->sw_ictx, key, klen);
341 axf->Update(sw->sw_ictx, hmac_ipad_buffer, axf->blocksize - klen);
346 axf->Init(sw->sw_octx);
347 axf->Update(sw->sw_octx, key, klen);
348 axf->Update(sw->sw_octx, hmac_opad_buffer, axf->blocksize - klen);
368 sw->sw_klen = klen;
369 bcopy(key, sw->sw_octx, klen);
370 axf->Init(sw->sw_ictx);
371 axf->Update(sw->sw_ictx, key, klen);
372 axf->Final(buf, sw->sw_ictx);
385 swcr_authcompute(struct cryptodesc *crd, struct swcr_data *sw, caddr_t buf,
393 if (sw->sw_ictx == 0)
396 axf = sw->sw_axf;
399 swcr_authprepare(axf, sw, crd->crd_key, crd->crd_klen);
401 bcopy(sw->sw_ictx, &ctx, axf->ctxsize);
408 switch (sw->sw_alg) {
415 if (sw->sw_octx == NULL)
419 bcopy(sw->sw_octx, &ctx, axf->ctxsize);
427 if (sw->sw_octx == NULL)
437 axf->Update(&ctx, sw->sw_octx, sw->sw_klen);
448 sw->sw_mlen == 0 ? axf->hashsize : sw->sw_mlen, aalg);
468 struct swcr_data *sw, *swa, *swe = NULL;
478 for (sw = swcr_sessions[crp->crp_sid & 0xffffffff];
479 sw && sw->sw_alg != crd->crd_alg;
480 sw = sw->sw_next)
482 if (sw == NULL)
485 switch (sw->sw_alg) {
488 swe = sw;
496 swa = sw;
631 swcr_compdec(struct cryptodesc *crd, struct swcr_data *sw,
639 cxf = sw->sw_cxf;
663 sw->sw_size = result;
1083 struct swcr_data *sw;
1123 for (sw = swcr_sessions[lid];
1124 sw && sw->sw_alg != crd->crd_alg;
1125 sw = sw->sw_next)
1130 if (sw == NULL) {
1134 switch (sw->sw_alg) {
1144 if ((crp->crp_etype = swcr_encdec(crd, sw,
1162 if ((crp->crp_etype = swcr_authcompute(crd, sw,
1176 if ((crp->crp_etype = swcr_compdec(crd, sw,
1180 crp->crp_olen = (int)sw->sw_size;