Print this page
first pass
*** 81,92 ****
* of "Add support to Intel AES-NI instruction set for x86_64 platform".
*
* This OpenSolaris version has these major changes from the original source:
*
* 1. Added OpenSolaris ENTRY_NP/SET_SIZE macros from
! * /usr/include/sys/asm_linkage.h, lint(1B) guards, EXPORT DELETE START
! * and EXPORT DELETE END markers, and dummy C function definitions for lint.
*
* 2. Formatted code, added comments, and added #includes and #defines.
*
* 3. If bit CR0.TS is set, clear and set the TS bit, after and before
* calling kpreempt_disable() and kpreempt_enable().
--- 81,92 ----
* of "Add support to Intel AES-NI instruction set for x86_64 platform".
*
* This OpenSolaris version has these major changes from the original source:
*
* 1. Added OpenSolaris ENTRY_NP/SET_SIZE macros from
! * /usr/include/sys/asm_linkage.h, lint(1B) guards, and dummy C function
! * definitions for lint.
*
* 2. Formatted code, added comments, and added #includes and #defines.
*
* 3. If bit CR0.TS is set, clear and set the TS bit, after and before
* calling kpreempt_disable() and kpreempt_enable().
*** 303,313 ****
* %xmm1 Round constant
* Output:
* (%rcx) AES key
*/
- /* EXPORT DELETE START */
.align 16
_key_expansion_128:
_key_expansion_256a:
pshufd $0b11111111, %xmm1, %xmm1
shufps $0b00010000, %xmm0, %xmm4
--- 303,312 ----
*** 376,386 ****
pxor %xmm1, %xmm2
movaps %xmm2, (%rcx)
add $0x10, %rcx
ret
SET_SIZE(_key_expansion_256b)
- /* EXPORT DELETE END */
/*
* rijndael_key_setup_enc_intel()
* Expand the cipher key into the encryption key schedule.
--- 375,384 ----
*** 422,432 ****
#define ROUNDS64 KEYSIZE64 /* temp */
#define ENDAESKEY USERCIPHERKEY /* temp */
ENTRY_NP(rijndael_key_setup_enc_intel)
- /* EXPORT DELETE START */
CLEAR_TS_OR_PUSH_XMM0_TO_XMM6(%r10)
/ NULL pointer sanity check
test %USERCIPHERKEY, %USERCIPHERKEY
jz .Lenc_key_invalid_param
--- 420,429 ----
*** 578,588 ****
mov $-2, %rax / keysize is invalid
#else /* Open Solaris Interface */
xor %rax, %rax / a key pointer is NULL or invalid keysize
#endif /* OPENSSL_INTERFACE */
- /* EXPORT DELETE END */
ret
SET_SIZE(rijndael_key_setup_enc_intel)
/*
--- 575,584 ----
*** 605,615 ****
* int intel_AES_set_decrypt_key(const unsigned char *userKey,
* const int bits, AES_KEY *key);
* Return value is non-zero on error, 0 on success.
*/
ENTRY_NP(rijndael_key_setup_dec_intel)
- /* EXPORT DELETE START */
/ Generate round keys used for encryption
call rijndael_key_setup_enc_intel
test %rax, %rax
#ifdef OPENSSL_INTERFACE
jnz .Ldec_key_exit / Failed if returned non-0
--- 601,610 ----
*** 658,668 ****
SET_TS_OR_POP_XMM0_XMM1(%r10)
.Ldec_key_exit:
/ OpenSolaris: rax = # rounds (10, 12, or 14) or 0 for error
/ OpenSSL: rax = 0 for OK, or non-zero for error
- /* EXPORT DELETE END */
ret
SET_SIZE(rijndael_key_setup_dec_intel)
/*
--- 653,662 ----
*** 709,719 ****
#define STATE xmm0 /* temporary, 128 bits */
#define KEY xmm1 /* temporary, 128 bits */
ENTRY_NP(aes_encrypt_intel)
- /* EXPORT DELETE START */
CLEAR_TS_OR_PUSH_XMM0_XMM1(%r10)
movups (%INP), %STATE / input
movaps (%KEYP), %KEY / key
#ifdef OPENSSL_INTERFACE
--- 703,712 ----
*** 768,778 ****
movaps 0x70(%KEYP), %KEY
aesenclast %KEY, %STATE / last round
movups %STATE, (%OUTP) / output
SET_TS_OR_POP_XMM0_XMM1(%r10)
- /* EXPORT DELETE END */
ret
SET_SIZE(aes_encrypt_intel)
/*
--- 761,770 ----
*** 796,806 ****
* Original Intel OpenSSL Interface:
* void intel_AES_decrypt(const unsigned char *in, unsigned char *out,
* const AES_KEY *key);
*/
ENTRY_NP(aes_decrypt_intel)
- /* EXPORT DELETE START */
CLEAR_TS_OR_PUSH_XMM0_XMM1(%r10)
movups (%INP), %STATE / input
movaps (%KEYP), %KEY / key
#ifdef OPENSSL_INTERFACE
--- 788,797 ----
*** 856,864 ****
aesdeclast %KEY, %STATE / last round
movups %STATE, (%OUTP) / output
SET_TS_OR_POP_XMM0_XMM1(%r10)
ret
- /* EXPORT DELETE END */
SET_SIZE(aes_decrypt_intel)
#endif /* lint || __lint */
--- 847,854 ----