summaryrefslogtreecommitdiffstats
path: root/sys/opencrypto/cryptodev.h
diff options
context:
space:
mode:
authorLuiz Otavio O Souza <luiz@netgate.com>2015-09-15 17:17:09 -0500
committerLuiz Otavio O Souza <luiz@netgate.com>2015-10-20 12:08:50 -0500
commit746fef67f99420a94493e5b5e2aba2d4d76f006d (patch)
tree6ec5b15f43c2f9920792bb8b854393d4231c383e /sys/opencrypto/cryptodev.h
parent01e681694febecdcbc55fd8e8218c5dfc645df03 (diff)
downloadFreeBSD-src-746fef67f99420a94493e5b5e2aba2d4d76f006d.zip
FreeBSD-src-746fef67f99420a94493e5b5e2aba2d4d76f006d.tar.gz
MFC r285526:
Fix XTS, and name things a bit better... Though confusing, GCM using ICM_BLOCK_LEN, but ICM does not is correct... GCM is built on ICM, but uses a function other than swcr_encdec... swcr_encdec cannot handle partial blocks which is why it must still use AES_BLOCK_LEN and is why XTS was broken by the commit... Thanks to the tests for helping sure I didn't break GCM w/ an earlier patch... I did run the tests w/o this patch, and need to figure out why they did not fail, clearly more tests are needed... Prodded by: peter TAG: IPSEC-HEAD Issue: #4841
Diffstat (limited to 'sys/opencrypto/cryptodev.h')
-rw-r--r--sys/opencrypto/cryptodev.h14
1 files changed, 6 insertions, 8 deletions
diff --git a/sys/opencrypto/cryptodev.h b/sys/opencrypto/cryptodev.h
index 48f094b..5aa450f 100644
--- a/sys/opencrypto/cryptodev.h
+++ b/sys/opencrypto/cryptodev.h
@@ -115,7 +115,7 @@
#define CAST128_BLOCK_LEN 8
#define RIJNDAEL128_BLOCK_LEN 16
#define AES_BLOCK_LEN 16
-#define AES_MIN_BLOCK_LEN 1
+#define AES_ICM_BLOCK_LEN 1
#define ARC4_BLOCK_LEN 1
#define CAMELLIA_BLOCK_LEN 16
#define EALG_MAX_BLOCK_LEN AES_BLOCK_LEN /* Keep this updated */
@@ -123,12 +123,10 @@
/* IV Lengths */
#define ARC4_IV_LEN 1
-#define AES_IV_LEN 12
+#define AES_GCM_IV_LEN 12
#define AES_XTS_IV_LEN 8
#define AES_XTS_ALPHA 0x87 /* GF(2^128) generator polynomial */
-#define AES_CTR_NONCE_SIZE 4
-
/* Min and Max Encryption Key Sizes */
#define NULL_MIN_KEY 0
#define NULL_MAX_KEY 256 /* 2048 bits, max key */
@@ -144,10 +142,10 @@
#define SKIPJACK_MAX_KEY SKIPJACK_MIN_KEY
#define RIJNDAEL_MIN_KEY 16
#define RIJNDAEL_MAX_KEY 32
-#define AES_MIN_KEY 16
-#define AES_MAX_KEY 32
-#define AES_XTS_MIN_KEY 32
-#define AES_XTS_MAX_KEY 64
+#define AES_MIN_KEY RIJNDAEL_MIN_KEY
+#define AES_MAX_KEY RIJNDAEL_MAX_KEY
+#define AES_XTS_MIN_KEY (2 * AES_MIN_KEY)
+#define AES_XTS_MAX_KEY (2 * AES_MAX_KEY)
#define ARC4_MIN_KEY 1
#define ARC4_MAX_KEY 32
#define CAMELLIA_MIN_KEY 8
OpenPOWER on IntegriCloud