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

Function crypto_cursor_seglen

freebsd/opencrypto/criov.c:364–384  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

362}
363
364size_t
365crypto_cursor_seglen(struct crypto_buffer_cursor *cc)
366{
367 switch (cc->cc_type) {
368 case CRYPTO_BUF_CONTIG:
369 return (cc->cc_buf_len);
370 case CRYPTO_BUF_VMPAGE:
371 return (PAGE_SIZE - cc->cc_offset);
372 case CRYPTO_BUF_MBUF:
373 if (cc->cc_mbuf == NULL)
374 return (0);
375 return (cc->cc_mbuf->m_len - cc->cc_offset);
376 case CRYPTO_BUF_UIO:
377 return (cc->cc_iov->iov_len - cc->cc_offset);
378 default:
379#ifdef INVARIANTS
380 panic("%s: invalid buffer type %d", __func__, cc->cc_type);
381#endif
382 return (0);
383 }
384}
385
386void
387crypto_cursor_copyback(struct crypto_buffer_cursor *cc, int size,

Callers 4

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

Calls 1

panicFunction · 0.50

Tested by

no test coverage detected