cryptodev.h (c03414326909ed7a740be3ba63fbbef01fe513a8) cryptodev.h (29fe41ddd714bae92a09fd4098fad614945bedf5)
1/* $FreeBSD$ */
2/* $OpenBSD: cryptodev.h,v 1.31 2002/06/11 11:14:29 beck Exp $ */
3
4/*-
5 * The author of this code is Angelos D. Keromytis (angelos@cis.upenn.edu)
6 * Copyright (c) 2002-2006 Sam Leffler, Errno Consulting
7 *
8 * This code was written by Angelos D. Keromytis in Athens, Greece, in

--- 440 unchanged lines hidden (view full) ---

449 * if op is synchronous
450 */
451#define CRYPTO_F_ASYNC_KEEPORDER 0x0100 /*
452 * Dispatch the crypto jobs in the same
453 * order there are submitted. Applied only
454 * if CRYPTO_F_ASYNC flags is set
455 */
456#define CRYPTO_F_IV_SEPARATE 0x0200 /* Use crp_iv[] as IV. */
1/* $FreeBSD$ */
2/* $OpenBSD: cryptodev.h,v 1.31 2002/06/11 11:14:29 beck Exp $ */
3
4/*-
5 * The author of this code is Angelos D. Keromytis (angelos@cis.upenn.edu)
6 * Copyright (c) 2002-2006 Sam Leffler, Errno Consulting
7 *
8 * This code was written by Angelos D. Keromytis in Athens, Greece, in

--- 440 unchanged lines hidden (view full) ---

449 * if op is synchronous
450 */
451#define CRYPTO_F_ASYNC_KEEPORDER 0x0100 /*
452 * Dispatch the crypto jobs in the same
453 * order there are submitted. Applied only
454 * if CRYPTO_F_ASYNC flags is set
455 */
456#define CRYPTO_F_IV_SEPARATE 0x0200 /* Use crp_iv[] as IV. */
457#define CRYPTO_F_IV_GENERATE 0x0400 /* Generate a random IV and store. */
458
459 int crp_op;
460
461 union {
462 caddr_t crp_buf; /* Data to be processed */
463 struct mbuf *crp_mbuf;
464 struct uio *crp_uio;
465 };

--- 140 unchanged lines hidden (view full) ---

606void crypto_copyback(struct cryptop *crp, int off, int size,
607 const void *src);
608void crypto_copydata(struct cryptop *crp, int off, int size, void *dst);
609int crypto_apply(struct cryptop *crp, int off, int len,
610 int (*f)(void *, void *, u_int), void *arg);
611void *crypto_contiguous_subsegment(struct cryptop *crp, size_t skip,
612 size_t len);
613
457
458 int crp_op;
459
460 union {
461 caddr_t crp_buf; /* Data to be processed */
462 struct mbuf *crp_mbuf;
463 struct uio *crp_uio;
464 };

--- 140 unchanged lines hidden (view full) ---

605void crypto_copyback(struct cryptop *crp, int off, int size,
606 const void *src);
607void crypto_copydata(struct cryptop *crp, int off, int size, void *dst);
608int crypto_apply(struct cryptop *crp, int off, int len,
609 int (*f)(void *, void *, u_int), void *arg);
610void *crypto_contiguous_subsegment(struct cryptop *crp, size_t skip,
611 size_t len);
612
613static __inline void
614crypto_read_iv(struct cryptop *crp, void *iv)
615{
616 const struct crypto_session_params *csp;
617
618 csp = crypto_get_params(crp->crp_session);
619 if (crp->crp_flags & CRYPTO_F_IV_SEPARATE)
620 memcpy(iv, crp->crp_iv, csp->csp_ivlen);
621 else
622 crypto_copydata(crp, crp->crp_iv_start, csp->csp_ivlen, iv);
623}
624
614#endif /* _KERNEL */
615#endif /* _CRYPTO_CRYPTO_H_ */
625#endif /* _KERNEL */
626#endif /* _CRYPTO_CRYPTO_H_ */