12.07.2015 Views

INTRO (9) NetBSD Kernel Developer's Manual INTRO (9) NAME ...

INTRO (9) NetBSD Kernel Developer's Manual INTRO (9) NAME ...

INTRO (9) NetBSD Kernel Developer's Manual INTRO (9) NAME ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

OPENCRYPTO(9) <strong>NetBSD</strong> <strong>Kernel</strong> Developer’s <strong>Manual</strong> OPENCRYPTO(9)};struct cryptoini∗cri_next;struct cryptodesc {intcrd_skip;intcrd_len;intcrd_inject;intcrd_flags;struct cryptoini CRD_INI;struct cryptodesc ∗crd_next;};struct cryptop {TAILQ_ENTRY(cryptop) crp_next;u_int64_tcrp_sid;intcrp_ilen;intcrp_olen;intcrp_etype;intcrp_flags;void∗crp_buf;void∗crp_opaque;struct cryptodesc ∗crp_desc;int(∗crp_callback)(struct cryptop ∗);void∗crp_mac;};struct crparam {voidu_int};∗crp_p;crp_nbits;#define CRK_MAXPARAM 8struct cryptkop {TAILQ_ENTRY(cryptkop) krp_next;u_int krp_op; /∗ ie. CRK_MOD_EXP or other ∗/u_int krp_status; /∗ return status ∗/u_short krp_iparams; /∗ # of input parameters ∗/u_short krp_oparams; /∗ # of output parameters ∗/u_int32_tkrp_hid;struct crparam krp_param[CRK_MAXPARAM]; /∗ kvm ∗/int(∗krp_callback)(struct cryptkop ∗);};DESCRIPTIONopencrypto is a framework for drivers of cryptographic hardware to register with the kernel so“consumers” (other kernel subsystems, and eventually users through an appropriate device) are able to makeuse of it. Drivers register with the framework the algorithms they support, and provide entry points (functions)the framework may call to establish, use, and tear down sessions. Sessions are used to cache cryptographicinformation in a particular driver (or associated hardware), so initialization is not needed with everyrequest. Consumers of cryptographic services pass a set of descriptors that instruct the framework (and thedrivers registered with it) of the operations that should be applied on the data (more than one cryptographic<strong>NetBSD</strong> 3.0 December 20, 2003 2

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!