summaryrefslogtreecommitdiff
path: root/sys/crypto/crypto.h
diff options
context:
space:
mode:
authorAngelos D. Keromytis <angelos@cvs.openbsd.org>2000-03-29 07:09:41 +0000
committerAngelos D. Keromytis <angelos@cvs.openbsd.org>2000-03-29 07:09:41 +0000
commit752a9d8c0fcd62a795487324b9bfac61d9a9c1ba (patch)
tree785750cf764a84864468b31280ee0cccd981e7bc /sys/crypto/crypto.h
parent779e7a3c87357423090824f0eea9612c35595fc7 (diff)
Better support for weird IV schemes (like ESP half-IV, or the swap
encryption block-number IV).
Diffstat (limited to 'sys/crypto/crypto.h')
-rw-r--r--sys/crypto/crypto.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/sys/crypto/crypto.h b/sys/crypto/crypto.h
index ef11a18ec3e..f4515fb6abb 100644
--- a/sys/crypto/crypto.h
+++ b/sys/crypto/crypto.h
@@ -66,6 +66,7 @@ struct cryptoini
int cri_klen; /* Key length, in bits */
int cri_rnd; /* Algorithm rounds, where relevant */
caddr_t cri_key; /* key to use */
+ u_int8_t cri_iv[EALG_MAX_BLOCK_LEN]; /* IV to use */
struct cryptoini *cri_next;
};
@@ -78,10 +79,12 @@ struct cryptodesc
int crd_flags;
#define CRD_F_ENCRYPT 0x1 /* Set when doing encryption */
-#define CRD_F_HALFIV 0x2
-#define CRD_F_IV_PRESENT 0x4 /* Used/sensible only when encrypting */
+#define CRD_F_IV_PRESENT 0x2 /* When encrypting, IV is already in
+ place, so don't copy. */
+#define CRD_F_IV_EXPLICIT 0x4 /* IV explicitly provided */
struct cryptoini CRD_INI; /* Initialization/context data */
+#define crd_iv CRD_INI.cri_iv
#define crd_key CRD_INI.cri_key
#define crd_rnd CRD_INI.cri_rnd
#define crd_alg CRD_INI.cri_alg