mirror of
https://github.com/guanzhi/GmSSL.git
synced 2026-08-10 16:03:48 +08:00
Merge remote-tracking branch 'origin/master'
# Conflicts: # README.md
This commit is contained in:
@@ -1,4 +1,11 @@
|
||||
#!/usr/local/bin/perl
|
||||
#! /usr/bin/env perl
|
||||
# Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.
|
||||
#
|
||||
# Licensed under the OpenSSL license (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
|
||||
|
||||
|
||||
# Normal is the
|
||||
# md5_block_x86(MD5_CTX *c, ULONG *X);
|
||||
@@ -11,6 +18,9 @@ $0 =~ m/(.*[\/\\])[^\/\\]+$/; $dir=$1;
|
||||
push(@INC,"${dir}","${dir}../../perlasm");
|
||||
require "x86asm.pl";
|
||||
|
||||
$output=pop;
|
||||
open STDOUT,">$output";
|
||||
|
||||
&asm_init($ARGV[0],$0);
|
||||
|
||||
$A="eax";
|
||||
@@ -33,6 +43,8 @@ $X="esi";
|
||||
&md5_block("md5_block_asm_data_order");
|
||||
&asm_finish();
|
||||
|
||||
close STDOUT;
|
||||
|
||||
sub Np
|
||||
{
|
||||
local($p)=@_;
|
||||
@@ -56,14 +68,14 @@ sub R0
|
||||
&lea($a,&DWP($t,$a,$tmp2,1));
|
||||
|
||||
&xor($tmp1,$d); # F function - part 4
|
||||
&mov($tmp2,&DWP($xo[$ki+1]*4,$K,"",0)) if ($pos != 2);
|
||||
|
||||
&add($a,$tmp1);
|
||||
&mov($tmp1,&Np($c)) if $pos < 1; # next tmp1 for R0
|
||||
&mov($tmp1,&Np($c)) if $pos == 1; # next tmp1 for R1
|
||||
|
||||
&rotl($a,$s);
|
||||
|
||||
&mov($tmp2,&DWP($xo[$ki+1]*4,$K,"",0)) if ($pos != 2);
|
||||
&mov($tmp1,&Np($c)) if $pos < 1; # next tmp1 for R0
|
||||
&mov($tmp1,&Np($c)) if $pos == 1; # next tmp1 for R1
|
||||
|
||||
&add($a,$b);
|
||||
}
|
||||
@@ -74,13 +86,12 @@ sub R1
|
||||
|
||||
&comment("R1 $ki");
|
||||
|
||||
&lea($a,&DWP($t,$a,$tmp2,1));
|
||||
|
||||
&xor($tmp1,$b); # G function - part 2
|
||||
&and($tmp1,$d); # G function - part 3
|
||||
&lea($a,&DWP($t,$a,$tmp2,1));
|
||||
|
||||
&mov($tmp2,&DWP($xo[$ki+1]*4,$K,"",0)) if ($pos != 2);
|
||||
&xor($tmp1,$c); # G function - part 4
|
||||
&mov($tmp2,&DWP($xo[$ki+1]*4,$K,"",0)) if ($pos != 2);
|
||||
|
||||
&add($a,$tmp1);
|
||||
&mov($tmp1,&Np($c)) if $pos < 1; # G function - part 1
|
||||
@@ -108,10 +119,10 @@ if (($n & 1) == 0)
|
||||
&lea($a,&DWP($t,$a,$tmp2,1));
|
||||
|
||||
&add($a,$tmp1);
|
||||
&mov($tmp2,&DWP($xo[$ki+1]*4,$K,"",0));
|
||||
|
||||
&rotl($a,$s);
|
||||
|
||||
&mov($tmp2,&DWP($xo[$ki+1]*4,$K,"",0));
|
||||
&mov($tmp1,&Np($c));
|
||||
}
|
||||
else
|
||||
@@ -120,11 +131,11 @@ else
|
||||
# make sure to do 'D' first, not 'B', else we clash with
|
||||
# the last add from the previous round.
|
||||
|
||||
&lea($a,&DWP($t,$a,$tmp2,1));
|
||||
|
||||
&add($b,$c); # MOVED FORWARD
|
||||
&xor($tmp1,$d); # H function - part 2
|
||||
|
||||
&lea($a,&DWP($t,$a,$tmp2,1));
|
||||
|
||||
&xor($tmp1,$b); # H function - part 3
|
||||
&mov($tmp2,&DWP($xo[$ki+1]*4,$K,"",0)) if ($pos != 2);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user