summaryrefslogtreecommitdiff
path: root/usr/src
diff options
context:
space:
mode:
authorMark Powers <Mark.Powers@Sun.COM>2009-01-15 13:39:15 -0800
committerMark Powers <Mark.Powers@Sun.COM>2009-01-15 13:39:15 -0800
commite8c016ef6bb7e825057460cea4d904e2b90eb424 (patch)
treee7f696e758c8dc6c53ad66194f0e155b4a0cb816 /usr/src
parentda0006029e69465355313f503741ac6ebe0d513b (diff)
downloadillumos-joyent-e8c016ef6bb7e825057460cea4d904e2b90eb424.tar.gz
6773928 n2cp should support CKM_AES_GCM
Diffstat (limited to 'usr/src')
-rw-r--r--usr/src/common/crypto/modes/gcm.c4
-rw-r--r--usr/src/common/crypto/modes/modes.h4
-rw-r--r--usr/src/uts/common/crypto/core/kcf_prov_lib.c14
-rw-r--r--usr/src/uts/common/sys/crypto/common.h5
4 files changed, 11 insertions, 16 deletions
diff --git a/usr/src/common/crypto/modes/gcm.c b/usr/src/common/crypto/modes/gcm.c
index 4802d387d0..8f04f137c2 100644
--- a/usr/src/common/crypto/modes/gcm.c
+++ b/usr/src/common/crypto/modes/gcm.c
@@ -19,7 +19,7 @@
* CDDL HEADER END
*/
/*
- * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -42,7 +42,7 @@ struct aes_block {
uint64_t b;
};
-static void
+void
gcm_mul(uint64_t *x_in, uint64_t *y, uint64_t *res)
{
uint64_t R = { 0xe100000000000000ULL };
diff --git a/usr/src/common/crypto/modes/modes.h b/usr/src/common/crypto/modes/modes.h
index 86cef69343..a52b7b6507 100644
--- a/usr/src/common/crypto/modes/modes.h
+++ b/usr/src/common/crypto/modes/modes.h
@@ -19,7 +19,7 @@
* CDDL HEADER END
*/
/*
- * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -362,6 +362,8 @@ extern int gcm_init_ctx(gcm_ctx_t *, char *, size_t,
extern void calculate_ccm_mac(ccm_ctx_t *, uint8_t *,
int (*encrypt_block)(const void *, const uint8_t *, uint8_t *));
+extern void gcm_mul(uint64_t *, uint64_t *, uint64_t *);
+
extern void crypto_init_ptrs(crypto_data_t *, void **, offset_t *);
extern void crypto_get_ptrs(crypto_data_t *, void **, offset_t *,
uint8_t **, size_t *, uint8_t **, size_t);
diff --git a/usr/src/uts/common/crypto/core/kcf_prov_lib.c b/usr/src/uts/common/crypto/core/kcf_prov_lib.c
index 2c116c4ba6..47402f648e 100644
--- a/usr/src/uts/common/crypto/core/kcf_prov_lib.c
+++ b/usr/src/uts/common/crypto/core/kcf_prov_lib.c
@@ -19,12 +19,10 @@
* CDDL HEADER END
*/
/*
- * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
-
#include <sys/strsun.h>
#include <sys/systm.h>
#include <sys/sysmacros.h>
@@ -94,12 +92,9 @@ crypto_uio_data(crypto_data_t *data, uchar_t *buf, int len, cmd_type_t cmd,
buf += cur_len;
break;
case MD5_DIGEST_DATA:
- update(digest_ctx, datap, cur_len);
- break;
case SHA1_DIGEST_DATA:
- update(digest_ctx, datap, cur_len);
- break;
case SHA2_DIGEST_DATA:
+ case GHASH_DATA:
update(digest_ctx, datap, cur_len);
break;
}
@@ -177,12 +172,9 @@ crypto_mblk_data(crypto_data_t *data, uchar_t *buf, int len, cmd_type_t cmd,
buf += cur_len;
break;
case MD5_DIGEST_DATA:
- update(digest_ctx, datap, cur_len);
- break;
case SHA1_DIGEST_DATA:
- update(digest_ctx, datap, cur_len);
- break;
case SHA2_DIGEST_DATA:
+ case GHASH_DATA:
update(digest_ctx, datap, cur_len);
break;
}
diff --git a/usr/src/uts/common/sys/crypto/common.h b/usr/src/uts/common/sys/crypto/common.h
index 795d25b07c..29fa0048d8 100644
--- a/usr/src/uts/common/sys/crypto/common.h
+++ b/usr/src/uts/common/sys/crypto/common.h
@@ -19,7 +19,7 @@
* CDDL HEADER END
*/
/*
- * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -448,7 +448,8 @@ typedef enum cmd_type {
COMPARE_TO_DATA,
MD5_DIGEST_DATA,
SHA1_DIGEST_DATA,
- SHA2_DIGEST_DATA
+ SHA2_DIGEST_DATA,
+ GHASH_DATA
} cmd_type_t;
#define CRYPTO_DO_UPDATE 0x01