MCPcopy Create free account
hub / github.com/F-Stack/f-stack / crypto_apply_buf

Function crypto_apply_buf

freebsd/opencrypto/criov.c:661–693  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

659}
660
661int
662crypto_apply_buf(struct crypto_buffer *cb, int off, int len,
663 int (*f)(void *, const void *, u_int), void *arg)
664{
665 int error;
666
667 switch (cb->cb_type) {
668 case CRYPTO_BUF_MBUF:
669 error = m_apply(cb->cb_mbuf, off, len,
670 (int (*)(void *, void *, u_int))f, arg);
671 break;
672 case CRYPTO_BUF_UIO:
673 error = cuio_apply(cb->cb_uio, off, len, f, arg);
674 break;
675#if CRYPTO_MAY_HAVE_VMPAGE
676 case CRYPTO_BUF_VMPAGE:
677 error = cvm_page_apply(cb->cb_vm_page,
678 off + cb->cb_vm_page_offset, len, f, arg);
679 break;
680#endif /* CRYPTO_MAY_HAVE_VMPAGE */
681 case CRYPTO_BUF_CONTIG:
682 MPASS(off + len <= cb->cb_buf_len);
683 error = (*f)(arg, cb->cb_buf + off, len);
684 break;
685 default:
686#ifdef INVARIANTS
687 panic("invalid crypto buf type %d", cb->cb_type);
688#endif
689 error = 0;
690 break;
691 }
692 return (error);
693}
694
695int
696crypto_apply(struct cryptop *crp, int off, int len,

Callers 3

aesni_cipher_macFunction · 0.85
swcr_authcomputeFunction · 0.85
crypto_applyFunction · 0.85

Calls 4

m_applyFunction · 0.85
cuio_applyFunction · 0.85
cvm_page_applyFunction · 0.85
panicFunction · 0.50

Tested by

no test coverage detected