summaryrefslogtreecommitdiff
path: root/sys/crypto
diff options
context:
space:
mode:
authorVisa Hankala <visa@cvs.openbsd.org>2018-04-09 04:34:57 +0000
committerVisa Hankala <visa@cvs.openbsd.org>2018-04-09 04:34:57 +0000
commit3586fa848c7b3df684c463a0243f9452d0317424 (patch)
treed2f40f5ef38a97a180f7c5226068e90451c77d56 /sys/crypto
parent7a9621f657ec871ffbe83307a4e7a8403aad7731 (diff)
Move some AES-related defines into xform.h to reduce duplication.
gmac.c is left untouched for now to preserve layering. OK mikeb@, deraadt@
Diffstat (limited to 'sys/crypto')
-rw-r--r--sys/crypto/xform.c10
-rw-r--r--sys/crypto/xform.h10
2 files changed, 10 insertions, 10 deletions
diff --git a/sys/crypto/xform.c b/sys/crypto/xform.c
index f94a44eab27..96db2bb699b 100644
--- a/sys/crypto/xform.c
+++ b/sys/crypto/xform.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: xform.c,v 1.58 2017/05/31 00:34:33 djm Exp $ */
+/* $OpenBSD: xform.c,v 1.59 2018/04/09 04:34:56 visa Exp $ */
/*
* The authors of this code are John Ioannidis (ji@tla.org),
* Angelos D. Keromytis (kermit@csd.uch.gr),
@@ -108,19 +108,11 @@ u_int32_t deflate_compress(u_int8_t *, u_int32_t, u_int8_t **);
u_int32_t deflate_decompress(u_int8_t *, u_int32_t, u_int8_t **);
u_int32_t lzs_dummy(u_int8_t *, u_int32_t, u_int8_t **);
-#define AESCTR_NONCESIZE 4
-#define AESCTR_IVSIZE 8
-#define AESCTR_BLOCKSIZE 16
-
struct aes_ctr_ctx {
AES_CTX ac_key;
u_int8_t ac_block[AESCTR_BLOCKSIZE];
};
-#define AES_XTS_BLOCKSIZE 16
-#define AES_XTS_IVSIZE 8
-#define AES_XTS_ALPHA 0x87 /* GF(2^128) generator polynomial */
-
struct aes_xts_ctx {
rijndael_ctx key1;
rijndael_ctx key2;
diff --git a/sys/crypto/xform.h b/sys/crypto/xform.h
index 7e3e5913dd4..41fc36ca235 100644
--- a/sys/crypto/xform.h
+++ b/sys/crypto/xform.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: xform.h,v 1.29 2017/05/02 11:44:32 mikeb Exp $ */
+/* $OpenBSD: xform.h,v 1.30 2018/04/09 04:34:56 visa Exp $ */
/*
* The author of this code is Angelos D. Keromytis (angelos@cis.upenn.edu)
@@ -30,6 +30,14 @@
#include <crypto/sha2.h>
#include <crypto/gmac.h>
+#define AESCTR_NONCESIZE 4
+#define AESCTR_IVSIZE 8
+#define AESCTR_BLOCKSIZE 16
+
+#define AES_XTS_BLOCKSIZE 16
+#define AES_XTS_IVSIZE 8
+#define AES_XTS_ALPHA 0x87 /* GF(2^128) generator polynomial */
+
/* Declarations */
struct auth_hash {
int type;