Initial draft of AES for PPC.
[oweals/openssl.git] / crypto / aes / asm / aes-s390x.pl
index 4a9713aea1abfee98cf0f20b5d441a1a26529f83..9f5d48ae1f82c052dfaadd9b98718f21c8e30a24 100644 (file)
@@ -23,7 +23,7 @@
 # for CBC is not utilized, nor multiple blocks are ever processed.
 # Then software key schedule can be postponed till hardware support
 # detection... Performance improvement over assembler is reportedly
-# ~2.5x, but can reach >15x [naturally on larger chunks] if proper
+# ~2.5x, but can reach >8x [naturally on larger chunks] if proper
 # support is implemented.
 
 $t1="%r0";
@@ -139,11 +139,13 @@ AES_encrypt:
        jz      .Lesoft
        lghi    %r0,`0x00|0x12` # encrypt AES-128
        la      %r1,0($key)
-       la      %r2,0($inp)
+       #la     %r2,0($inp)
        la      %r4,0($out)
        lghi    %r3,16          # single block length
        .long   0xb92e0042      # km %r4,%r2
-       br      %r14
+       bcr     8,%r14
+       la      $out,0(%r4)     # restore arguments
+       la      $key,0(%r1)
 .Lesoft:
        stmg    %r3,%r15,24($sp)
 
@@ -448,11 +450,14 @@ AES_decrypt:
        jz      .Ldsoft
        lghi    %r0,`0x80|0x12` # decrypt AES-128
        la      %r1,160($key)
-       la      %r2,0($inp)
+       #la     %r2,0($inp)
        la      %r4,0($out)
        lghi    %r3,16          # single block length
        .long   0xb92e0042      # km %r4,%r2
-       br      %r14
+       bcr     8,%r14
+       la      $out,0(%r4)     # restore arguments
+       lghi    $key,-160
+       la      $key,0($key,%r1)
 .Ldsoft:
        stmg    %r3,%r15,24($sp)