summaryrefslogtreecommitdiff
path: root/lib/freebl/intel-aes.h
diff options
context:
space:
mode:
authorShay Gueron <shay.gueron@intel.com>2014-04-08 19:01:48 -0700
committerShay Gueron <shay.gueron@intel.com>2014-04-08 19:01:48 -0700
commit8535b43e4cdd2ac4dfc93053052c666f1774d292 (patch)
tree91759ab81b466c39c2b77f6237a588cf05c577fe /lib/freebl/intel-aes.h
parentb6fd78e9cc5058fa37808d7478b54c37bc93d3df (diff)
downloadnss-hg-8535b43e4cdd2ac4dfc93053052c666f1774d292.tar.gz
Bug 979703: Implementation of AES in different modes of operation, using
AES-NI and PCLMULQDQ-NI, for WIN32 and WIN64 platforms. r=wtc.
Diffstat (limited to 'lib/freebl/intel-aes.h')
-rw-r--r--lib/freebl/intel-aes.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/lib/freebl/intel-aes.h b/lib/freebl/intel-aes.h
index 1e180072a..3b71e5fa6 100644
--- a/lib/freebl/intel-aes.h
+++ b/lib/freebl/intel-aes.h
@@ -33,6 +33,12 @@ SECStatus intel_aes_decrypt_cbc_128(AESContext *cx, unsigned char *output,
const unsigned char *input,
unsigned int inputLen,
unsigned int blocksize);
+SECStatus intel_aes_encrypt_ctr_128(CTRContext *cx, unsigned char *output,
+ unsigned int *outputLen,
+ unsigned int maxOutputLen,
+ const unsigned char *input,
+ unsigned int inputLen,
+ unsigned int blocksize);
SECStatus intel_aes_encrypt_ecb_192(AESContext *cx, unsigned char *output,
unsigned int *outputLen,
unsigned int maxOutputLen,
@@ -57,6 +63,12 @@ SECStatus intel_aes_decrypt_cbc_192(AESContext *cx, unsigned char *output,
const unsigned char *input,
unsigned int inputLen,
unsigned int blocksize);
+SECStatus intel_aes_encrypt_ctr_192(CTRContext *cx, unsigned char *output,
+ unsigned int *outputLen,
+ unsigned int maxOutputLen,
+ const unsigned char *input,
+ unsigned int inputLen,
+ unsigned int blocksize);
SECStatus intel_aes_encrypt_ecb_256(AESContext *cx, unsigned char *output,
unsigned int *outputLen,
unsigned int maxOutputLen,
@@ -81,6 +93,12 @@ SECStatus intel_aes_decrypt_cbc_256(AESContext *cx, unsigned char *output,
const unsigned char *input,
unsigned int inputLen,
unsigned int blocksize);
+SECStatus intel_aes_encrypt_ctr_256(CTRContext *cx, unsigned char *output,
+ unsigned int *outputLen,
+ unsigned int maxOutputLen,
+ const unsigned char *input,
+ unsigned int inputLen,
+ unsigned int blocksize);
#define intel_aes_ecb_worker(encrypt, keysize) \
@@ -102,6 +120,11 @@ SECStatus intel_aes_decrypt_cbc_256(AESContext *cx, unsigned char *output,
(keysize) == 24 ? intel_aes_decrypt_cbc_192 : \
intel_aes_decrypt_cbc_256))
+#define intel_aes_ctr_worker(nr) \
+ ((nr) == 10 ? intel_aes_encrypt_ctr_128 : \
+ (nr) == 12 ? intel_aes_encrypt_ctr_192 : \
+ intel_aes_encrypt_ctr_256)
+
#define intel_aes_init(encrypt, keysize) \
do { \