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

Function crypto_cursor_init

freebsd/opencrypto/criov.c:242–270  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

240#endif /* CRYPTO_MAY_HAVE_VMPAGE */
241
242void
243crypto_cursor_init(struct crypto_buffer_cursor *cc,
244 const struct crypto_buffer *cb)
245{
246 memset(cc, 0, sizeof(*cc));
247 cc->cc_type = cb->cb_type;
248 switch (cc->cc_type) {
249 case CRYPTO_BUF_CONTIG:
250 cc->cc_buf = cb->cb_buf;
251 cc->cc_buf_len = cb->cb_buf_len;
252 break;
253 case CRYPTO_BUF_MBUF:
254 cc->cc_mbuf = cb->cb_mbuf;
255 break;
256 case CRYPTO_BUF_VMPAGE:
257 cc->cc_vmpage = cb->cb_vm_page;
258 cc->cc_buf_len = cb->cb_vm_page_len;
259 cc->cc_offset = cb->cb_vm_page_offset;
260 break;
261 case CRYPTO_BUF_UIO:
262 cc->cc_iov = cb->cb_uio->uio_iov;
263 break;
264 default:
265#ifdef INVARIANTS
266 panic("%s: invalid buffer type %d", __func__, cb->cb_type);
267#endif
268 break;
269 }
270}
271
272SDT_PROBE_DEFINE2(opencrypto, criov, cursor_advance, vmpage, "struct crypto_buffer_cursor*", "size_t");
273

Callers 4

swcr_encdecFunction · 0.85
swcr_gmacFunction · 0.85
swcr_gcmFunction · 0.85
swcr_ccmFunction · 0.85

Calls 2

memsetFunction · 0.85
panicFunction · 0.50

Tested by

no test coverage detected