krb5/krb5-1.12-pic-aes-ni.patch
Michael Calmer 03254981cb Accepting request 213903 from home:ckornacker:branches:network
- update to version 1.12
  * Add GSSAPI extensions for constructing MIC tokens using IOV lists
  * Add a FAST OTP preauthentication module for the KDC which uses
    RADIUS to validate OTP token values.
  * The AES-based encryption types will use AES-NI instructions
    when possible for improved performance.
- revert dependency on libcom_err-mini-devel since it's not yet
  available
- update and rebase patches

OBS-URL: https://build.opensuse.org/request/show/213903
OBS-URL: https://build.opensuse.org/package/show/network/krb5?expand=0&rev=114
2014-01-15 14:14:20 +00:00

71 lines
1.4 KiB
Diff

--- krb5-1.12/src/lib/crypto/builtin/aes/iaesx86.s
+++ krb5-1.12/src/lib/crypto/builtin/aes/iaesx86.s
@@ -256,6 +256,7 @@ DD 0
section .text
+extern _GLOBAL_OFFSET_TABLE_
align 16
key_expansion256:
@@ -318,12 +319,18 @@ _iEncExpandKey128:
mov ecx,[esp-4+8] ;input
mov edx,[esp-4+12] ;ctx
+ push ebx
movdqu xmm1, [ecx] ; loading the key
movdqu [edx], xmm1
- movdqa xmm5, [shuffle_mask]
+ call .get_GOT
+.get_GOT:
+ pop ebx
+ add ebx,_GLOBAL_OFFSET_TABLE_+$$-.get_GOT wrt ..gotpc
+
+ movdqa xmm5, [ebx+shuffle_mask wrt ..gotoff]
add edx,16
@@ -348,6 +355,8 @@ _iEncExpandKey128:
aeskeygenassist xmm2, xmm1, 0x36 ; Generating round key 10
call key_expansion128
+ pop ebx
+
ret
@@ -412,6 +421,7 @@ global _iEncExpandKey256
_iEncExpandKey256:
mov ecx, [esp-4+8] ;input
mov edx, [esp-4+12] ;expanded key
+ push ebx
movdqu xmm1, [ecx] ; loading the key
@@ -421,7 +431,12 @@ _iEncExpandKey256:
add edx,32
- movdqa xmm5, [shuffle_mask] ; this mask is used by key_expansion
+ call .get_GOT
+.get_GOT:
+ pop ebx
+ add ebx,_GLOBAL_OFFSET_TABLE_+$$-.get_GOT wrt ..gotpc
+
+ movdqa xmm5, [ebx+shuffle_mask wrt ..gotoff] ; this mask is used by key_expansion
aeskeygenassist xmm2, xmm3, 0x1 ;
call key_expansion256
@@ -452,6 +467,8 @@ _iEncExpandKey256:
movdqu [edx], xmm1
+ pop ebx
+
ret