diff options
author | Ralf S. Engelschall <rse@openssl.org> | 1998-12-21 11:00:56 +0000 |
---|---|---|
committer | Ralf S. Engelschall <rse@openssl.org> | 1998-12-21 11:00:56 +0000 |
commit | dfeab0689f69c0b4bd3480ffd37a9cacc2f17d9c (patch) | |
tree | 2f74e0cfd76a9e092548a9bf52e579aef984299b /crypto/bn/m.pl | |
parent | 58964a492275ca9a59a0cd9c8155cb2491b4b909 (diff) | |
download | openssl-dfeab0689f69c0b4bd3480ffd37a9cacc2f17d9c.tar.gz |
Import of old SSLeay release: SSLeay 0.9.1b (unreleased)
Diffstat (limited to 'crypto/bn/m.pl')
-rw-r--r-- | crypto/bn/m.pl | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/crypto/bn/m.pl b/crypto/bn/m.pl new file mode 100644 index 0000000000..f69b036666 --- /dev/null +++ b/crypto/bn/m.pl @@ -0,0 +1,32 @@ +#!/usr/local/bin/perl + + +for ($i=0; $i<256; $i++) + { + for ($j=0; $j<256; $j++) + { + $a0=$i&0x0f; + $a1=($i>>4)&0x0f; + $b0=$j&0x0f; + $b1=($j>>4)&0x0f; + + $a0b0=$a0*$b0; + $a1b1=$a1*$b1; + + $a01=$a0-$a1; + $b10=$b1-$b0; + $a01b10=$a01*$b10; + + if ($a01b10 < 0) + { + $neg=1; + $a01b10= -$a01b10; + } + $t=($a0b0>>4)+($a0b0&0x0f)+($a1b1&0x0f); + if ($neg) + { $t-=($a01b10&0x0f); } + else { $t+=($a01b10&0x0f); } + printf("%02X %s%02X %02X\n",$a1b1,($neg)?"-":" ",$a01b10,$a0b0) + if ($t < 0) + } + } |