Lines Matching refs:exf

102 	const struct enc_xform *exf;  in swcr_encdec()  local
116 exf = sw->sw_exf; in swcr_encdec()
119 if (exf->native_blocksize == 0) { in swcr_encdec()
121 if ((crp->crp_payload_length % exf->blocksize) != 0) in swcr_encdec()
124 blksz = exf->blocksize; in swcr_encdec()
126 blksz = exf->native_blocksize; in swcr_encdec()
128 if (exf == &enc_xform_aes_icm && in swcr_encdec()
132 ctx = __builtin_alloca(exf->ctxsize); in swcr_encdec()
134 error = exf->setkey(ctx, crp->crp_cipher_key, in swcr_encdec()
139 memcpy(ctx, sw->sw_ctx, exf->ctxsize); in swcr_encdec()
142 exf->reinit(ctx, blk, csp->csp_ivlen); in swcr_encdec()
185 exf->encrypt_multi(ctx, inblk, outblk, todo); in swcr_encdec()
187 exf->decrypt_multi(ctx, inblk, outblk, todo); in swcr_encdec()
209 KASSERT(exf->native_blocksize != 0, in swcr_encdec()
211 __func__, resid, exf->name)); in swcr_encdec()
223 exf->encrypt_last(ctx, inblk, outblk, in swcr_encdec()
226 exf->decrypt_last(ctx, inblk, outblk, in swcr_encdec()
232 explicit_bzero(ctx, exf->ctxsize); in swcr_encdec()
413 const struct enc_xform *exf; in swcr_gcm() local
420 exf = swe->sw_exf; in swcr_gcm()
422 KASSERT(blksz == exf->native_blocksize, in swcr_gcm()
430 ctx = __builtin_alloca(exf->ctxsize); in swcr_gcm()
432 exf->setkey(ctx, crp->crp_cipher_key, in swcr_gcm()
435 memcpy(ctx, swe->sw_ctx, exf->ctxsize); in swcr_gcm()
436 exf->reinit(ctx, crp->crp_iv, ivlen); in swcr_gcm()
442 exf->update(ctx, crp->crp_aad, inlen); in swcr_gcm()
447 exf->update(ctx, blk, blksz); in swcr_gcm()
463 exf->update(ctx, inblk, inlen); in swcr_gcm()
468 exf->update(ctx, blk, blksz); in swcr_gcm()
503 exf->encrypt_multi(ctx, inblk, outblk, todo); in swcr_gcm()
504 exf->update(ctx, outblk, todo); in swcr_gcm()
516 exf->update(ctx, inblk, todo); in swcr_gcm()
530 exf->encrypt_last(ctx, blk, blk, resid); in swcr_gcm()
533 exf->update(ctx, blk, resid); in swcr_gcm()
542 exf->update(ctx, blk, blksz); in swcr_gcm()
545 exf->final(s.tag, ctx); in swcr_gcm()
582 exf->decrypt_multi(ctx, inblk, outblk, todo); in swcr_gcm()
604 exf->decrypt_last(ctx, blk, blk, resid); in swcr_gcm()
614 explicit_bzero(ctx, exf->ctxsize); in swcr_gcm()
747 const struct enc_xform *exf; in swcr_ccm() local
755 exf = swe->sw_exf; in swcr_ccm()
757 KASSERT(blksz == exf->native_blocksize, in swcr_ccm()
768 ctx = __builtin_alloca(exf->ctxsize); in swcr_ccm()
770 exf->setkey(ctx, crp->crp_cipher_key, in swcr_ccm()
773 memcpy(ctx, swe->sw_ctx, exf->ctxsize); in swcr_ccm()
774 exf->reinit(ctx, crp->crp_iv, ivlen); in swcr_ccm()
781 exf->update(ctx, blk, CCM_CBC_BLOCK_LEN); in swcr_ccm()
786 exf->update(ctx, blk, len); in swcr_ccm()
788 exf->update(ctx, crp->crp_aad, crp->crp_aad_length); in swcr_ccm()
791 crp->crp_aad_length, exf->update, ctx); in swcr_ccm()
798 exf->update(ctx, blk, len); in swcr_ccm()
833 exf->update(ctx, inblk, todo); in swcr_ccm()
834 exf->encrypt_multi(ctx, inblk, outblk, todo); in swcr_ccm()
854 exf->decrypt(ctx, inblk, blk); in swcr_ccm()
855 exf->update(ctx, blk, todo); in swcr_ccm()
869 exf->update(ctx, blk, resid); in swcr_ccm()
870 exf->encrypt_last(ctx, blk, blk, resid); in swcr_ccm()
873 exf->decrypt_last(ctx, blk, blk, resid); in swcr_ccm()
874 exf->update(ctx, blk, resid); in swcr_ccm()
879 exf->final(s.tag, ctx); in swcr_ccm()
893 exf->reinit(ctx, crp->crp_iv, ivlen); in swcr_ccm()
919 exf->decrypt_multi(ctx, inblk, outblk, todo); in swcr_ccm()
941 exf->decrypt_last(ctx, blk, blk, resid); in swcr_ccm()
951 explicit_bzero(ctx, exf->ctxsize); in swcr_ccm()
973 const struct enc_xform *exf; in swcr_chacha20_poly1305() local
979 exf = swe->sw_exf; in swcr_chacha20_poly1305()
980 blksz = exf->native_blocksize; in swcr_chacha20_poly1305()
988 ctx = __builtin_alloca(exf->ctxsize); in swcr_chacha20_poly1305()
990 exf->setkey(ctx, crp->crp_cipher_key, in swcr_chacha20_poly1305()
993 memcpy(ctx, swe->sw_ctx, exf->ctxsize); in swcr_chacha20_poly1305()
994 exf->reinit(ctx, crp->crp_iv, csp->csp_ivlen); in swcr_chacha20_poly1305()
998 exf->update(ctx, crp->crp_aad, crp->crp_aad_length); in swcr_chacha20_poly1305()
1001 exf->update, ctx); in swcr_chacha20_poly1305()
1005 exf->update(ctx, blk, POLY1305_BLOCK_LEN - in swcr_chacha20_poly1305()
1042 exf->encrypt_multi(ctx, inblk, outblk, todo); in swcr_chacha20_poly1305()
1043 exf->update(ctx, outblk, todo); in swcr_chacha20_poly1305()
1064 exf->encrypt_last(ctx, blk, blk, resid); in swcr_chacha20_poly1305()
1066 exf->update(ctx, blk, resid); in swcr_chacha20_poly1305()
1070 crp->crp_payload_length, exf->update, ctx); in swcr_chacha20_poly1305()
1074 exf->update(ctx, blk, POLY1305_BLOCK_LEN - in swcr_chacha20_poly1305()
1082 exf->update(ctx, blk, sizeof(uint64_t) * 2); in swcr_chacha20_poly1305()
1085 exf->final(s.tag, ctx); in swcr_chacha20_poly1305()
1123 exf->decrypt_multi(ctx, inblk, outblk, todo); in swcr_chacha20_poly1305()
1145 exf->decrypt_last(ctx, blk, blk, resid); in swcr_chacha20_poly1305()
1155 explicit_bzero(ctx, exf->ctxsize); in swcr_chacha20_poly1305()