diff options
author | da73024 <none@none> | 2008-03-25 15:07:40 -0700 |
---|---|---|
committer | da73024 <none@none> | 2008-03-25 15:07:40 -0700 |
commit | 55553f719b521a0bb4deab6efc944cd30c1a56aa (patch) | |
tree | 1c40bfe9e0af4809ba87a34398c7676083c723f8 /usr/src/uts | |
parent | f1ec5ace8ce99c499004da59c01f4c02ac312ad7 (diff) | |
download | illumos-joyent-55553f719b521a0bb4deab6efc944cd30c1a56aa.tar.gz |
6652716 Need an ARCFOUR implementation optimized for Intel EM64T
6658907 digest(1) and mac(1) could benefit from being 64-bit programs
6665607 Need a SHA256/SHA384/SHA512 implementation optimized for 64-bit x86
--HG--
rename : usr/src/common/crypto/arcfour/amd64/arcfour_crypt_amd64.s => deleted_files/usr/src/common/crypto/arcfour/amd64/arcfour_crypt_amd64.s
Diffstat (limited to 'usr/src/uts')
-rw-r--r-- | usr/src/uts/common/sys/crypto/common.h | 11 | ||||
-rw-r--r-- | usr/src/uts/common/sys/sha2.h | 4 | ||||
-rw-r--r-- | usr/src/uts/intel/arcfour/Makefile | 13 | ||||
-rwxr-xr-x | usr/src/uts/intel/sha2/Makefile | 23 |
4 files changed, 35 insertions, 16 deletions
diff --git a/usr/src/uts/common/sys/crypto/common.h b/usr/src/uts/common/sys/crypto/common.h index 2a0be4eb93..9e309d457f 100644 --- a/usr/src/uts/common/sys/crypto/common.h +++ b/usr/src/uts/common/sys/crypto/common.h @@ -187,15 +187,14 @@ typedef uint32_t crypto_keysize_unit_t; #define SUN_CKM_ECDSA "CKM_ECDSA" /* Shared operation context format for CKM_RC4 */ +typedef struct { #if defined(__amd64) -typedef uint64_t arcfour_key_int_t; + uint32_t i, j; + uint32_t arr[256]; #else -typedef uchar_t arcfour_key_int_t; + uchar_t arr[256]; + uchar_t i, j; #endif /* __amd64 */ - -typedef struct { - arcfour_key_int_t arr[256]; - arcfour_key_int_t i, j; uint64_t pad; /* For 64-bit alignment */ } arcfour_state_t; diff --git a/usr/src/uts/common/sys/sha2.h b/usr/src/uts/common/sys/sha2.h index f057a602de..ed2829c94b 100644 --- a/usr/src/uts/common/sys/sha2.h +++ b/usr/src/uts/common/sys/sha2.h @@ -19,7 +19,7 @@ * CDDL HEADER END */ /* - * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Copyright 2008 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -59,7 +59,7 @@ extern "C" { * The contents of this structure are a private interface between the * Init/Update/Final calls of the functions defined below. * Callers must never attempt to read or write any of the fields - * in this strucutre directly. + * in this structure directly. */ typedef struct { uint32_t algotype; /* Algorithm Type */ diff --git a/usr/src/uts/intel/arcfour/Makefile b/usr/src/uts/intel/arcfour/Makefile index 15bd43c85e..b8ab3a70dc 100644 --- a/usr/src/uts/intel/arcfour/Makefile +++ b/usr/src/uts/intel/arcfour/Makefile @@ -41,7 +41,7 @@ COM_DIR = $(COMMONBASE)/crypto/arcfour MODULE = arcfour LINTS = $(ARCFOURPROV_OBJS:%.o=$(LINTS_DIR)/%.ln) ARCFOURPROV_OBJS_32 = -ARCFOURPROV_OBJS_64 = arcfour_crypt_amd64.o +ARCFOURPROV_OBJS_64 = arcfour-x86_64.o ARCFOURPROV_OBJS += $(ARCFOURPROV_OBJS_$(CLASS)) OBJECTS = $(ARCFOURPROV_OBJS:%=$(OBJS_DIR)/%) ROOTMODULE = $(ROOT_CRYPTO_DIR)/$(MODULE) @@ -65,6 +65,7 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) # Overrides # CPPFLAGS += -I$(COM_DIR) +CLEANFILES += arcfour-x86_64.s # # For now, disable these lint checks; maintainers should endeavor @@ -99,10 +100,12 @@ install: $(INSTALL_DEPS) # include $(UTSBASE)/intel/Makefile.targ -$(OBJS_DIR)/arcfour_crypt_amd64.o: $(COM_DIR)/amd64/arcfour_crypt_amd64.s - $(COMPILE.s) -o $@ $(COM_DIR)/amd64/arcfour_crypt_amd64.s +$(OBJS_DIR)/arcfour-x86_64.o: arcfour-x86_64.s + $(COMPILE.s) -o $@ ${@F:.o=.s} $(POST_PROCESS_O) -$(OBJS_DIR)/arcfour_crypt_amd64.ln: $(COM_DIR)/amd64/arcfour_crypt_amd64.s - @($(LHEAD) $(LINT.c) $(COM_DIR)/amd64/arcfour_crypt_amd64.s $(LTAIL)) +$(OBJS_DIR)/arcfour-x86_64.ln: arcfour-x86_64.s + @($(LHEAD) $(LINT.s) ${@F:.ln=.s} $(LTAIL)) +arcfour-x86_64.s: $(COM_DIR)/amd64/arcfour-x86_64.pl + $(PERL) $? $@ diff --git a/usr/src/uts/intel/sha2/Makefile b/usr/src/uts/intel/sha2/Makefile index 2198e60c7a..eb1fff8c37 100755 --- a/usr/src/uts/intel/sha2/Makefile +++ b/usr/src/uts/intel/sha2/Makefile @@ -19,7 +19,7 @@ # CDDL HEADER END # # -# Copyright 2006 Sun Microsystems, Inc. All rights reserved. +# Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # #ident "%Z%%M% %I% %E% SMI" @@ -33,13 +33,17 @@ # Path to the base of the uts directory tree (usually /usr/src/uts). # UTSBASE = ../.. +COMDIR = $(COMMONBASE)/crypto/sha2 # # Define the module and object file sets. # MODULE = sha2 -OBJECTS = $(SHA2_OBJS:%=$(OBJS_DIR)/%) LINTS = $(SHA2_OBJS:%.o=$(LINTS_DIR)/%.ln) +SHA2_OBJS_32 = +SHA2_OBJS_64 = sha512-x86_64.o sha256-x86_64.o +SHA2_OBJS += $(SHA2_OBJS_$(CLASS)) +OBJECTS = $(SHA2_OBJS:%=$(OBJS_DIR)/%) ROOTMODULE = $(ROOT_CRYPTO_DIR)/$(MODULE) ROOTLINK = $(ROOT_MISC_DIR)/$(MODULE) @@ -51,7 +55,7 @@ include $(UTSBASE)/intel/Makefile.intel # # Override defaults # - +CLEANFILES += sha512-x86_64.s sha256-x86_64.s # # Define targets @@ -98,3 +102,16 @@ $(ROOTLINK): $(ROOT_MISC_DIR) $(ROOTMODULE) # Include common targets. # include $(UTSBASE)/intel/Makefile.targ + +$(OBJS_DIR)/%.o: %.s + $(COMPILE.s) -o $@ ${@F:.o=.s} + $(POST_PROCESS_O) + +$(OBJS_DIR)/%.ln: %.s + @($(LHEAD) $(LINT.c) ${@F:.ln=.s} $(LTAIL)) + +sha512-x86_64.s: $(COMDIR)/amd64/sha512-x86_64.pl + $(PERL) $? $@ + +sha256-x86_64.s: $(COMDIR)/amd64/sha512-x86_64.pl + $(PERL) $? $@ |