Padlock: fix byte swapping assembly for AES-192 and 256
[openssl.git] / engines / asm / e_padlock-x86.pl
index 5b097ce3ef9b10cf517907bb1ad425e2cf68674c..bb2b14468982cbb989326458231c8b6703a8b349 100644 (file)
@@ -1,7 +1,7 @@
 #! /usr/bin/env perl
 # Copyright 2011-2018 The OpenSSL Project Authors. All Rights Reserved.
 #
-# Licensed under the OpenSSL license (the "License").  You may not use
+# Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
 # in the file LICENSE in the source distribution or at
 # https://www.openssl.org/source/license.html
@@ -42,8 +42,7 @@ $0 =~ m/(.*[\/\\])[^\/\\]+$/; $dir=$1;
 push(@INC,"${dir}","${dir}../../crypto/perlasm");
 require "x86asm.pl";
 
-$output=pop;
-open STDOUT,">$output";
+$output=pop and open STDOUT,">$output";
 
 &asm_init($ARGV[0]);
 
@@ -116,6 +115,8 @@ $chunk="ebx";
 &function_begin_B("padlock_key_bswap");
        &mov    ("edx",&wparam(0));
        &mov    ("ecx",&DWP(240,"edx"));
+       &inc    ("ecx");
+       &shl    ("ecx",2);
 &set_label("bswap_loop");
        &mov    ("eax",&DWP(0,"edx"));
        &bswap  ("eax");