Loading crypto/aes/asm/aes-586.pl +13 −18 Original line number Diff line number Diff line Loading @@ -2657,12 +2657,10 @@ sub enckey() &xor ("eax",&DWP(1024-128,$tbl,"ecx",4)); # rcon } # int AES_set_encrypt_key(const unsigned char *userKey, const int bits, # AES_KEY *key) &public_label("AES_Te"); &function_begin("AES_set_encrypt_key"); &mov ("esi",&wparam(0)); # user supplied key &mov ("edi",&wparam(2)); # private key schedule &function_begin("_x86_AES_set_encrypt_key"); &mov ("esi",&wparam(1)); # user supplied key &mov ("edi",&wparam(3)); # private key schedule &test ("esi",-1); &jz (&label("badpointer")); Loading @@ -2685,7 +2683,7 @@ sub enckey() &mov ("ecx",&DWP(192-128,$tbl)); &mov ("edx",&DWP(224-128,$tbl)); &mov ("ecx",&wparam(1)); # number of bits in key &mov ("ecx",&wparam(2)); # number of bits in key &cmp ("ecx",128); &je (&label("10rounds")); &cmp ("ecx",192); Loading Loading @@ -2862,7 +2860,14 @@ sub enckey() &set_label("badpointer"); &mov ("eax",-1); &set_label("exit"); &function_end("AES_set_encrypt_key"); &function_end("_x86_AES_set_encrypt_key"); # int AES_set_encrypt_key(const unsigned char *userKey, const int bits, # AES_KEY *key) &function_begin_B("AES_set_encrypt_key"); &call ("_x86_AES_set_encrypt_key"); &ret (); &function_end_B("AES_set_encrypt_key"); sub deckey() { my ($i,$key,$tp1,$tp2,$tp4,$tp8) = @_; Loading Loading @@ -2921,18 +2926,8 @@ sub deckey() # int AES_set_decrypt_key(const unsigned char *userKey, const int bits, # AES_KEY *key) &public_label("AES_Td"); &public_label("AES_Te"); &function_begin_B("AES_set_decrypt_key"); &mov ("eax",&wparam(0)); &mov ("ecx",&wparam(1)); &mov ("edx",&wparam(2)); &sub ("esp",12); &mov (&DWP(0,"esp"),"eax"); &mov (&DWP(4,"esp"),"ecx"); &mov (&DWP(8,"esp"),"edx"); &call ("AES_set_encrypt_key"); &add ("esp",12); &call ("_x86_AES_set_encrypt_key"); &cmp ("eax",0); &je (&label("proceed")); &ret (); Loading crypto/perlasm/x86unix.pl +10 −7 Original line number Diff line number Diff line Loading @@ -115,12 +115,14 @@ sub ::file sub ::function_begin_B { my($func,$extra)=@_; my $tmp; my $begin; &::external_label($func); $label{$func} = $begin = "${dot}L_${func}_begin"; $func=$under.$func; push(@out,".text\n.globl\t$func\n"); push(@out,".text\n"); push(@out,".globl\t$func\n") if ($func !~ /^${under}_/); if ($::coff) { push(@out,".def\t$func;\t.scl\t2;\t.type\t32;\t.endef\n"); } elsif ($::aout and !$::pic) Loading @@ -129,18 +131,19 @@ sub ::function_begin_B { push(@out,".type $func,\@function\n"); } push(@out,".align\t$align\n"); push(@out,"$func:\n"); push(@out,"$begin:\n"); $::stack=4; } sub ::function_end_B { my($func)=@_; my $i; $func=$under.$func; push(@out,"${dot}L_${func}_end:\n"); if ($::elf) { push(@out,".size\t$func,${dot}L_${func}_end-$func\n"); } { push(@out,".size\t$under$func,${dot}L_${func}_end-${dot}L_${func}_begin\n"); } $::stack=0; %label=(); foreach $i (keys %label) { delete $label{$i} if ($label{$i} =~ /^${dot}L[0-9]{3}/); } } sub ::comment Loading @@ -162,8 +165,8 @@ sub ::comment sub islabel # see is argument is a known label { my $i; foreach $i (%label) { return $label{$i} if ($label{$i} eq $_[0]); } undef; foreach $i (values %label) { return $i if ($i eq $_[0]); } $label{$_[0]}; # can be undef } sub ::external_label { push(@labels,@_); } Loading Loading
crypto/aes/asm/aes-586.pl +13 −18 Original line number Diff line number Diff line Loading @@ -2657,12 +2657,10 @@ sub enckey() &xor ("eax",&DWP(1024-128,$tbl,"ecx",4)); # rcon } # int AES_set_encrypt_key(const unsigned char *userKey, const int bits, # AES_KEY *key) &public_label("AES_Te"); &function_begin("AES_set_encrypt_key"); &mov ("esi",&wparam(0)); # user supplied key &mov ("edi",&wparam(2)); # private key schedule &function_begin("_x86_AES_set_encrypt_key"); &mov ("esi",&wparam(1)); # user supplied key &mov ("edi",&wparam(3)); # private key schedule &test ("esi",-1); &jz (&label("badpointer")); Loading @@ -2685,7 +2683,7 @@ sub enckey() &mov ("ecx",&DWP(192-128,$tbl)); &mov ("edx",&DWP(224-128,$tbl)); &mov ("ecx",&wparam(1)); # number of bits in key &mov ("ecx",&wparam(2)); # number of bits in key &cmp ("ecx",128); &je (&label("10rounds")); &cmp ("ecx",192); Loading Loading @@ -2862,7 +2860,14 @@ sub enckey() &set_label("badpointer"); &mov ("eax",-1); &set_label("exit"); &function_end("AES_set_encrypt_key"); &function_end("_x86_AES_set_encrypt_key"); # int AES_set_encrypt_key(const unsigned char *userKey, const int bits, # AES_KEY *key) &function_begin_B("AES_set_encrypt_key"); &call ("_x86_AES_set_encrypt_key"); &ret (); &function_end_B("AES_set_encrypt_key"); sub deckey() { my ($i,$key,$tp1,$tp2,$tp4,$tp8) = @_; Loading Loading @@ -2921,18 +2926,8 @@ sub deckey() # int AES_set_decrypt_key(const unsigned char *userKey, const int bits, # AES_KEY *key) &public_label("AES_Td"); &public_label("AES_Te"); &function_begin_B("AES_set_decrypt_key"); &mov ("eax",&wparam(0)); &mov ("ecx",&wparam(1)); &mov ("edx",&wparam(2)); &sub ("esp",12); &mov (&DWP(0,"esp"),"eax"); &mov (&DWP(4,"esp"),"ecx"); &mov (&DWP(8,"esp"),"edx"); &call ("AES_set_encrypt_key"); &add ("esp",12); &call ("_x86_AES_set_encrypt_key"); &cmp ("eax",0); &je (&label("proceed")); &ret (); Loading
crypto/perlasm/x86unix.pl +10 −7 Original line number Diff line number Diff line Loading @@ -115,12 +115,14 @@ sub ::file sub ::function_begin_B { my($func,$extra)=@_; my $tmp; my $begin; &::external_label($func); $label{$func} = $begin = "${dot}L_${func}_begin"; $func=$under.$func; push(@out,".text\n.globl\t$func\n"); push(@out,".text\n"); push(@out,".globl\t$func\n") if ($func !~ /^${under}_/); if ($::coff) { push(@out,".def\t$func;\t.scl\t2;\t.type\t32;\t.endef\n"); } elsif ($::aout and !$::pic) Loading @@ -129,18 +131,19 @@ sub ::function_begin_B { push(@out,".type $func,\@function\n"); } push(@out,".align\t$align\n"); push(@out,"$func:\n"); push(@out,"$begin:\n"); $::stack=4; } sub ::function_end_B { my($func)=@_; my $i; $func=$under.$func; push(@out,"${dot}L_${func}_end:\n"); if ($::elf) { push(@out,".size\t$func,${dot}L_${func}_end-$func\n"); } { push(@out,".size\t$under$func,${dot}L_${func}_end-${dot}L_${func}_begin\n"); } $::stack=0; %label=(); foreach $i (keys %label) { delete $label{$i} if ($label{$i} =~ /^${dot}L[0-9]{3}/); } } sub ::comment Loading @@ -162,8 +165,8 @@ sub ::comment sub islabel # see is argument is a known label { my $i; foreach $i (%label) { return $label{$i} if ($label{$i} eq $_[0]); } undef; foreach $i (values %label) { return $i if ($i eq $_[0]); } $label{$_[0]}; # can be undef } sub ::external_label { push(@labels,@_); } Loading