Lines Matching refs:blk

101 	unsigned char blk[EALG_MAX_BLOCK_LEN];  in swcr_encdec()  local
142 crypto_read_iv(crp, blk); in swcr_encdec()
143 exf->reinit(ctx, blk, csp->csp_ivlen); in swcr_encdec()
174 crypto_cursor_copydata(&cc_in, blksz, blk); in swcr_encdec()
175 inblk = blk; in swcr_encdec()
179 outblk = blk; in swcr_encdec()
190 if (inblk == blk) { in swcr_encdec()
198 if (outblk == blk) { in swcr_encdec()
199 crypto_cursor_copyback(&cc_out, blksz, blk); in swcr_encdec()
218 crypto_cursor_copydata(&cc_in, resid, blk); in swcr_encdec()
219 inblk = blk; in swcr_encdec()
222 outblk = blk; in swcr_encdec()
230 crypto_cursor_copyback(&cc_out, resid, blk); in swcr_encdec()
234 explicit_bzero(blk, sizeof(blk)); in swcr_encdec()
329 u_char *blk = (u_char *)s.blkbuf; in swcr_gmac() local
353 crypto_read_iv(crp, blk); in swcr_gmac()
355 axf->Reinit(&s.ctx, blk, ivlen); in swcr_gmac()
365 crypto_cursor_copydata(&cc, len, blk); in swcr_gmac()
366 inblk = blk; in swcr_gmac()
371 memset(blk, 0, blksz); in swcr_gmac()
372 crypto_cursor_copydata(&cc, resid, blk); in swcr_gmac()
373 axf->Update(&s.ctx, blk, blksz); in swcr_gmac()
377 memset(blk, 0, blksz); in swcr_gmac()
378 blkp = (uint32_t *)blk + 1; in swcr_gmac()
380 axf->Update(&s.ctx, blk, blksz); in swcr_gmac()
407 u_char *blk = (u_char *)s.blkbuf; in swcr_gcm() local
445 memset(blk, 0, blksz); in swcr_gcm()
446 memcpy(blk, (char *)crp->crp_aad + inlen, in swcr_gcm()
448 exf->update(ctx, blk, blksz); in swcr_gcm()
461 crypto_cursor_copydata(&cc_in, inlen, blk); in swcr_gcm()
462 inblk = blk; in swcr_gcm()
467 memset(blk, 0, blksz); in swcr_gcm()
468 crypto_cursor_copydata(&cc_in, resid, blk); in swcr_gcm()
469 exf->update(ctx, blk, blksz); in swcr_gcm()
490 crypto_cursor_copydata(&cc_in, blksz, blk); in swcr_gcm()
491 inblk = blk; in swcr_gcm()
497 outblk = blk; in swcr_gcm()
507 if (outblk == blk) { in swcr_gcm()
508 crypto_cursor_copyback(&cc_out, blksz, blk); in swcr_gcm()
520 if (inblk == blk) { in swcr_gcm()
529 crypto_cursor_copydata(&cc_in, resid, blk); in swcr_gcm()
531 exf->encrypt_last(ctx, blk, blk, resid); in swcr_gcm()
532 crypto_cursor_copyback(&cc_out, resid, blk); in swcr_gcm()
534 exf->update(ctx, blk, resid); in swcr_gcm()
538 memset(blk, 0, blksz); in swcr_gcm()
539 blkp = (uint32_t *)blk + 1; in swcr_gcm()
541 blkp = (uint32_t *)blk + 3; in swcr_gcm()
543 exf->update(ctx, blk, blksz); in swcr_gcm()
571 crypto_cursor_copydata(&cc_in, blksz, blk); in swcr_gcm()
572 inblk = blk; in swcr_gcm()
576 outblk = blk; in swcr_gcm()
585 if (inblk == blk) { in swcr_gcm()
593 if (outblk == blk) { in swcr_gcm()
594 crypto_cursor_copyback(&cc_out, blksz, blk); in swcr_gcm()
604 crypto_cursor_copydata(&cc_in, resid, blk); in swcr_gcm()
605 exf->decrypt_last(ctx, blk, blk, resid); in swcr_gcm()
606 crypto_cursor_copyback(&cc_out, resid, blk); in swcr_gcm()
660 build_ccm_aad_length(u_int aad_length, uint8_t *blk) in build_ccm_aad_length() argument
663 be16enc(blk, aad_length); in build_ccm_aad_length()
666 blk[0] = 0xff; in build_ccm_aad_length()
667 blk[1] = 0xfe; in build_ccm_aad_length()
668 be32enc(blk + 2, aad_length); in build_ccm_aad_length()
678 u_char blk[CCM_CBC_BLOCK_LEN]; in swcr_ccm_cbc_mac() member
705 swa->sw_mlen, s.blk); in swcr_ccm_cbc_mac()
706 axf->Update(&s.ctx, s.blk, CCM_CBC_BLOCK_LEN); in swcr_ccm_cbc_mac()
708 len = build_ccm_aad_length(crp->crp_payload_length, s.blk); in swcr_ccm_cbc_mac()
709 axf->Update(&s.ctx, s.blk, len); in swcr_ccm_cbc_mac()
741 u_char *blk = (u_char *)s.blkbuf; in swcr_ccm() local
781 crp->crp_payload_length, swa->sw_mlen, blk); in swcr_ccm()
782 exf->update(ctx, blk, CCM_CBC_BLOCK_LEN); in swcr_ccm()
786 len = build_ccm_aad_length(crp->crp_aad_length, blk); in swcr_ccm()
787 exf->update(ctx, blk, len); in swcr_ccm()
798 memset(blk, 0, CCM_CBC_BLOCK_LEN); in swcr_ccm()
799 exf->update(ctx, blk, len); in swcr_ccm()
820 crypto_cursor_copydata(&cc_in, blksz, blk); in swcr_ccm()
821 inblk = blk; in swcr_ccm()
827 outblk = blk; in swcr_ccm()
837 if (outblk == blk) { in swcr_ccm()
838 crypto_cursor_copyback(&cc_out, blksz, blk); in swcr_ccm()
855 exf->decrypt(ctx, inblk, blk); in swcr_ccm()
856 exf->update(ctx, blk, todo); in swcr_ccm()
859 if (inblk == blk) { in swcr_ccm()
868 crypto_cursor_copydata(&cc_in, resid, blk); in swcr_ccm()
870 exf->update(ctx, blk, resid); in swcr_ccm()
871 exf->encrypt_last(ctx, blk, blk, resid); in swcr_ccm()
872 crypto_cursor_copyback(&cc_out, resid, blk); in swcr_ccm()
874 exf->decrypt_last(ctx, blk, blk, resid); in swcr_ccm()
875 exf->update(ctx, blk, resid); in swcr_ccm()
908 crypto_cursor_copydata(&cc_in, blksz, blk); in swcr_ccm()
909 inblk = blk; in swcr_ccm()
913 outblk = blk; in swcr_ccm()
922 if (inblk == blk) { in swcr_ccm()
930 if (outblk == blk) { in swcr_ccm()
931 crypto_cursor_copyback(&cc_out, blksz, blk); in swcr_ccm()
941 crypto_cursor_copydata(&cc_in, resid, blk); in swcr_ccm()
942 exf->decrypt_last(ctx, blk, blk, resid); in swcr_ccm()
943 crypto_cursor_copyback(&cc_out, resid, blk); in swcr_ccm()
966 u_char *blk = (u_char *)s.blkbuf; in swcr_chacha20_poly1305() local
1005 memset(blk, 0, POLY1305_BLOCK_LEN); in swcr_chacha20_poly1305()
1006 exf->update(ctx, blk, POLY1305_BLOCK_LEN - in swcr_chacha20_poly1305()
1030 crypto_cursor_copydata(&cc_in, blksz, blk); in swcr_chacha20_poly1305()
1031 inblk = blk; in swcr_chacha20_poly1305()
1036 outblk = blk; in swcr_chacha20_poly1305()
1046 if (inblk == blk) { in swcr_chacha20_poly1305()
1054 if (outblk == blk) { in swcr_chacha20_poly1305()
1055 crypto_cursor_copyback(&cc_out, blksz, blk); in swcr_chacha20_poly1305()
1064 crypto_cursor_copydata(&cc_in, resid, blk); in swcr_chacha20_poly1305()
1065 exf->encrypt_last(ctx, blk, blk, resid); in swcr_chacha20_poly1305()
1066 crypto_cursor_copyback(&cc_out, resid, blk); in swcr_chacha20_poly1305()
1067 exf->update(ctx, blk, resid); in swcr_chacha20_poly1305()
1074 memset(blk, 0, POLY1305_BLOCK_LEN); in swcr_chacha20_poly1305()
1075 exf->update(ctx, blk, POLY1305_BLOCK_LEN - in swcr_chacha20_poly1305()
1080 blkp = (uint64_t *)blk; in swcr_chacha20_poly1305()
1083 exf->update(ctx, blk, sizeof(uint64_t) * 2); in swcr_chacha20_poly1305()
1112 crypto_cursor_copydata(&cc_in, blksz, blk); in swcr_chacha20_poly1305()
1113 inblk = blk; in swcr_chacha20_poly1305()
1117 outblk = blk; in swcr_chacha20_poly1305()
1126 if (inblk == blk) { in swcr_chacha20_poly1305()
1134 if (outblk == blk) { in swcr_chacha20_poly1305()
1135 crypto_cursor_copyback(&cc_out, blksz, blk); in swcr_chacha20_poly1305()
1145 crypto_cursor_copydata(&cc_in, resid, blk); in swcr_chacha20_poly1305()
1146 exf->decrypt_last(ctx, blk, blk, resid); in swcr_chacha20_poly1305()
1147 crypto_cursor_copyback(&cc_out, resid, blk); in swcr_chacha20_poly1305()