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

Function crypto_buffer_contiguous_subsegment

freebsd/opencrypto/criov.c:738–763  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

736}
737
738void *
739crypto_buffer_contiguous_subsegment(struct crypto_buffer *cb, size_t skip,
740 size_t len)
741{
742
743 switch (cb->cb_type) {
744 case CRYPTO_BUF_MBUF:
745 return (m_contiguous_subsegment(cb->cb_mbuf, skip, len));
746 case CRYPTO_BUF_UIO:
747 return (cuio_contiguous_segment(cb->cb_uio, skip, len));
748#if CRYPTO_MAY_HAVE_VMPAGE
749 case CRYPTO_BUF_VMPAGE:
750 MPASS(skip + len <= cb->cb_vm_page_len);
751 return (cvm_page_contiguous_segment(cb->cb_vm_page,
752 skip + cb->cb_vm_page_offset, len));
753#endif /* CRYPTO_MAY_HAVE_VMPAGE */
754 case CRYPTO_BUF_CONTIG:
755 MPASS(skip + len <= cb->cb_buf_len);
756 return (cb->cb_buf + skip);
757 default:
758#ifdef INVARIANTS
759 panic("invalid crp buf type %d", cb->cb_type);
760#endif
761 return (NULL);
762 }
763}
764
765void *
766crypto_contiguous_subsegment(struct cryptop *crp, size_t skip, size_t len)

Callers 3

aesni_cipher_cryptFunction · 0.85

Calls 4

m_contiguous_subsegmentFunction · 0.85
cuio_contiguous_segmentFunction · 0.85
panicFunction · 0.50

Tested by

no test coverage detected