s390x assembly pack: extend s390x capability vector.
[oweals/openssl.git] / crypto / modes / asm / ghash-s390x.pl
index 469aefa7b35024f3cc42282512fcb12fb0e5fd83..17dc375053c5c092e0c7d7d9096d43b1c62e5069 100644 (file)
@@ -80,6 +80,8 @@ $rem_4bit="%r14";
 $sp="%r15";
 
 $code.=<<___;
+#include "s390x_arch.h"
+
 .text
 
 .globl gcm_gmult_4bit
@@ -89,12 +91,13 @@ ___
 $code.=<<___ if(!$softonly && 0);      # hardware is slow for single block...
        larl    %r1,OPENSSL_s390xcap_P
        lghi    %r0,0
-       lg      %r1,24(%r1)     # load second word of kimd capabilities vector
+       lg      %r1,S390X_KIMD+8(%r1)   # load second word of kimd capabilities
+                                       #  vector
        tmhh    %r1,0x4000      # check for function 65
        jz      .Lsoft_gmult
        stg     %r0,16($sp)     # arrange 16 bytes of zero input
        stg     %r0,24($sp)
-       lghi    %r0,65          # function 65
+       lghi    %r0,S390X_GHASH # function 65
        la      %r1,0($Xi)      # H lies right after Xi in gcm128_context
        la      $inp,16($sp)
        lghi    $len,16
@@ -123,10 +126,11 @@ gcm_ghash_4bit:
 ___
 $code.=<<___ if(!$softonly);
        larl    %r1,OPENSSL_s390xcap_P
-       lg      %r0,24(%r1)     # load second word of kimd capabilities vector
+       lg      %r0,S390X_KIMD+8(%r1)   # load second word of kimd capabilities
+                                       #  vector
        tmhh    %r0,0x4000      # check for function 65
        jz      .Lsoft_ghash
-       lghi    %r0,65          # function 65
+       lghi    %r0,S390X_GHASH # function 65
        la      %r1,0($Xi)      # H lies right after Xi in gcm128_context
        .long   0xb93e0004      # kimd %r0,$inp
        brc     1,.-4           # pay attention to "partial completion"