quantum init

This commit is contained in:
zhaoxiaomeng
2018-01-04 13:38:57 +08:00
committed by Simon
parent d11f845fde
commit 53af3b51ae
2361 changed files with 387455 additions and 144458 deletions

View File

@@ -1,11 +1,4 @@
#! /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
#!/usr/local/bin/perl
# Normal is the
# md5_block_x86(MD5_CTX *c, ULONG *X);
@@ -18,9 +11,6 @@ $0 =~ m/(.*[\/\\])[^\/\\]+$/; $dir=$1;
push(@INC,"${dir}","${dir}../../perlasm");
require "x86asm.pl";
$output=pop;
open STDOUT,">$output";
&asm_init($ARGV[0],$0);
$A="eax";
@@ -43,8 +33,6 @@ $X="esi";
&md5_block("md5_block_asm_data_order");
&asm_finish();
close STDOUT;
sub Np
{
local($p)=@_;
@@ -68,14 +56,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($tmp1,&Np($c)) if $pos < 1; # next tmp1 for R0
&mov($tmp1,&Np($c)) if $pos == 1; # next tmp1 for R1
&mov($tmp2,&DWP($xo[$ki+1]*4,$K,"",0)) if ($pos != 2);
&add($a,$b);
}
@@ -86,12 +74,13 @@ sub R1
&comment("R1 $ki");
&xor($tmp1,$b); # G function - part 2
&and($tmp1,$d); # G function - part 3
&lea($a,&DWP($t,$a,$tmp2,1));
&xor($tmp1,$c); # G function - part 4
&xor($tmp1,$b); # G function - part 2
&and($tmp1,$d); # G function - part 3
&mov($tmp2,&DWP($xo[$ki+1]*4,$K,"",0)) if ($pos != 2);
&xor($tmp1,$c); # G function - part 4
&add($a,$tmp1);
&mov($tmp1,&Np($c)) if $pos < 1; # G function - part 1
@@ -119,10 +108,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
@@ -131,11 +120,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);