summaryrefslogtreecommitdiffstats
path: root/sys/opencrypto/cryptodev.h
diff options
context:
space:
mode:
authorRenato Botelho <renato@netgate.com>2015-08-17 13:53:21 -0300
committerRenato Botelho <renato@netgate.com>2015-08-17 13:53:21 -0300
commit46e99a8858f1c843c1774e472c11d422ca2163ae (patch)
tree485743dc4862158e7bb3b19eccf8f9b54fb8927b /sys/opencrypto/cryptodev.h
parentfb8160d0fb248c35e8bc74d67dcca6c22e974db3 (diff)
downloadFreeBSD-src-46e99a8858f1c843c1774e472c11d422ca2163ae.zip
FreeBSD-src-46e99a8858f1c843c1774e472c11d422ca2163ae.tar.gz
Importing pfSense patch aesgcm.soft.1.patch
Diffstat (limited to 'sys/opencrypto/cryptodev.h')
-rw-r--r--sys/opencrypto/cryptodev.h31
1 files changed, 28 insertions, 3 deletions
diff --git a/sys/opencrypto/cryptodev.h b/sys/opencrypto/cryptodev.h
index e299522..1476235 100644
--- a/sys/opencrypto/cryptodev.h
+++ b/sys/opencrypto/cryptodev.h
@@ -72,6 +72,7 @@
#define SHA2_512_HASH_LEN 64
#define MD5_KPDK_HASH_LEN 16
#define SHA1_KPDK_HASH_LEN 20
+#define AES_GMAC_HASH_LEN 16
/* Maximum hash algorithm result length */
#define HASH_MAX_LEN SHA2_512_HASH_LEN /* Keep this updated */
@@ -100,6 +101,17 @@
#define CAMELLIA_BLOCK_LEN 16
#define EALG_MAX_BLOCK_LEN AES_BLOCK_LEN /* Keep this updated */
+/* Maximum hash algorithm result length */
+#define AALG_MAX_RESULT_LEN 64 /* Keep this updated */
+
+#define AESCTR_NONCESIZE 4
+#define AESCTR_IVSIZE 8
+#define AESCTR_BLOCKSIZE AES_BLOCK_LEN
+
+#define AES_XTS_BLOCKSIZE AES_BLOCK_LEN
+#define AES_XTS_IVSIZE 8
+#define AES_XTS_ALPHA 0x87 /* GF(2^128) generator polynomial */
+
#define CRYPTO_ALGORITHM_MIN 1
#define CRYPTO_DES_CBC 1
#define CRYPTO_3DES_CBC 2
@@ -122,9 +134,15 @@
#define CRYPTO_SHA2_256_HMAC 18
#define CRYPTO_SHA2_384_HMAC 19
#define CRYPTO_SHA2_512_HMAC 20
-#define CRYPTO_CAMELLIA_CBC 21
+#define CRYPTO_CAMELLIA_CBC 21
#define CRYPTO_AES_XTS 22
-#define CRYPTO_ALGORITHM_MAX 22 /* Keep updated - see below */
+#define CRYPTO_AES_CTR 23
+#define CRYPTO_AES_RFC4106_GCM_16 24
+#define CRYPTO_AES_128_GMAC 25
+#define CRYPTO_AES_192_GMAC 26
+#define CRYPTO_AES_256_GMAC 27
+#define CRYPTO_AES_GMAC 28
+#define CRYPTO_ALGORITHM_MAX 28 /* Keep updated - see below */
/* Algorithm flags */
#define CRYPTO_ALG_FLAG_SUPPORTED 0x01 /* Algorithm is supported */
@@ -276,7 +294,12 @@ struct cryptoini {
int cri_mlen; /* Number of bytes we want from the
entire hash. 0 means all. */
caddr_t cri_key; /* key to use */
- u_int8_t cri_iv[EALG_MAX_BLOCK_LEN]; /* IV to use */
+ union {
+ u_int8_t iv[EALG_MAX_BLOCK_LEN]; /* IV to use */
+ u_int8_t esn[4]; /* high-order ESN */
+ } u;
+#define cri_iv u.iv
+#define cri_esn u.esn
struct cryptoini *cri_next;
};
@@ -294,8 +317,10 @@ struct cryptodesc {
#define CRD_F_DSA_SHA_NEEDED 0x08 /* Compute SHA-1 of buffer for DSA */
#define CRD_F_KEY_EXPLICIT 0x10 /* Key explicitly provided */
#define CRD_F_COMP 0x0f /* Set when doing compression */
+#define CRD_F_ESN 0x20 /* Set when doing compression */
struct cryptoini CRD_INI; /* Initialization/context data */
+#define crd_esn CRD_INI.cri_esn
#define crd_iv CRD_INI.cri_iv
#define crd_key CRD_INI.cri_key
#define crd_alg CRD_INI.cri_alg
OpenPOWER on IntegriCloud