Lines Matching refs:blk

100 	unsigned char blk[EALG_MAX_BLOCK_LEN];  in swcr_encdec()  local
141 crypto_read_iv(crp, blk); in swcr_encdec()
142 exf->reinit(ctx, blk, csp->csp_ivlen); in swcr_encdec()
173 crypto_cursor_copydata(&cc_in, blksz, blk); in swcr_encdec()
174 inblk = blk; in swcr_encdec()
178 outblk = blk; in swcr_encdec()
189 if (inblk == blk) { in swcr_encdec()
197 if (outblk == blk) { in swcr_encdec()
198 crypto_cursor_copyback(&cc_out, blksz, blk); in swcr_encdec()
217 crypto_cursor_copydata(&cc_in, resid, blk); in swcr_encdec()
218 inblk = blk; in swcr_encdec()
221 outblk = blk; in swcr_encdec()
229 crypto_cursor_copyback(&cc_out, resid, blk); in swcr_encdec()
233 explicit_bzero(blk, sizeof(blk)); in swcr_encdec()
328 u_char *blk = (u_char *)s.blkbuf; in swcr_gmac() local
352 crypto_read_iv(crp, blk); in swcr_gmac()
354 axf->Reinit(&s.ctx, blk, ivlen); in swcr_gmac()
364 crypto_cursor_copydata(&cc, len, blk); in swcr_gmac()
365 inblk = blk; in swcr_gmac()
370 memset(blk, 0, blksz); in swcr_gmac()
371 crypto_cursor_copydata(&cc, resid, blk); in swcr_gmac()
372 axf->Update(&s.ctx, blk, blksz); in swcr_gmac()
376 memset(blk, 0, blksz); in swcr_gmac()
377 blkp = (uint32_t *)blk + 1; in swcr_gmac()
379 axf->Update(&s.ctx, blk, blksz); in swcr_gmac()
406 u_char *blk = (u_char *)s.blkbuf; in swcr_gcm() local
444 memset(blk, 0, blksz); in swcr_gcm()
445 memcpy(blk, (char *)crp->crp_aad + inlen, in swcr_gcm()
447 exf->update(ctx, blk, blksz); in swcr_gcm()
460 crypto_cursor_copydata(&cc_in, inlen, blk); in swcr_gcm()
461 inblk = blk; in swcr_gcm()
466 memset(blk, 0, blksz); in swcr_gcm()
467 crypto_cursor_copydata(&cc_in, resid, blk); in swcr_gcm()
468 exf->update(ctx, blk, blksz); in swcr_gcm()
489 crypto_cursor_copydata(&cc_in, blksz, blk); in swcr_gcm()
490 inblk = blk; in swcr_gcm()
496 outblk = blk; in swcr_gcm()
506 if (outblk == blk) { in swcr_gcm()
507 crypto_cursor_copyback(&cc_out, blksz, blk); in swcr_gcm()
519 if (inblk == blk) { in swcr_gcm()
528 crypto_cursor_copydata(&cc_in, resid, blk); in swcr_gcm()
530 exf->encrypt_last(ctx, blk, blk, resid); in swcr_gcm()
531 crypto_cursor_copyback(&cc_out, resid, blk); in swcr_gcm()
533 exf->update(ctx, blk, resid); in swcr_gcm()
537 memset(blk, 0, blksz); in swcr_gcm()
538 blkp = (uint32_t *)blk + 1; in swcr_gcm()
540 blkp = (uint32_t *)blk + 3; in swcr_gcm()
542 exf->update(ctx, blk, blksz); in swcr_gcm()
570 crypto_cursor_copydata(&cc_in, blksz, blk); in swcr_gcm()
571 inblk = blk; in swcr_gcm()
575 outblk = blk; in swcr_gcm()
584 if (inblk == blk) { in swcr_gcm()
592 if (outblk == blk) { in swcr_gcm()
593 crypto_cursor_copyback(&cc_out, blksz, blk); in swcr_gcm()
603 crypto_cursor_copydata(&cc_in, resid, blk); in swcr_gcm()
604 exf->decrypt_last(ctx, blk, blk, resid); in swcr_gcm()
605 crypto_cursor_copyback(&cc_out, resid, blk); in swcr_gcm()
659 build_ccm_aad_length(u_int aad_length, uint8_t *blk) in build_ccm_aad_length() argument
662 be16enc(blk, aad_length); in build_ccm_aad_length()
665 blk[0] = 0xff; in build_ccm_aad_length()
666 blk[1] = 0xfe; in build_ccm_aad_length()
667 be32enc(blk + 2, aad_length); in build_ccm_aad_length()
677 u_char blk[CCM_CBC_BLOCK_LEN]; in swcr_ccm_cbc_mac() member
704 swa->sw_mlen, s.blk); in swcr_ccm_cbc_mac()
705 axf->Update(&s.ctx, s.blk, CCM_CBC_BLOCK_LEN); in swcr_ccm_cbc_mac()
707 len = build_ccm_aad_length(crp->crp_payload_length, s.blk); in swcr_ccm_cbc_mac()
708 axf->Update(&s.ctx, s.blk, len); in swcr_ccm_cbc_mac()
740 u_char *blk = (u_char *)s.blkbuf; in swcr_ccm() local
780 crp->crp_payload_length, swa->sw_mlen, blk); in swcr_ccm()
781 exf->update(ctx, blk, CCM_CBC_BLOCK_LEN); in swcr_ccm()
785 len = build_ccm_aad_length(crp->crp_aad_length, blk); in swcr_ccm()
786 exf->update(ctx, blk, len); in swcr_ccm()
797 memset(blk, 0, CCM_CBC_BLOCK_LEN); in swcr_ccm()
798 exf->update(ctx, blk, len); in swcr_ccm()
819 crypto_cursor_copydata(&cc_in, blksz, blk); in swcr_ccm()
820 inblk = blk; in swcr_ccm()
826 outblk = blk; in swcr_ccm()
836 if (outblk == blk) { in swcr_ccm()
837 crypto_cursor_copyback(&cc_out, blksz, blk); in swcr_ccm()
854 exf->decrypt(ctx, inblk, blk); in swcr_ccm()
855 exf->update(ctx, blk, todo); in swcr_ccm()
858 if (inblk == blk) { in swcr_ccm()
867 crypto_cursor_copydata(&cc_in, resid, blk); in swcr_ccm()
869 exf->update(ctx, blk, resid); in swcr_ccm()
870 exf->encrypt_last(ctx, blk, blk, resid); in swcr_ccm()
871 crypto_cursor_copyback(&cc_out, resid, blk); in swcr_ccm()
873 exf->decrypt_last(ctx, blk, blk, resid); in swcr_ccm()
874 exf->update(ctx, blk, resid); in swcr_ccm()
907 crypto_cursor_copydata(&cc_in, blksz, blk); in swcr_ccm()
908 inblk = blk; in swcr_ccm()
912 outblk = blk; in swcr_ccm()
921 if (inblk == blk) { in swcr_ccm()
929 if (outblk == blk) { in swcr_ccm()
930 crypto_cursor_copyback(&cc_out, blksz, blk); in swcr_ccm()
940 crypto_cursor_copydata(&cc_in, resid, blk); in swcr_ccm()
941 exf->decrypt_last(ctx, blk, blk, resid); in swcr_ccm()
942 crypto_cursor_copyback(&cc_out, resid, blk); in swcr_ccm()
965 u_char *blk = (u_char *)s.blkbuf; in swcr_chacha20_poly1305() local
1004 memset(blk, 0, POLY1305_BLOCK_LEN); in swcr_chacha20_poly1305()
1005 exf->update(ctx, blk, POLY1305_BLOCK_LEN - in swcr_chacha20_poly1305()
1029 crypto_cursor_copydata(&cc_in, blksz, blk); in swcr_chacha20_poly1305()
1030 inblk = blk; in swcr_chacha20_poly1305()
1035 outblk = blk; in swcr_chacha20_poly1305()
1045 if (inblk == blk) { in swcr_chacha20_poly1305()
1053 if (outblk == blk) { in swcr_chacha20_poly1305()
1054 crypto_cursor_copyback(&cc_out, blksz, blk); in swcr_chacha20_poly1305()
1063 crypto_cursor_copydata(&cc_in, resid, blk); in swcr_chacha20_poly1305()
1064 exf->encrypt_last(ctx, blk, blk, resid); in swcr_chacha20_poly1305()
1065 crypto_cursor_copyback(&cc_out, resid, blk); in swcr_chacha20_poly1305()
1066 exf->update(ctx, blk, resid); in swcr_chacha20_poly1305()
1073 memset(blk, 0, POLY1305_BLOCK_LEN); in swcr_chacha20_poly1305()
1074 exf->update(ctx, blk, POLY1305_BLOCK_LEN - in swcr_chacha20_poly1305()
1079 blkp = (uint64_t *)blk; in swcr_chacha20_poly1305()
1082 exf->update(ctx, blk, sizeof(uint64_t) * 2); in swcr_chacha20_poly1305()
1111 crypto_cursor_copydata(&cc_in, blksz, blk); in swcr_chacha20_poly1305()
1112 inblk = blk; in swcr_chacha20_poly1305()
1116 outblk = blk; in swcr_chacha20_poly1305()
1125 if (inblk == blk) { in swcr_chacha20_poly1305()
1133 if (outblk == blk) { in swcr_chacha20_poly1305()
1134 crypto_cursor_copyback(&cc_out, blksz, blk); in swcr_chacha20_poly1305()
1144 crypto_cursor_copydata(&cc_in, resid, blk); in swcr_chacha20_poly1305()
1145 exf->decrypt_last(ctx, blk, blk, resid); in swcr_chacha20_poly1305()
1146 crypto_cursor_copyback(&cc_out, resid, blk); in swcr_chacha20_poly1305()