zap whitespace and tab
This commit is contained in:
parent
5b49f88fed
commit
4de47ea988
681 changed files with 35748 additions and 35743 deletions
|
@ -96,7 +96,7 @@ $code.=<<___;
|
|||
#endif
|
||||
.set noat
|
||||
___
|
||||
|
||||
|
||||
{{{
|
||||
my $FRAMESIZE=16*$SZREG;
|
||||
my $SAVED_REGS_MASK = ($flavour =~ /nubi/i) ? 0xc0fff008 : 0xc0ff0000;
|
||||
|
@ -437,7 +437,7 @@ $code.=<<___;
|
|||
$PTR_ADD $sp,$FRAMESIZE
|
||||
.end AES_encrypt
|
||||
___
|
||||
|
||||
|
||||
$code.=<<___;
|
||||
.align 5
|
||||
.ent _mips_AES_decrypt
|
||||
|
@ -774,7 +774,7 @@ $code.=<<___;
|
|||
.end AES_decrypt
|
||||
___
|
||||
}}}
|
||||
|
||||
|
||||
{{{
|
||||
my $FRAMESIZE=8*$SZREG;
|
||||
my $SAVED_REGS_MASK = ($flavour =~ /nubi/i) ? 0xc000f008 : 0xc0000000;
|
||||
|
@ -1087,7 +1087,7 @@ $code.=<<___;
|
|||
$PTR_ADD $sp,$FRAMESIZE
|
||||
.end AES_set_encrypt_key
|
||||
___
|
||||
|
||||
|
||||
my ($head,$tail)=($inp,$bits);
|
||||
my ($tp1,$tp2,$tp4,$tp8,$tp9,$tpb,$tpd,$tpe)=($a4,$a5,$a6,$a7,$s0,$s1,$s2,$s3);
|
||||
my ($m,$x80808080,$x7f7f7f7f,$x1b1b1b1b)=($at,$t0,$t1,$t2);
|
||||
|
@ -1570,7 +1570,7 @@ AES_Td:
|
|||
.byte 0x17, 0x2b, 0x04, 0x7e, 0xba, 0x77, 0xd6, 0x26
|
||||
.byte 0xe1, 0x69, 0x14, 0x63, 0x55, 0x21, 0x0c, 0x7d
|
||||
___
|
||||
|
||||
|
||||
foreach (split("\n",$code)) {
|
||||
s/\`([^\`]*)\`/eval $1/ge;
|
||||
|
||||
|
|
|
@ -90,7 +90,7 @@ sub aesenc { aescommon(0xdc,@_); }
|
|||
sub aesenclast { aescommon(0xdd,@_); }
|
||||
sub aesdec { aescommon(0xde,@_); }
|
||||
sub aesdeclast { aescommon(0xdf,@_); }
|
||||
|
||||
|
||||
# Inline version of internal aesni_[en|de]crypt1
|
||||
{ my $sn;
|
||||
sub aesni_inline_generate1
|
||||
|
@ -157,7 +157,7 @@ sub aesni_generate1 # fully unrolled loop
|
|||
&ret();
|
||||
&function_end_B("_aesni_${p}rypt1");
|
||||
}
|
||||
|
||||
|
||||
# void $PREFIX_encrypt (const void *inp,void *out,const AES_KEY *key);
|
||||
&aesni_generate1("enc") if (!$inline);
|
||||
&function_begin_B("${PREFIX}_encrypt");
|
||||
|
@ -349,7 +349,7 @@ sub aesni_generate6
|
|||
&aesni_generate4("dec");
|
||||
&aesni_generate6("enc") if ($PREFIX eq "aesni");
|
||||
&aesni_generate6("dec");
|
||||
|
||||
|
||||
if ($PREFIX eq "aesni") {
|
||||
######################################################################
|
||||
# void aesni_ecb_encrypt (const void *in, void *out,
|
||||
|
@ -569,7 +569,7 @@ if ($PREFIX eq "aesni") {
|
|||
|
||||
&set_label("ecb_ret");
|
||||
&function_end("aesni_ecb_encrypt");
|
||||
|
||||
|
||||
######################################################################
|
||||
# void aesni_ccm64_[en|de]crypt_blocks (const void *in, void *out,
|
||||
# size_t blocks, const AES_KEY *key,
|
||||
|
@ -756,7 +756,7 @@ if ($PREFIX eq "aesni") {
|
|||
&movups (&QWP(0,$out),$cmac);
|
||||
&function_end("aesni_ccm64_decrypt_blocks");
|
||||
}
|
||||
|
||||
|
||||
######################################################################
|
||||
# void aesni_ctr32_encrypt_blocks (const void *in, void *out,
|
||||
# size_t blocks, const AES_KEY *key,
|
||||
|
@ -1010,7 +1010,7 @@ if ($PREFIX eq "aesni") {
|
|||
&set_label("ctr32_ret");
|
||||
&mov ("esp",&DWP(80,"esp"));
|
||||
&function_end("aesni_ctr32_encrypt_blocks");
|
||||
|
||||
|
||||
######################################################################
|
||||
# void aesni_xts_[en|de]crypt(const char *inp,char *out,size_t len,
|
||||
# const AES_KEY *key1, const AES_KEY *key2
|
||||
|
@ -1716,7 +1716,7 @@ if ($PREFIX eq "aesni") {
|
|||
&function_end("aesni_xts_decrypt");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
######################################################################
|
||||
# void $PREFIX_cbc_encrypt (const void *inp, void *out,
|
||||
# size_t length, const AES_KEY *key,
|
||||
|
@ -1943,7 +1943,7 @@ if ($PREFIX eq "aesni") {
|
|||
&movups (&QWP(0,$key_),$ivec); # output IV
|
||||
&set_label("cbc_abort");
|
||||
&function_end("${PREFIX}_cbc_encrypt");
|
||||
|
||||
|
||||
######################################################################
|
||||
# Mechanical port from aesni-x86_64.pl.
|
||||
#
|
||||
|
|
|
@ -128,7 +128,7 @@ my @s=@_[12..15];
|
|||
|
||||
sub InBasisChange {
|
||||
# input in lsb > [b0, b1, b2, b3, b4, b5, b6, b7] < msb
|
||||
# output in lsb > [b6, b5, b0, b3, b7, b1, b4, b2] < msb
|
||||
# output in lsb > [b6, b5, b0, b3, b7, b1, b4, b2] < msb
|
||||
my @b=@_[0..7];
|
||||
$code.=<<___;
|
||||
pxor @b[6], @b[5]
|
||||
|
@ -378,7 +378,7 @@ $code.=<<___;
|
|||
pxor @s[0], @t[3]
|
||||
pxor @s[1], @t[2]
|
||||
pxor @s[2], @t[1]
|
||||
pxor @s[3], @t[0]
|
||||
pxor @s[3], @t[0]
|
||||
|
||||
#Inv_GF16 \t0, \t1, \t2, \t3, \s0, \s1, \s2, \s3
|
||||
|
||||
|
|
|
@ -432,7 +432,7 @@ $k_dsbo=0x2c0; # decryption sbox final output
|
|||
##
|
||||
&set_label("schedule_192",16);
|
||||
&movdqu ("xmm0",&QWP(8,$inp)); # load key part 2 (very unaligned)
|
||||
&call ("_vpaes_schedule_transform"); # input transform
|
||||
&call ("_vpaes_schedule_transform"); # input transform
|
||||
&movdqa ("xmm6","xmm0"); # save short part
|
||||
&pxor ("xmm4","xmm4"); # clear 4
|
||||
&movhlps("xmm6","xmm4"); # clobber low side with zeros
|
||||
|
@ -463,7 +463,7 @@ $k_dsbo=0x2c0; # decryption sbox final output
|
|||
##
|
||||
&set_label("schedule_256",16);
|
||||
&movdqu ("xmm0",&QWP(16,$inp)); # load key part 2 (unaligned)
|
||||
&call ("_vpaes_schedule_transform"); # input transform
|
||||
&call ("_vpaes_schedule_transform"); # input transform
|
||||
&mov ($round,7);
|
||||
|
||||
&set_label("loop_schedule_256");
|
||||
|
@ -474,7 +474,7 @@ $k_dsbo=0x2c0; # decryption sbox final output
|
|||
&call ("_vpaes_schedule_round");
|
||||
&dec ($round);
|
||||
&jz (&label("schedule_mangle_last"));
|
||||
&call ("_vpaes_schedule_mangle");
|
||||
&call ("_vpaes_schedule_mangle");
|
||||
|
||||
# low round. swap xmm7 and xmm6
|
||||
&pshufd ("xmm0","xmm0",0xFF);
|
||||
|
@ -597,7 +597,7 @@ $k_dsbo=0x2c0; # decryption sbox final output
|
|||
# subbyte
|
||||
&movdqa ("xmm4",&QWP($k_s0F,$const));
|
||||
&movdqa ("xmm5",&QWP($k_inv,$const)); # 4 : 1/j
|
||||
&movdqa ("xmm1","xmm4");
|
||||
&movdqa ("xmm1","xmm4");
|
||||
&pandn ("xmm1","xmm0");
|
||||
&psrld ("xmm1",4); # 1 = i
|
||||
&pand ("xmm0","xmm4"); # 0 = k
|
||||
|
|
|
@ -164,7 +164,7 @@ _vpaes_encrypt_core:
|
|||
pshufb %xmm1, %xmm0
|
||||
ret
|
||||
.size _vpaes_encrypt_core,.-_vpaes_encrypt_core
|
||||
|
||||
|
||||
##
|
||||
## Decryption core
|
||||
##
|
||||
|
@ -218,7 +218,7 @@ _vpaes_decrypt_core:
|
|||
pshufb %xmm3, %xmm0 # 0 = sbdt
|
||||
pxor %xmm4, %xmm0 # 0 = ch
|
||||
sub \$1,%rax # nr--
|
||||
|
||||
|
||||
pshufb %xmm5, %xmm0 # MC ch
|
||||
movdqa 0x20(%r10),%xmm4 # 4 : sbbu
|
||||
pshufb %xmm2, %xmm4 # 4 = sbbu
|
||||
|
@ -226,7 +226,7 @@ _vpaes_decrypt_core:
|
|||
movdqa 0x30(%r10),%xmm0 # 0 : sbbt
|
||||
pshufb %xmm3, %xmm0 # 0 = sbbt
|
||||
pxor %xmm4, %xmm0 # 0 = ch
|
||||
|
||||
|
||||
pshufb %xmm5, %xmm0 # MC ch
|
||||
movdqa 0x40(%r10),%xmm4 # 4 : sbeu
|
||||
pshufb %xmm2, %xmm4 # 4 = sbeu
|
||||
|
@ -236,7 +236,7 @@ _vpaes_decrypt_core:
|
|||
pxor %xmm4, %xmm0 # 0 = ch
|
||||
|
||||
palignr \$12, %xmm5, %xmm5
|
||||
|
||||
|
||||
.Ldec_entry:
|
||||
# top of round
|
||||
movdqa %xmm9, %xmm1 # 1 : i
|
||||
|
@ -328,7 +328,7 @@ _vpaes_schedule_core:
|
|||
##
|
||||
.Lschedule_128:
|
||||
mov \$10, %esi
|
||||
|
||||
|
||||
.Loop_schedule_128:
|
||||
call _vpaes_schedule_round
|
||||
dec %rsi
|
||||
|
@ -362,7 +362,7 @@ _vpaes_schedule_core:
|
|||
|
||||
.Loop_schedule_192:
|
||||
call _vpaes_schedule_round
|
||||
palignr \$8,%xmm6,%xmm0
|
||||
palignr \$8,%xmm6,%xmm0
|
||||
call _vpaes_schedule_mangle # save key n
|
||||
call _vpaes_schedule_192_smear
|
||||
call _vpaes_schedule_mangle # save key n+1
|
||||
|
@ -388,7 +388,7 @@ _vpaes_schedule_core:
|
|||
movdqu 16(%rdi),%xmm0 # load key part 2 (unaligned)
|
||||
call _vpaes_schedule_transform # input transform
|
||||
mov \$7, %esi
|
||||
|
||||
|
||||
.Loop_schedule_256:
|
||||
call _vpaes_schedule_mangle # output low result
|
||||
movdqa %xmm0, %xmm6 # save cur_lo in xmm6
|
||||
|
@ -397,7 +397,7 @@ _vpaes_schedule_core:
|
|||
call _vpaes_schedule_round
|
||||
dec %rsi
|
||||
jz .Lschedule_mangle_last
|
||||
call _vpaes_schedule_mangle
|
||||
call _vpaes_schedule_mangle
|
||||
|
||||
# low round. swap xmm7 and xmm6
|
||||
pshufd \$0xFF, %xmm0, %xmm0
|
||||
|
@ -405,10 +405,10 @@ _vpaes_schedule_core:
|
|||
movdqa %xmm6, %xmm7
|
||||
call _vpaes_schedule_low_round
|
||||
movdqa %xmm5, %xmm7
|
||||
|
||||
|
||||
jmp .Loop_schedule_256
|
||||
|
||||
|
||||
|
||||
##
|
||||
## .aes_schedule_mangle_last
|
||||
##
|
||||
|
@ -509,9 +509,9 @@ _vpaes_schedule_round:
|
|||
# rotate
|
||||
pshufd \$0xFF, %xmm0, %xmm0
|
||||
palignr \$1, %xmm0, %xmm0
|
||||
|
||||
|
||||
# fall through...
|
||||
|
||||
|
||||
# low round: same as high round, but no rotation and no rcon.
|
||||
_vpaes_schedule_low_round:
|
||||
# smear xmm7
|
||||
|
@ -550,7 +550,7 @@ _vpaes_schedule_low_round:
|
|||
pxor %xmm4, %xmm0 # 0 = sbox output
|
||||
|
||||
# add in smeared stuff
|
||||
pxor %xmm7, %xmm0
|
||||
pxor %xmm7, %xmm0
|
||||
movdqa %xmm0, %xmm7
|
||||
ret
|
||||
.size _vpaes_schedule_round,.-_vpaes_schedule_round
|
||||
|
|
|
@ -102,7 +102,7 @@ getentropy(void *buf, size_t len)
|
|||
* should raise(SIGKILL)
|
||||
* - Do the best under the circumstances....
|
||||
*
|
||||
* This code path exists to bring light to the issue that hpux
|
||||
* This code path exists to bring light to the issue that hpux
|
||||
* does not provide a failsafe API for entropy collection.
|
||||
*
|
||||
* We hope this demonstrates that hpux should consider
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/* $OpenBSD: getentropy_win.c,v 1.6 2020/11/11 10:41:24 bcook Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2014, Theo de Raadt <deraadt@openbsd.org>
|
||||
* Copyright (c) 2014, Theo de Raadt <deraadt@openbsd.org>
|
||||
* Copyright (c) 2014, Bob Beck <beck@obtuse.com>
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
# alpha-specific libcrypto build rules
|
||||
|
||||
# aes
|
||||
SRCS+= aes_core.c aes_cbc.c
|
||||
SRCS+= aes_core.c aes_cbc.c
|
||||
# bf
|
||||
SRCS+= bf_enc.c
|
||||
# bn
|
||||
|
|
|
@ -117,7 +117,7 @@ YOU SHOULD NOT HAVE BOTH DES_RISC1 AND DES_RISC2 DEFINED!!!!!
|
|||
even newer MIPS CPU's, but at the moment one size fits all for
|
||||
optimization options. Older Sparc's work better with only UNROLL, but
|
||||
there's no way to tell at compile time what it is you're running on */
|
||||
|
||||
|
||||
#if defined( sun ) /* Newer Sparc's */
|
||||
# define DES_PTR
|
||||
# define DES_RISC1
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
# hppa-specific libcrypto build rules
|
||||
|
||||
# aes
|
||||
SRCS+= aes_core.c aes_cbc.c
|
||||
SRCS+= aes_core.c aes_cbc.c
|
||||
CFLAGS+= -DAES_ASM
|
||||
SSLASM+= aes aes-parisc aes-parisc
|
||||
# bf
|
||||
|
|
|
@ -119,7 +119,7 @@ YOU SHOULD NOT HAVE BOTH DES_RISC1 AND DES_RISC2 DEFINED!!!!!
|
|||
even newer MIPS CPU's, but at the moment one size fits all for
|
||||
optimization options. Older Sparc's work better with only UNROLL, but
|
||||
there's no way to tell at compile time what it is you're running on */
|
||||
|
||||
|
||||
#if defined( sun ) /* Newer Sparc's */
|
||||
# define DES_PTR
|
||||
# define DES_RISC1
|
||||
|
|
|
@ -119,7 +119,7 @@ YOU SHOULD NOT HAVE BOTH DES_RISC1 AND DES_RISC2 DEFINED!!!!!
|
|||
even newer MIPS CPU's, but at the moment one size fits all for
|
||||
optimization options. Older Sparc's work better with only UNROLL, but
|
||||
there's no way to tell at compile time what it is you're running on */
|
||||
|
||||
|
||||
#if defined( sun ) /* Newer Sparc's */
|
||||
# define DES_PTR
|
||||
# define DES_RISC1
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
# mips64-specific libcrypto build rules
|
||||
|
||||
# aes
|
||||
SRCS+= aes_cbc.c
|
||||
SRCS+= aes_cbc.c
|
||||
CFLAGS+= -DAES_ASM
|
||||
SSLASM+= aes aes-mips aes-mips
|
||||
# bf
|
||||
|
|
|
@ -119,7 +119,7 @@ YOU SHOULD NOT HAVE BOTH DES_RISC1 AND DES_RISC2 DEFINED!!!!!
|
|||
even newer MIPS CPU's, but at the moment one size fits all for
|
||||
optimization options. Older Sparc's work better with only UNROLL, but
|
||||
there's no way to tell at compile time what it is you're running on */
|
||||
|
||||
|
||||
#if defined( sun ) /* Newer Sparc's */
|
||||
# define DES_PTR
|
||||
# define DES_RISC1
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
# powerpc-specific libcrypto build rules
|
||||
|
||||
# aes
|
||||
SRCS+= aes_core.c aes_cbc.c
|
||||
SRCS+= aes_core.c aes_cbc.c
|
||||
# slower than C code
|
||||
#CFLAGS+= -DAES_ASM
|
||||
#SSLASM+= aes aes-ppc aes-ppc
|
||||
|
|
|
@ -119,7 +119,7 @@ YOU SHOULD NOT HAVE BOTH DES_RISC1 AND DES_RISC2 DEFINED!!!!!
|
|||
even newer MIPS CPU's, but at the moment one size fits all for
|
||||
optimization options. Older Sparc's work better with only UNROLL, but
|
||||
there's no way to tell at compile time what it is you're running on */
|
||||
|
||||
|
||||
#if defined( sun ) /* Newer Sparc's */
|
||||
# define DES_PTR
|
||||
# define DES_RISC1
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
# powerpc-specific libcrypto build rules
|
||||
|
||||
# aes
|
||||
SRCS+= aes_core.c aes_cbc.c
|
||||
SRCS+= aes_core.c aes_cbc.c
|
||||
# slower than C code
|
||||
#CFLAGS+= -DAES_ASM
|
||||
#SSLASM+= aes aes-ppc aes-ppc
|
||||
|
|
|
@ -114,7 +114,7 @@ YOU SHOULD NOT HAVE BOTH DES_RISC1 AND DES_RISC2 DEFINED!!!!!
|
|||
even newer MIPS CPU's, but at the moment one size fits all for
|
||||
optimization options. Older Sparc's work better with only UNROLL, but
|
||||
there's no way to tell at compile time what it is you're running on */
|
||||
|
||||
|
||||
#if defined( sun ) /* Newer Sparc's */
|
||||
# define DES_PTR
|
||||
# define DES_RISC1
|
||||
|
|
|
@ -119,7 +119,7 @@ YOU SHOULD NOT HAVE BOTH DES_RISC1 AND DES_RISC2 DEFINED!!!!!
|
|||
even newer MIPS CPU's, but at the moment one size fits all for
|
||||
optimization options. Older Sparc's work better with only UNROLL, but
|
||||
there's no way to tell at compile time what it is you're running on */
|
||||
|
||||
|
||||
#if defined( sun ) /* Newer Sparc's */
|
||||
# define DES_PTR
|
||||
# define DES_RISC1
|
||||
|
|
|
@ -119,7 +119,7 @@ YOU SHOULD NOT HAVE BOTH DES_RISC1 AND DES_RISC2 DEFINED!!!!!
|
|||
even newer MIPS CPU's, but at the moment one size fits all for
|
||||
optimization options. Older Sparc's work better with only UNROLL, but
|
||||
there's no way to tell at compile time what it is you're running on */
|
||||
|
||||
|
||||
#if defined( sun ) /* Newer Sparc's */
|
||||
# define DES_PTR
|
||||
# define DES_RISC1
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
# sparc64-specific libcrypto build rules
|
||||
|
||||
# aes
|
||||
SRCS+= aes_core.c aes_cbc.c
|
||||
SRCS+= aes_core.c aes_cbc.c
|
||||
CFLAGS+= -DAES_ASM
|
||||
SSLASM+= aes aes-sparcv9 aes-sparcv9
|
||||
# bf
|
||||
|
|
|
@ -119,7 +119,7 @@ YOU SHOULD NOT HAVE BOTH DES_RISC1 AND DES_RISC2 DEFINED!!!!!
|
|||
even newer MIPS CPU's, but at the moment one size fits all for
|
||||
optimization options. Older Sparc's work better with only UNROLL, but
|
||||
there's no way to tell at compile time what it is you're running on */
|
||||
|
||||
|
||||
#if defined( sun ) /* Newer Sparc's */
|
||||
# define DES_PTR
|
||||
# define DES_RISC1
|
||||
|
|
|
@ -42,7 +42,7 @@ bn_addw(BN_ULONG a, BN_ULONG b, BN_ULONG *out_r1, BN_ULONG *out_r0)
|
|||
}
|
||||
|
||||
#define HAVE_BN_MULW
|
||||
|
||||
|
||||
static inline void
|
||||
bn_mulw(BN_ULONG a, BN_ULONG b, BN_ULONG *out_r1, BN_ULONG *out_r0)
|
||||
{
|
||||
|
|
|
@ -256,7 +256,7 @@ bn_mul_mont:
|
|||
cmplt $i,$num,$tj # borrow $tj
|
||||
stq $hi1,16($tp)
|
||||
bne $tj,.Louter
|
||||
|
||||
|
||||
s8addq $num,sp,$tj # &tp[num]
|
||||
mov $rp,$bp # put rp aside
|
||||
mov sp,$tp
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
# [depending on key length, less for longer keys] on ARM920T, and
|
||||
# +115-80% on Intel IXP425. This is compared to pre-bn_mul_mont code
|
||||
# base and compiler generated code with in-lined umull and even umlal
|
||||
# instructions. The latter means that this code didn't really have an
|
||||
# instructions. The latter means that this code didn't really have an
|
||||
# "advantage" of utilizing some "secret" instruction.
|
||||
#
|
||||
# The code is interoperable with Thumb ISA and is rather compact, less
|
||||
|
@ -110,7 +110,7 @@ bn_mul_mont:
|
|||
adc $nhi,$nhi,#0
|
||||
str $nlo,[$num] @ tp[num-1]=
|
||||
str $nhi,[$num,#4] @ tp[num]=
|
||||
|
||||
|
||||
.Louter:
|
||||
sub $tj,$num,sp @ "original" $num-1 value
|
||||
sub $ap,$ap,$tj @ "rewind" ap to &ap[1]
|
||||
|
@ -158,7 +158,7 @@ bn_mul_mont:
|
|||
|
||||
cmp $tp,$tj
|
||||
bne .Louter
|
||||
|
||||
|
||||
ldr $rp,[$_rp] @ pull rp
|
||||
add $num,$num,#4 @ $num to point at &tp[num]
|
||||
sub $aj,$num,sp @ "original" num value
|
||||
|
|
|
@ -42,7 +42,7 @@ sub bn_mul_add_words
|
|||
&movd("mm0",&wparam(3)); # mm0 = w
|
||||
&pxor("mm1","mm1"); # mm1 = carry_in
|
||||
&jmp(&label("maw_sse2_entry"));
|
||||
|
||||
|
||||
&set_label("maw_sse2_unrolled",16);
|
||||
&movd("mm3",&DWP(0,$r,"",0)); # mm3 = r[0]
|
||||
&paddq("mm1","mm3"); # mm1 = carry_in + r[0]
|
||||
|
|
|
@ -36,7 +36,7 @@ sub mul_add_c
|
|||
&mov("edx",&DWP(($nb)*4,$b,"",0)) if $pos == 1; # load next b
|
||||
###
|
||||
&adc($c2,0);
|
||||
# is pos > 1, it means it is the last loop
|
||||
# is pos > 1, it means it is the last loop
|
||||
&mov(&DWP($i*4,"eax","",0),$c0) if $pos > 0; # save r[];
|
||||
&mov("eax",&DWP(($na)*4,$a,"",0)) if $pos == 1; # load next a
|
||||
}
|
||||
|
@ -65,7 +65,7 @@ sub sqr_add_c
|
|||
&mov("edx",&DWP(($nb)*4,$a,"",0)) if ($pos == 1) && ($na != $nb);
|
||||
###
|
||||
&adc($c2,0);
|
||||
# is pos > 1, it means it is the last loop
|
||||
# is pos > 1, it means it is the last loop
|
||||
&mov(&DWP($i*4,$r,"",0),$c0) if $pos > 0; # save r[];
|
||||
&mov("eax",&DWP(($na)*4,$a,"",0)) if $pos == 1; # load next b
|
||||
}
|
||||
|
@ -116,7 +116,7 @@ sub bn_mul_comba
|
|||
$c2="ebp";
|
||||
$a="esi";
|
||||
$b="edi";
|
||||
|
||||
|
||||
$as=0;
|
||||
$ae=0;
|
||||
$bs=0;
|
||||
|
@ -131,9 +131,9 @@ sub bn_mul_comba
|
|||
&push("ebx");
|
||||
|
||||
&xor($c0,$c0);
|
||||
&mov("eax",&DWP(0,$a,"",0)); # load the first word
|
||||
&mov("eax",&DWP(0,$a,"",0)); # load the first word
|
||||
&xor($c1,$c1);
|
||||
&mov("edx",&DWP(0,$b,"",0)); # load the first second
|
||||
&mov("edx",&DWP(0,$b,"",0)); # load the first second
|
||||
|
||||
for ($i=0; $i<$tot; $i++)
|
||||
{
|
||||
|
@ -141,7 +141,7 @@ sub bn_mul_comba
|
|||
$bi=$bs;
|
||||
$end=$be+1;
|
||||
|
||||
&comment("################## Calculate word $i");
|
||||
&comment("################## Calculate word $i");
|
||||
|
||||
for ($j=$bs; $j<$end; $j++)
|
||||
{
|
||||
|
|
|
@ -350,7 +350,7 @@ $code.=<<___;
|
|||
addu $i,$BNSZ
|
||||
sltu $t0,$i,$num
|
||||
bnez $t0,.Louter
|
||||
|
||||
|
||||
.set noreorder
|
||||
$PTR_ADD $tj,$sp,$num # &tp[num]
|
||||
move $tp,$sp
|
||||
|
|
|
@ -580,13 +580,13 @@ $code.=<<___;
|
|||
sltu $v0,$t2,$ta2
|
||||
$ST $t2,-2*$BNSZ($a0)
|
||||
$ADDU $v0,$t8
|
||||
|
||||
|
||||
$ADDU $ta3,$t3
|
||||
sltu $t9,$ta3,$t3
|
||||
$ADDU $t3,$ta3,$v0
|
||||
sltu $v0,$t3,$ta3
|
||||
$ST $t3,-$BNSZ($a0)
|
||||
|
||||
|
||||
.set noreorder
|
||||
bgtz $at,.L_bn_add_words_loop
|
||||
$ADDU $v0,$t9
|
||||
|
@ -785,7 +785,7 @@ bn_div_3_words:
|
|||
# so that we can save two arguments
|
||||
# and return address in registers
|
||||
# instead of stack:-)
|
||||
|
||||
|
||||
$LD $a0,($a3)
|
||||
move $ta2,$a1
|
||||
bne $a0,$a2,bn_div_3_words_internal
|
||||
|
|
|
@ -59,7 +59,7 @@
|
|||
# Special thanks to polarhome.com for providing HP-UX account on
|
||||
# PA-RISC 1.1 machine, and to correspondent who chose to remain
|
||||
# anonymous for testing the code on PA-RISC 2.0 machine.
|
||||
|
||||
|
||||
$0 =~ m/(.*[\/\\])[^\/\\]+$/; $dir=$1;
|
||||
|
||||
$flavour = shift;
|
||||
|
@ -228,7 +228,7 @@ $code.=<<___; # PA-RISC 2.0 code-path
|
|||
ldo 8($idx),$idx ; j++++
|
||||
addl $ab0,$nm0,$nm0 ; low part is discarded
|
||||
extrd,u $nm0,31,32,$hi1
|
||||
|
||||
|
||||
L\$1st
|
||||
xmpyu ${fai}R,${fbi},${fab1} ; ap[j+1]*bp[0]
|
||||
xmpyu ${fni}R,${fm0}R,${fnm1} ; np[j+1]*m
|
||||
|
@ -349,7 +349,7 @@ L\$outer
|
|||
extrd,u $nm0,31,32,$hi1
|
||||
fstds ${fab0},-16($xfer)
|
||||
fstds ${fnm0},-8($xfer)
|
||||
|
||||
|
||||
L\$inner
|
||||
xmpyu ${fai}R,${fbi},${fab1} ; ap[j+1]*bp[i]
|
||||
xmpyu ${fni}R,${fm0}R,${fnm1} ; np[j+1]*m
|
||||
|
@ -464,7 +464,7 @@ $code.=<<___;
|
|||
|
||||
b L\$outer
|
||||
ldo `$LOCALS+32+4`($fp),$tp
|
||||
|
||||
|
||||
L\$outerdone
|
||||
addl $hi0,$ab1,$ab1
|
||||
addl $ti1,$ab1,$ab1
|
||||
|
@ -529,7 +529,7 @@ L\$copy
|
|||
ldd $idx($np),$hi0
|
||||
std,ma %r0,8($tp)
|
||||
addib,<> 8,$idx,.-8 ; L\$copy
|
||||
std,ma $hi0,8($rp)
|
||||
std,ma $hi0,8($rp)
|
||||
___
|
||||
|
||||
if ($BN_SZ==4) { # PA-RISC 1.1 code-path
|
||||
|
@ -562,7 +562,7 @@ L\$parisc11
|
|||
ldw 4($xfer),$ablo
|
||||
ldw 0($xfer),$abhi
|
||||
nop
|
||||
|
||||
|
||||
L\$1st_pa11
|
||||
xmpyu ${fai}R,${fbi},${fab1} ; ap[j+1]*bp[0]
|
||||
flddx $idx($ap),${fai} ; ap[j,j+1]
|
||||
|
@ -687,7 +687,7 @@ L\$outer_pa11
|
|||
fstds ${fnm0},-8($xfer)
|
||||
ldw 4($xfer),$ablo
|
||||
ldw 0($xfer),$abhi
|
||||
|
||||
|
||||
L\$inner_pa11
|
||||
xmpyu ${fai}R,${fbi},${fab1} ; ap[j+1]*bp[i]
|
||||
flddx $idx($ap),${fai} ; ap[j,j+1]
|
||||
|
@ -806,7 +806,7 @@ L\$inner_pa11
|
|||
|
||||
b L\$outer_pa11
|
||||
ldo `$LOCALS+32+4`($fp),$tp
|
||||
|
||||
|
||||
L\$outerdone_pa11
|
||||
add $hi0,$ablo,$ablo
|
||||
addc %r0,$abhi,$abhi
|
||||
|
@ -852,13 +852,13 @@ L\$copy_pa11
|
|||
ldwx $idx($np),$hi0
|
||||
stws,ma %r0,4($tp)
|
||||
addib,<> 4,$idx,L\$copy_pa11
|
||||
stws,ma $hi0,4($rp)
|
||||
stws,ma $hi0,4($rp)
|
||||
|
||||
nop ; alignment
|
||||
L\$done
|
||||
___
|
||||
}
|
||||
|
||||
|
||||
$code.=<<___;
|
||||
ldi 1,%r28 ; signal "handled"
|
||||
ldo $FRAME($fp),%sp ; destroy tp[num+1]
|
||||
|
@ -877,7 +877,7 @@ L\$abort
|
|||
$POPMB -$FRAME(%sp),%r3
|
||||
.PROCEND
|
||||
___
|
||||
|
||||
|
||||
# Explicitly encode PA-RISC 2.0 instructions used in this module, so
|
||||
# that it can be compiled with .LEVEL 1.0. It should be noted that I
|
||||
# wouldn't have to do this, if GNU assembler understood .ALLOW 2.0
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
# So far RSA *sign* performance improvement over pre-bn_mul_mont asm
|
||||
# for 64-bit application running on PPC970/G5 is:
|
||||
#
|
||||
# 512-bit +65%
|
||||
# 512-bit +65%
|
||||
# 1024-bit +35%
|
||||
# 2048-bit +18%
|
||||
# 4096-bit +4%
|
||||
|
@ -42,7 +42,7 @@ if ($flavour =~ /32/) {
|
|||
$UMULL= "mullw"; # unsigned multiply low
|
||||
$UMULH= "mulhwu"; # unsigned multiply high
|
||||
$UCMP= "cmplw"; # unsigned compare
|
||||
$SHRI= "srwi"; # unsigned shift right by immediate
|
||||
$SHRI= "srwi"; # unsigned shift right by immediate
|
||||
$PUSH= $ST;
|
||||
$POP= $LD;
|
||||
} elsif ($flavour =~ /64/) {
|
||||
|
@ -62,7 +62,7 @@ if ($flavour =~ /32/) {
|
|||
$UMULL= "mulld"; # unsigned multiply low
|
||||
$UMULH= "mulhdu"; # unsigned multiply high
|
||||
$UCMP= "cmpld"; # unsigned compare
|
||||
$SHRI= "srdi"; # unsigned shift right by immediate
|
||||
$SHRI= "srdi"; # unsigned shift right by immediate
|
||||
$PUSH= $ST;
|
||||
$POP= $LD;
|
||||
} else { die "nonsense $flavour"; }
|
||||
|
@ -147,7 +147,7 @@ $code.=<<___;
|
|||
|
||||
$LD $n0,0($n0) ; pull n0[0] value
|
||||
addi $num,$num,-2 ; adjust $num for counter register
|
||||
|
||||
|
||||
$LD $m0,0($bp) ; m0=bp[0]
|
||||
$LD $aj,0($ap) ; ap[0]
|
||||
addi $tp,$sp,$LOCALS
|
||||
|
@ -206,7 +206,7 @@ L1st:
|
|||
addc $hi1,$hi1,$hi0
|
||||
addze $ovf,$ovf ; upmost overflow bit
|
||||
$ST $hi1,$BNSZ($tp)
|
||||
|
||||
|
||||
li $i,$BNSZ
|
||||
.align 4
|
||||
Louter:
|
||||
|
@ -230,7 +230,7 @@ Louter:
|
|||
$UMULL $nlo,$nj,$m1 ; np[1]*m1
|
||||
addze $hi1,$hi1
|
||||
$UMULH $nhi,$nj,$m1
|
||||
|
||||
|
||||
mtctr $num
|
||||
li $j,`2*$BNSZ`
|
||||
.align 4
|
||||
|
@ -277,7 +277,7 @@ Linner:
|
|||
$UCMP $i,$tj
|
||||
addi $i,$i,$BNSZ
|
||||
ble- Louter
|
||||
|
||||
|
||||
addi $num,$num,2 ; restore $num
|
||||
subfc $j,$j,$j ; j=0 and "clear" XER[CA]
|
||||
addi $tp,$sp,$LOCALS
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
#rsa 2048 bits 0.3036s 0.0085s 3.3 117.1
|
||||
#rsa 4096 bits 2.0040s 0.0299s 0.5 33.4
|
||||
#dsa 512 bits 0.0087s 0.0106s 114.3 94.5
|
||||
#dsa 1024 bits 0.0256s 0.0313s 39.0 32.0
|
||||
#dsa 1024 bits 0.0256s 0.0313s 39.0 32.0
|
||||
#
|
||||
# Same benchmark with this assembler code:
|
||||
#
|
||||
|
@ -68,7 +68,7 @@
|
|||
#rsa 4096 bits 0.3700s 0.0058s 2.7 171.0
|
||||
#dsa 512 bits 0.0016s 0.0020s 610.7 507.1
|
||||
#dsa 1024 bits 0.0047s 0.0058s 212.5 173.2
|
||||
#
|
||||
#
|
||||
# Again, performance increases by at about 75%
|
||||
#
|
||||
# Mac OS X, Apple G5 1.8GHz (Note this is 32 bit code)
|
||||
|
@ -119,7 +119,7 @@ if ($flavour =~ /32/) {
|
|||
$CNTLZ= "cntlzw"; # count leading zeros
|
||||
$SHL= "slw"; # shift left
|
||||
$SHR= "srw"; # unsigned shift right
|
||||
$SHRI= "srwi"; # unsigned shift right by immediate
|
||||
$SHRI= "srwi"; # unsigned shift right by immediate
|
||||
$SHLI= "slwi"; # shift left by immediate
|
||||
$CLRU= "clrlwi"; # clear upper bits
|
||||
$INSR= "insrwi"; # insert right
|
||||
|
@ -143,10 +143,10 @@ if ($flavour =~ /32/) {
|
|||
$CNTLZ= "cntlzd"; # count leading zeros
|
||||
$SHL= "sld"; # shift left
|
||||
$SHR= "srd"; # unsigned shift right
|
||||
$SHRI= "srdi"; # unsigned shift right by immediate
|
||||
$SHRI= "srdi"; # unsigned shift right by immediate
|
||||
$SHLI= "sldi"; # shift left by immediate
|
||||
$CLRU= "clrldi"; # clear upper bits
|
||||
$INSR= "insrdi"; # insert right
|
||||
$INSR= "insrdi"; # insert right
|
||||
$ROTL= "rotldi"; # rotate left by immediate
|
||||
$TR= "td"; # conditional trap
|
||||
} else { die "nonsense $flavour"; }
|
||||
|
@ -183,7 +183,7 @@ $data=<<EOF;
|
|||
# below.
|
||||
# 12/05/03 Suresh Chari
|
||||
# (with lots of help from) Andy Polyakov
|
||||
##
|
||||
##
|
||||
# 1. Initial version 10/20/02 Suresh Chari
|
||||
#
|
||||
#
|
||||
|
@ -196,7 +196,7 @@ $data=<<EOF;
|
|||
# be done in the build process.
|
||||
#
|
||||
# Hand optimized assembly code for the following routines
|
||||
#
|
||||
#
|
||||
# bn_sqr_comba4
|
||||
# bn_sqr_comba8
|
||||
# bn_mul_comba4
|
||||
|
@ -219,10 +219,10 @@ $data=<<EOF;
|
|||
#--------------------------------------------------------------------------
|
||||
#
|
||||
# Defines to be used in the assembly code.
|
||||
#
|
||||
#
|
||||
#.set r0,0 # we use it as storage for value of 0
|
||||
#.set SP,1 # preserved
|
||||
#.set RTOC,2 # preserved
|
||||
#.set RTOC,2 # preserved
|
||||
#.set r3,3 # 1st argument/return value
|
||||
#.set r4,4 # 2nd argument/volatile register
|
||||
#.set r5,5 # 3rd argument/volatile register
|
||||
|
@ -240,7 +240,7 @@ $data=<<EOF;
|
|||
# the first . i.e. for example change ".bn_sqr_comba4"
|
||||
# to "bn_sqr_comba4". This should be automatically done
|
||||
# in the build.
|
||||
|
||||
|
||||
.globl .bn_sqr_comba4
|
||||
.globl .bn_sqr_comba8
|
||||
.globl .bn_mul_comba4
|
||||
|
@ -251,9 +251,9 @@ $data=<<EOF;
|
|||
.globl .bn_sqr_words
|
||||
.globl .bn_mul_words
|
||||
.globl .bn_mul_add_words
|
||||
|
||||
|
||||
# .text section
|
||||
|
||||
|
||||
.machine "any"
|
||||
|
||||
#
|
||||
|
@ -272,8 +272,8 @@ $data=<<EOF;
|
|||
# r3 contains r
|
||||
# r4 contains a
|
||||
#
|
||||
# Freely use registers r5,r6,r7,r8,r9,r10,r11 as follows:
|
||||
#
|
||||
# Freely use registers r5,r6,r7,r8,r9,r10,r11 as follows:
|
||||
#
|
||||
# r5,r6 are the two BN_ULONGs being multiplied.
|
||||
# r7,r8 are the results of the 32x32 giving 64 bit multiply.
|
||||
# r9,r10, r11 are the equivalents of c1,c2, c3.
|
||||
|
@ -282,10 +282,10 @@ $data=<<EOF;
|
|||
#
|
||||
xor r0,r0,r0 # set r0 = 0. Used in the addze
|
||||
# instructions below
|
||||
|
||||
|
||||
#sqr_add_c(a,0,c1,c2,c3)
|
||||
$LD r5,`0*$BNSZ`(r4)
|
||||
$UMULL r9,r5,r5
|
||||
$LD r5,`0*$BNSZ`(r4)
|
||||
$UMULL r9,r5,r5
|
||||
$UMULH r10,r5,r5 #in first iteration. No need
|
||||
#to add since c1=c2=c3=0.
|
||||
# Note c3(r11) is NOT set to 0
|
||||
|
@ -293,20 +293,20 @@ $data=<<EOF;
|
|||
|
||||
$ST r9,`0*$BNSZ`(r3) # r[0]=c1;
|
||||
# sqr_add_c2(a,1,0,c2,c3,c1);
|
||||
$LD r6,`1*$BNSZ`(r4)
|
||||
$LD r6,`1*$BNSZ`(r4)
|
||||
$UMULL r7,r5,r6
|
||||
$UMULH r8,r5,r6
|
||||
|
||||
|
||||
addc r7,r7,r7 # compute (r7,r8)=2*(r7,r8)
|
||||
adde r8,r8,r8
|
||||
addze r9,r0 # catch carry if any.
|
||||
# r9= r0(=0) and carry
|
||||
|
||||
# r9= r0(=0) and carry
|
||||
|
||||
addc r10,r7,r10 # now add to temp result.
|
||||
addze r11,r8 # r8 added to r11 which is 0
|
||||
addze r11,r8 # r8 added to r11 which is 0
|
||||
addze r9,r9
|
||||
|
||||
$ST r10,`1*$BNSZ`(r3) #r[1]=c2;
|
||||
|
||||
$ST r10,`1*$BNSZ`(r3) #r[1]=c2;
|
||||
#sqr_add_c(a,1,c3,c1,c2)
|
||||
$UMULL r7,r6,r6
|
||||
$UMULH r8,r6,r6
|
||||
|
@ -317,23 +317,23 @@ $data=<<EOF;
|
|||
$LD r6,`2*$BNSZ`(r4)
|
||||
$UMULL r7,r5,r6
|
||||
$UMULH r8,r5,r6
|
||||
|
||||
|
||||
addc r7,r7,r7
|
||||
adde r8,r8,r8
|
||||
addze r10,r10
|
||||
|
||||
|
||||
addc r11,r7,r11
|
||||
adde r9,r8,r9
|
||||
addze r10,r10
|
||||
$ST r11,`2*$BNSZ`(r3) #r[2]=c3
|
||||
$ST r11,`2*$BNSZ`(r3) #r[2]=c3
|
||||
#sqr_add_c2(a,3,0,c1,c2,c3);
|
||||
$LD r6,`3*$BNSZ`(r4)
|
||||
$LD r6,`3*$BNSZ`(r4)
|
||||
$UMULL r7,r5,r6
|
||||
$UMULH r8,r5,r6
|
||||
addc r7,r7,r7
|
||||
adde r8,r8,r8
|
||||
addze r11,r0
|
||||
|
||||
|
||||
addc r9,r7,r9
|
||||
adde r10,r8,r10
|
||||
addze r11,r11
|
||||
|
@ -342,7 +342,7 @@ $data=<<EOF;
|
|||
$LD r6,`2*$BNSZ`(r4)
|
||||
$UMULL r7,r5,r6
|
||||
$UMULH r8,r5,r6
|
||||
|
||||
|
||||
addc r7,r7,r7
|
||||
adde r8,r8,r8
|
||||
addze r11,r11
|
||||
|
@ -357,31 +357,31 @@ $data=<<EOF;
|
|||
adde r11,r8,r11
|
||||
addze r9,r0
|
||||
#sqr_add_c2(a,3,1,c2,c3,c1);
|
||||
$LD r6,`3*$BNSZ`(r4)
|
||||
$LD r6,`3*$BNSZ`(r4)
|
||||
$UMULL r7,r5,r6
|
||||
$UMULH r8,r5,r6
|
||||
addc r7,r7,r7
|
||||
adde r8,r8,r8
|
||||
addze r9,r9
|
||||
|
||||
|
||||
addc r10,r7,r10
|
||||
adde r11,r8,r11
|
||||
addze r9,r9
|
||||
$ST r10,`4*$BNSZ`(r3) #r[4]=c2
|
||||
#sqr_add_c2(a,3,2,c3,c1,c2);
|
||||
$LD r5,`2*$BNSZ`(r4)
|
||||
$LD r5,`2*$BNSZ`(r4)
|
||||
$UMULL r7,r5,r6
|
||||
$UMULH r8,r5,r6
|
||||
addc r7,r7,r7
|
||||
adde r8,r8,r8
|
||||
addze r10,r0
|
||||
|
||||
|
||||
addc r11,r7,r11
|
||||
adde r9,r8,r9
|
||||
addze r10,r10
|
||||
$ST r11,`5*$BNSZ`(r3) #r[5] = c3
|
||||
#sqr_add_c(a,3,c1,c2,c3);
|
||||
$UMULL r7,r6,r6
|
||||
$UMULL r7,r6,r6
|
||||
$UMULH r8,r6,r6
|
||||
addc r9,r7,r9
|
||||
adde r10,r8,r10
|
||||
|
@ -396,7 +396,7 @@ $data=<<EOF;
|
|||
# for the gcc compiler. This should be automatically
|
||||
# done in the build
|
||||
#
|
||||
|
||||
|
||||
.align 4
|
||||
.bn_sqr_comba8:
|
||||
#
|
||||
|
@ -408,15 +408,15 @@ $data=<<EOF;
|
|||
# r3 contains r
|
||||
# r4 contains a
|
||||
#
|
||||
# Freely use registers r5,r6,r7,r8,r9,r10,r11 as follows:
|
||||
#
|
||||
# Freely use registers r5,r6,r7,r8,r9,r10,r11 as follows:
|
||||
#
|
||||
# r5,r6 are the two BN_ULONGs being multiplied.
|
||||
# r7,r8 are the results of the 32x32 giving 64 bit multiply.
|
||||
# r9,r10, r11 are the equivalents of c1,c2, c3.
|
||||
#
|
||||
# Possible optimization of loading all 8 longs of a into registers
|
||||
# doesnt provide any speedup
|
||||
#
|
||||
#
|
||||
|
||||
xor r0,r0,r0 #set r0 = 0.Used in addze
|
||||
#instructions below.
|
||||
|
@ -429,18 +429,18 @@ $data=<<EOF;
|
|||
#sqr_add_c2(a,1,0,c2,c3,c1);
|
||||
$LD r6,`1*$BNSZ`(r4)
|
||||
$UMULL r7,r5,r6
|
||||
$UMULH r8,r5,r6
|
||||
|
||||
$UMULH r8,r5,r6
|
||||
|
||||
addc r10,r7,r10 #add the two register number
|
||||
adde r11,r8,r0 # (r8,r7) to the three register
|
||||
addze r9,r0 # number (r9,r11,r10).NOTE:r0=0
|
||||
|
||||
|
||||
addc r10,r7,r10 #add the two register number
|
||||
adde r11,r8,r11 # (r8,r7) to the three register
|
||||
addze r9,r9 # number (r9,r11,r10).
|
||||
|
||||
|
||||
$ST r10,`1*$BNSZ`(r3) # r[1]=c2
|
||||
|
||||
|
||||
#sqr_add_c(a,1,c3,c1,c2);
|
||||
$UMULL r7,r6,r6
|
||||
$UMULH r8,r6,r6
|
||||
|
@ -451,25 +451,25 @@ $data=<<EOF;
|
|||
$LD r6,`2*$BNSZ`(r4)
|
||||
$UMULL r7,r5,r6
|
||||
$UMULH r8,r5,r6
|
||||
|
||||
|
||||
addc r11,r7,r11
|
||||
adde r9,r8,r9
|
||||
addze r10,r10
|
||||
|
||||
|
||||
addc r11,r7,r11
|
||||
adde r9,r8,r9
|
||||
addze r10,r10
|
||||
|
||||
|
||||
$ST r11,`2*$BNSZ`(r3) #r[2]=c3
|
||||
#sqr_add_c2(a,3,0,c1,c2,c3);
|
||||
$LD r6,`3*$BNSZ`(r4) #r6 = a[3]. r5 is already a[0].
|
||||
$UMULL r7,r5,r6
|
||||
$UMULH r8,r5,r6
|
||||
|
||||
|
||||
addc r9,r7,r9
|
||||
adde r10,r8,r10
|
||||
addze r11,r0
|
||||
|
||||
|
||||
addc r9,r7,r9
|
||||
adde r10,r8,r10
|
||||
addze r11,r11
|
||||
|
@ -478,20 +478,20 @@ $data=<<EOF;
|
|||
$LD r6,`2*$BNSZ`(r4)
|
||||
$UMULL r7,r5,r6
|
||||
$UMULH r8,r5,r6
|
||||
|
||||
|
||||
addc r9,r7,r9
|
||||
adde r10,r8,r10
|
||||
addze r11,r11
|
||||
|
||||
|
||||
addc r9,r7,r9
|
||||
adde r10,r8,r10
|
||||
addze r11,r11
|
||||
|
||||
|
||||
$ST r9,`3*$BNSZ`(r3) #r[3]=c1;
|
||||
#sqr_add_c(a,2,c2,c3,c1);
|
||||
$UMULL r7,r6,r6
|
||||
$UMULH r8,r6,r6
|
||||
|
||||
|
||||
addc r10,r7,r10
|
||||
adde r11,r8,r11
|
||||
addze r9,r0
|
||||
|
@ -499,11 +499,11 @@ $data=<<EOF;
|
|||
$LD r6,`3*$BNSZ`(r4)
|
||||
$UMULL r7,r5,r6
|
||||
$UMULH r8,r5,r6
|
||||
|
||||
|
||||
addc r10,r7,r10
|
||||
adde r11,r8,r11
|
||||
addze r9,r9
|
||||
|
||||
|
||||
addc r10,r7,r10
|
||||
adde r11,r8,r11
|
||||
addze r9,r9
|
||||
|
@ -512,11 +512,11 @@ $data=<<EOF;
|
|||
$LD r6,`4*$BNSZ`(r4)
|
||||
$UMULL r7,r5,r6
|
||||
$UMULH r8,r5,r6
|
||||
|
||||
|
||||
addc r10,r7,r10
|
||||
adde r11,r8,r11
|
||||
addze r9,r9
|
||||
|
||||
|
||||
addc r10,r7,r10
|
||||
adde r11,r8,r11
|
||||
addze r9,r9
|
||||
|
@ -525,11 +525,11 @@ $data=<<EOF;
|
|||
$LD r6,`5*$BNSZ`(r4)
|
||||
$UMULL r7,r5,r6
|
||||
$UMULH r8,r5,r6
|
||||
|
||||
|
||||
addc r11,r7,r11
|
||||
adde r9,r8,r9
|
||||
addze r10,r0
|
||||
|
||||
|
||||
addc r11,r7,r11
|
||||
adde r9,r8,r9
|
||||
addze r10,r10
|
||||
|
@ -538,11 +538,11 @@ $data=<<EOF;
|
|||
$LD r6,`4*$BNSZ`(r4)
|
||||
$UMULL r7,r5,r6
|
||||
$UMULH r8,r5,r6
|
||||
|
||||
|
||||
addc r11,r7,r11
|
||||
adde r9,r8,r9
|
||||
addze r10,r10
|
||||
|
||||
|
||||
addc r11,r7,r11
|
||||
adde r9,r8,r9
|
||||
addze r10,r10
|
||||
|
@ -551,11 +551,11 @@ $data=<<EOF;
|
|||
$LD r6,`3*$BNSZ`(r4)
|
||||
$UMULL r7,r5,r6
|
||||
$UMULH r8,r5,r6
|
||||
|
||||
|
||||
addc r11,r7,r11
|
||||
adde r9,r8,r9
|
||||
addze r10,r10
|
||||
|
||||
|
||||
addc r11,r7,r11
|
||||
adde r9,r8,r9
|
||||
addze r10,r10
|
||||
|
@ -570,11 +570,11 @@ $data=<<EOF;
|
|||
$LD r6,`4*$BNSZ`(r4)
|
||||
$UMULL r7,r5,r6
|
||||
$UMULH r8,r5,r6
|
||||
|
||||
|
||||
addc r9,r7,r9
|
||||
adde r10,r8,r10
|
||||
addze r11,r11
|
||||
|
||||
|
||||
addc r9,r7,r9
|
||||
adde r10,r8,r10
|
||||
addze r11,r11
|
||||
|
@ -583,11 +583,11 @@ $data=<<EOF;
|
|||
$LD r6,`5*$BNSZ`(r4)
|
||||
$UMULL r7,r5,r6
|
||||
$UMULH r8,r5,r6
|
||||
|
||||
|
||||
addc r9,r7,r9
|
||||
adde r10,r8,r10
|
||||
addze r11,r11
|
||||
|
||||
|
||||
addc r9,r7,r9
|
||||
adde r10,r8,r10
|
||||
addze r11,r11
|
||||
|
@ -607,7 +607,7 @@ $data=<<EOF;
|
|||
$LD r6,`7*$BNSZ`(r4)
|
||||
$UMULL r7,r5,r6
|
||||
$UMULH r8,r5,r6
|
||||
|
||||
|
||||
addc r10,r7,r10
|
||||
adde r11,r8,r11
|
||||
addze r9,r0
|
||||
|
@ -619,7 +619,7 @@ $data=<<EOF;
|
|||
$LD r6,`6*$BNSZ`(r4)
|
||||
$UMULL r7,r5,r6
|
||||
$UMULH r8,r5,r6
|
||||
|
||||
|
||||
addc r10,r7,r10
|
||||
adde r11,r8,r11
|
||||
addze r9,r9
|
||||
|
@ -642,7 +642,7 @@ $data=<<EOF;
|
|||
$LD r6,`4*$BNSZ`(r4)
|
||||
$UMULL r7,r5,r6
|
||||
$UMULH r8,r5,r6
|
||||
|
||||
|
||||
addc r10,r7,r10
|
||||
adde r11,r8,r11
|
||||
addze r9,r9
|
||||
|
@ -674,7 +674,7 @@ $data=<<EOF;
|
|||
addc r11,r7,r11
|
||||
adde r9,r8,r9
|
||||
addze r10,r10
|
||||
|
||||
|
||||
addc r11,r7,r11
|
||||
adde r9,r8,r9
|
||||
addze r10,r10
|
||||
|
@ -694,7 +694,7 @@ $data=<<EOF;
|
|||
$LD r5,`2*$BNSZ`(r4)
|
||||
$UMULL r7,r5,r6
|
||||
$UMULH r8,r5,r6
|
||||
|
||||
|
||||
addc r9,r7,r9
|
||||
adde r10,r8,r10
|
||||
addze r11,r0
|
||||
|
@ -791,7 +791,7 @@ $data=<<EOF;
|
|||
adde r10,r8,r10
|
||||
addze r11,r11
|
||||
$ST r9,`12*$BNSZ`(r3) #r[12]=c1;
|
||||
|
||||
|
||||
#sqr_add_c2(a,7,6,c2,c3,c1)
|
||||
$LD r5,`6*$BNSZ`(r4)
|
||||
$UMULL r7,r5,r6
|
||||
|
@ -836,21 +836,21 @@ $data=<<EOF;
|
|||
#
|
||||
xor r0,r0,r0 #r0=0. Used in addze below.
|
||||
#mul_add_c(a[0],b[0],c1,c2,c3);
|
||||
$LD r6,`0*$BNSZ`(r4)
|
||||
$LD r7,`0*$BNSZ`(r5)
|
||||
$UMULL r10,r6,r7
|
||||
$UMULH r11,r6,r7
|
||||
$LD r6,`0*$BNSZ`(r4)
|
||||
$LD r7,`0*$BNSZ`(r5)
|
||||
$UMULL r10,r6,r7
|
||||
$UMULH r11,r6,r7
|
||||
$ST r10,`0*$BNSZ`(r3) #r[0]=c1
|
||||
#mul_add_c(a[0],b[1],c2,c3,c1);
|
||||
$LD r7,`1*$BNSZ`(r5)
|
||||
$LD r7,`1*$BNSZ`(r5)
|
||||
$UMULL r8,r6,r7
|
||||
$UMULH r9,r6,r7
|
||||
addc r11,r8,r11
|
||||
adde r12,r9,r0
|
||||
addze r10,r0
|
||||
#mul_add_c(a[1],b[0],c2,c3,c1);
|
||||
$LD r6, `1*$BNSZ`(r4)
|
||||
$LD r7, `0*$BNSZ`(r5)
|
||||
$LD r6, `1*$BNSZ`(r4)
|
||||
$LD r7, `0*$BNSZ`(r5)
|
||||
$UMULL r8,r6,r7
|
||||
$UMULH r9,r6,r7
|
||||
addc r11,r8,r11
|
||||
|
@ -858,23 +858,23 @@ $data=<<EOF;
|
|||
addze r10,r10
|
||||
$ST r11,`1*$BNSZ`(r3) #r[1]=c2
|
||||
#mul_add_c(a[2],b[0],c3,c1,c2);
|
||||
$LD r6,`2*$BNSZ`(r4)
|
||||
$LD r6,`2*$BNSZ`(r4)
|
||||
$UMULL r8,r6,r7
|
||||
$UMULH r9,r6,r7
|
||||
addc r12,r8,r12
|
||||
adde r10,r9,r10
|
||||
addze r11,r0
|
||||
#mul_add_c(a[1],b[1],c3,c1,c2);
|
||||
$LD r6,`1*$BNSZ`(r4)
|
||||
$LD r7,`1*$BNSZ`(r5)
|
||||
$LD r6,`1*$BNSZ`(r4)
|
||||
$LD r7,`1*$BNSZ`(r5)
|
||||
$UMULL r8,r6,r7
|
||||
$UMULH r9,r6,r7
|
||||
addc r12,r8,r12
|
||||
adde r10,r9,r10
|
||||
addze r11,r11
|
||||
#mul_add_c(a[0],b[2],c3,c1,c2);
|
||||
$LD r6,`0*$BNSZ`(r4)
|
||||
$LD r7,`2*$BNSZ`(r5)
|
||||
$LD r6,`0*$BNSZ`(r4)
|
||||
$LD r7,`2*$BNSZ`(r5)
|
||||
$UMULL r8,r6,r7
|
||||
$UMULH r9,r6,r7
|
||||
addc r12,r8,r12
|
||||
|
@ -882,7 +882,7 @@ $data=<<EOF;
|
|||
addze r11,r11
|
||||
$ST r12,`2*$BNSZ`(r3) #r[2]=c3
|
||||
#mul_add_c(a[0],b[3],c1,c2,c3);
|
||||
$LD r7,`3*$BNSZ`(r5)
|
||||
$LD r7,`3*$BNSZ`(r5)
|
||||
$UMULL r8,r6,r7
|
||||
$UMULH r9,r6,r7
|
||||
addc r10,r8,r10
|
||||
|
@ -914,7 +914,7 @@ $data=<<EOF;
|
|||
addze r12,r12
|
||||
$ST r10,`3*$BNSZ`(r3) #r[3]=c1
|
||||
#mul_add_c(a[3],b[1],c2,c3,c1);
|
||||
$LD r7,`1*$BNSZ`(r5)
|
||||
$LD r7,`1*$BNSZ`(r5)
|
||||
$UMULL r8,r6,r7
|
||||
$UMULH r9,r6,r7
|
||||
addc r11,r8,r11
|
||||
|
@ -938,7 +938,7 @@ $data=<<EOF;
|
|||
addze r10,r10
|
||||
$ST r11,`4*$BNSZ`(r3) #r[4]=c2
|
||||
#mul_add_c(a[2],b[3],c3,c1,c2);
|
||||
$LD r6,`2*$BNSZ`(r4)
|
||||
$LD r6,`2*$BNSZ`(r4)
|
||||
$UMULL r8,r6,r7
|
||||
$UMULH r9,r6,r7
|
||||
addc r12,r8,r12
|
||||
|
@ -954,7 +954,7 @@ $data=<<EOF;
|
|||
addze r11,r11
|
||||
$ST r12,`5*$BNSZ`(r3) #r[5]=c3
|
||||
#mul_add_c(a[3],b[3],c1,c2,c3);
|
||||
$LD r7,`3*$BNSZ`(r5)
|
||||
$LD r7,`3*$BNSZ`(r5)
|
||||
$UMULL r8,r6,r7
|
||||
$UMULH r9,r6,r7
|
||||
addc r10,r8,r10
|
||||
|
@ -970,7 +970,7 @@ $data=<<EOF;
|
|||
# for the gcc compiler. This should be automatically
|
||||
# done in the build
|
||||
#
|
||||
|
||||
|
||||
.align 4
|
||||
.bn_mul_comba8:
|
||||
#
|
||||
|
@ -985,7 +985,7 @@ $data=<<EOF;
|
|||
# r10, r11, r12 are the equivalents of c1, c2, and c3.
|
||||
#
|
||||
xor r0,r0,r0 #r0=0. Used in addze below.
|
||||
|
||||
|
||||
#mul_add_c(a[0],b[0],c1,c2,c3);
|
||||
$LD r6,`0*$BNSZ`(r4) #a[0]
|
||||
$LD r7,`0*$BNSZ`(r5) #b[0]
|
||||
|
@ -1047,7 +1047,7 @@ $data=<<EOF;
|
|||
addc r10,r10,r8
|
||||
adde r11,r11,r9
|
||||
addze r12,r12
|
||||
|
||||
|
||||
#mul_add_c(a[2],b[1],c1,c2,c3);
|
||||
$LD r6,`2*$BNSZ`(r4)
|
||||
$LD r7,`1*$BNSZ`(r5)
|
||||
|
@ -1113,7 +1113,7 @@ $data=<<EOF;
|
|||
adde r10,r10,r9
|
||||
addze r11,r0
|
||||
#mul_add_c(a[1],b[4],c3,c1,c2);
|
||||
$LD r6,`1*$BNSZ`(r4)
|
||||
$LD r6,`1*$BNSZ`(r4)
|
||||
$LD r7,`4*$BNSZ`(r5)
|
||||
$UMULL r8,r6,r7
|
||||
$UMULH r9,r6,r7
|
||||
|
@ -1121,7 +1121,7 @@ $data=<<EOF;
|
|||
adde r10,r10,r9
|
||||
addze r11,r11
|
||||
#mul_add_c(a[2],b[3],c3,c1,c2);
|
||||
$LD r6,`2*$BNSZ`(r4)
|
||||
$LD r6,`2*$BNSZ`(r4)
|
||||
$LD r7,`3*$BNSZ`(r5)
|
||||
$UMULL r8,r6,r7
|
||||
$UMULH r9,r6,r7
|
||||
|
@ -1129,7 +1129,7 @@ $data=<<EOF;
|
|||
adde r10,r10,r9
|
||||
addze r11,r11
|
||||
#mul_add_c(a[3],b[2],c3,c1,c2);
|
||||
$LD r6,`3*$BNSZ`(r4)
|
||||
$LD r6,`3*$BNSZ`(r4)
|
||||
$LD r7,`2*$BNSZ`(r5)
|
||||
$UMULL r8,r6,r7
|
||||
$UMULH r9,r6,r7
|
||||
|
@ -1137,7 +1137,7 @@ $data=<<EOF;
|
|||
adde r10,r10,r9
|
||||
addze r11,r11
|
||||
#mul_add_c(a[4],b[1],c3,c1,c2);
|
||||
$LD r6,`4*$BNSZ`(r4)
|
||||
$LD r6,`4*$BNSZ`(r4)
|
||||
$LD r7,`1*$BNSZ`(r5)
|
||||
$UMULL r8,r6,r7
|
||||
$UMULH r9,r6,r7
|
||||
|
@ -1145,7 +1145,7 @@ $data=<<EOF;
|
|||
adde r10,r10,r9
|
||||
addze r11,r11
|
||||
#mul_add_c(a[5],b[0],c3,c1,c2);
|
||||
$LD r6,`5*$BNSZ`(r4)
|
||||
$LD r6,`5*$BNSZ`(r4)
|
||||
$LD r7,`0*$BNSZ`(r5)
|
||||
$UMULL r8,r6,r7
|
||||
$UMULH r9,r6,r7
|
||||
|
@ -1533,7 +1533,7 @@ $data=<<EOF;
|
|||
addi r3,r3,-$BNSZ
|
||||
addi r5,r5,-$BNSZ
|
||||
mtctr r6
|
||||
Lppcasm_sub_mainloop:
|
||||
Lppcasm_sub_mainloop:
|
||||
$LDU r7,$BNSZ(r4)
|
||||
$LDU r8,$BNSZ(r5)
|
||||
subfe r6,r8,r7 # r6 = r7+carry bit + onescomplement(r8)
|
||||
|
@ -1541,7 +1541,7 @@ Lppcasm_sub_mainloop:
|
|||
# is r7-r8 -1 as we need.
|
||||
$STU r6,$BNSZ(r3)
|
||||
bdnz- Lppcasm_sub_mainloop
|
||||
Lppcasm_sub_adios:
|
||||
Lppcasm_sub_adios:
|
||||
subfze r3,r0 # if carry bit is set then r3 = 0 else -1
|
||||
andi. r3,r3,1 # keep only last bit.
|
||||
blr
|
||||
|
@ -1578,13 +1578,13 @@ Lppcasm_sub_adios:
|
|||
addi r3,r3,-$BNSZ
|
||||
addi r5,r5,-$BNSZ
|
||||
mtctr r6
|
||||
Lppcasm_add_mainloop:
|
||||
Lppcasm_add_mainloop:
|
||||
$LDU r7,$BNSZ(r4)
|
||||
$LDU r8,$BNSZ(r5)
|
||||
adde r8,r7,r8
|
||||
$STU r8,$BNSZ(r3)
|
||||
bdnz- Lppcasm_add_mainloop
|
||||
Lppcasm_add_adios:
|
||||
Lppcasm_add_adios:
|
||||
addze r3,r0 #return carry bit.
|
||||
blr
|
||||
|
||||
|
@ -1603,11 +1603,11 @@ Lppcasm_add_adios:
|
|||
# the PPC instruction to count leading zeros instead
|
||||
# of call to num_bits_word. Since this was compiled
|
||||
# only at level -O2 we can possibly squeeze it more?
|
||||
#
|
||||
#
|
||||
# r3 = h
|
||||
# r4 = l
|
||||
# r5 = d
|
||||
|
||||
|
||||
$UCMPI 0,r5,0 # compare r5 and 0
|
||||
bne Lppcasm_div1 # proceed if d!=0
|
||||
li r3,-1 # d=0 return -1
|
||||
|
@ -1623,7 +1623,7 @@ Lppcasm_div1:
|
|||
Lppcasm_div2:
|
||||
$UCMP 0,r3,r5 #h>=d?
|
||||
blt Lppcasm_div3 #goto Lppcasm_div3 if not
|
||||
subf r3,r5,r3 #h-=d ;
|
||||
subf r3,r5,r3 #h-=d ;
|
||||
Lppcasm_div3: #r7 = BN_BITS2-i. so r7=i
|
||||
cmpi 0,0,r7,0 # is (i == 0)?
|
||||
beq Lppcasm_div4
|
||||
|
@ -1638,7 +1638,7 @@ Lppcasm_div4:
|
|||
# as it saves registers.
|
||||
li r6,2 #r6=2
|
||||
mtctr r6 #counter will be in count.
|
||||
Lppcasm_divouterloop:
|
||||
Lppcasm_divouterloop:
|
||||
$SHRI r8,r3,`$BITS/2` #r8 = (h>>BN_BITS4)
|
||||
$SHRI r11,r4,`$BITS/2` #r11= (l&BN_MASK2h)>>BN_BITS4
|
||||
# compute here for innerloop.
|
||||
|
@ -1646,7 +1646,7 @@ Lppcasm_divouterloop:
|
|||
bne Lppcasm_div5 # goto Lppcasm_div5 if not
|
||||
|
||||
li r8,-1
|
||||
$CLRU r8,r8,`$BITS/2` #q = BN_MASK2l
|
||||
$CLRU r8,r8,`$BITS/2` #q = BN_MASK2l
|
||||
b Lppcasm_div6
|
||||
Lppcasm_div5:
|
||||
$UDIV r8,r3,r9 #q = h/dh
|
||||
|
@ -1654,7 +1654,7 @@ Lppcasm_div6:
|
|||
$UMULL r12,r9,r8 #th = q*dh
|
||||
$CLRU r10,r5,`$BITS/2` #r10=dl
|
||||
$UMULL r6,r8,r10 #tl = q*dl
|
||||
|
||||
|
||||
Lppcasm_divinnerloop:
|
||||
subf r10,r12,r3 #t = h -th
|
||||
$SHRI r7,r10,`$BITS/2` #r7= (t &BN_MASK2H), sort of...
|
||||
|
@ -1727,7 +1727,7 @@ Lppcasm_div9:
|
|||
addi r4,r4,-$BNSZ
|
||||
addi r3,r3,-$BNSZ
|
||||
mtctr r5
|
||||
Lppcasm_sqr_mainloop:
|
||||
Lppcasm_sqr_mainloop:
|
||||
#sqr(r[0],r[1],a[0]);
|
||||
$LDU r6,$BNSZ(r4)
|
||||
$UMULL r7,r6,r6
|
||||
|
@ -1735,7 +1735,7 @@ Lppcasm_sqr_mainloop:
|
|||
$STU r7,$BNSZ(r3)
|
||||
$STU r8,$BNSZ(r3)
|
||||
bdnz- Lppcasm_sqr_mainloop
|
||||
Lppcasm_sqr_adios:
|
||||
Lppcasm_sqr_adios:
|
||||
blr
|
||||
|
||||
#
|
||||
|
@ -1745,7 +1745,7 @@ Lppcasm_sqr_adios:
|
|||
# done in the build
|
||||
#
|
||||
|
||||
.align 4
|
||||
.align 4
|
||||
.bn_mul_words:
|
||||
#
|
||||
# BN_ULONG bn_mul_words(BN_ULONG *rp, BN_ULONG *ap, int num, BN_ULONG w)
|
||||
|
@ -1759,7 +1759,7 @@ Lppcasm_sqr_adios:
|
|||
rlwinm. r7,r5,30,2,31 # num >> 2
|
||||
beq Lppcasm_mw_REM
|
||||
mtctr r7
|
||||
Lppcasm_mw_LOOP:
|
||||
Lppcasm_mw_LOOP:
|
||||
#mul(rp[0],ap[0],w,c1);
|
||||
$LD r8,`0*$BNSZ`(r4)
|
||||
$UMULL r9,r6,r8
|
||||
|
@ -1771,7 +1771,7 @@ Lppcasm_mw_LOOP:
|
|||
#using adde.
|
||||
$ST r9,`0*$BNSZ`(r3)
|
||||
#mul(rp[1],ap[1],w,c1);
|
||||
$LD r8,`1*$BNSZ`(r4)
|
||||
$LD r8,`1*$BNSZ`(r4)
|
||||
$UMULL r11,r6,r8
|
||||
$UMULH r12,r6,r8
|
||||
adde r11,r11,r10
|
||||
|
@ -1792,7 +1792,7 @@ Lppcasm_mw_LOOP:
|
|||
addze r12,r12 #this spin we collect carry into
|
||||
#r12
|
||||
$ST r11,`3*$BNSZ`(r3)
|
||||
|
||||
|
||||
addi r3,r3,`4*$BNSZ`
|
||||
addi r4,r4,`4*$BNSZ`
|
||||
bdnz- Lppcasm_mw_LOOP
|
||||
|
@ -1808,25 +1808,25 @@ Lppcasm_mw_REM:
|
|||
addze r10,r10
|
||||
$ST r9,`0*$BNSZ`(r3)
|
||||
addi r12,r10,0
|
||||
|
||||
|
||||
addi r5,r5,-1
|
||||
cmpli 0,0,r5,0
|
||||
beq Lppcasm_mw_OVER
|
||||
|
||||
|
||||
|
||||
#mul(rp[1],ap[1],w,c1);
|
||||
$LD r8,`1*$BNSZ`(r4)
|
||||
$LD r8,`1*$BNSZ`(r4)
|
||||
$UMULL r9,r6,r8
|
||||
$UMULH r10,r6,r8
|
||||
addc r9,r9,r12
|
||||
addze r10,r10
|
||||
$ST r9,`1*$BNSZ`(r3)
|
||||
addi r12,r10,0
|
||||
|
||||
|
||||
addi r5,r5,-1
|
||||
cmpli 0,0,r5,0
|
||||
beq Lppcasm_mw_OVER
|
||||
|
||||
|
||||
#mul_add(rp[2],ap[2],w,c1);
|
||||
$LD r8,`2*$BNSZ`(r4)
|
||||
$UMULL r9,r6,r8
|
||||
|
@ -1835,8 +1835,8 @@ Lppcasm_mw_REM:
|
|||
addze r10,r10
|
||||
$ST r9,`2*$BNSZ`(r3)
|
||||
addi r12,r10,0
|
||||
|
||||
Lppcasm_mw_OVER:
|
||||
|
||||
Lppcasm_mw_OVER:
|
||||
addi r3,r12,0
|
||||
blr
|
||||
|
||||
|
@ -1860,11 +1860,11 @@ Lppcasm_mw_OVER:
|
|||
# empirical evidence suggests that unrolled version performs best!!
|
||||
#
|
||||
xor r0,r0,r0 #r0 = 0
|
||||
xor r12,r12,r12 #r12 = 0 . used for carry
|
||||
xor r12,r12,r12 #r12 = 0 . used for carry
|
||||
rlwinm. r7,r5,30,2,31 # num >> 2
|
||||
beq Lppcasm_maw_leftover # if (num < 4) go LPPCASM_maw_leftover
|
||||
mtctr r7
|
||||
Lppcasm_maw_mainloop:
|
||||
Lppcasm_maw_mainloop:
|
||||
#mul_add(rp[0],ap[0],w,c1);
|
||||
$LD r8,`0*$BNSZ`(r4)
|
||||
$LD r11,`0*$BNSZ`(r3)
|
||||
|
@ -1880,9 +1880,9 @@ Lppcasm_maw_mainloop:
|
|||
#by multiply and will be collected
|
||||
#in the next spin
|
||||
$ST r9,`0*$BNSZ`(r3)
|
||||
|
||||
|
||||
#mul_add(rp[1],ap[1],w,c1);
|
||||
$LD r8,`1*$BNSZ`(r4)
|
||||
$LD r8,`1*$BNSZ`(r4)
|
||||
$LD r9,`1*$BNSZ`(r3)
|
||||
$UMULL r11,r6,r8
|
||||
$UMULH r12,r6,r8
|
||||
|
@ -1891,7 +1891,7 @@ Lppcasm_maw_mainloop:
|
|||
addc r11,r11,r9
|
||||
#addze r12,r12
|
||||
$ST r11,`1*$BNSZ`(r3)
|
||||
|
||||
|
||||
#mul_add(rp[2],ap[2],w,c1);
|
||||
$LD r8,`2*$BNSZ`(r4)
|
||||
$UMULL r9,r6,r8
|
||||
|
@ -1902,7 +1902,7 @@ Lppcasm_maw_mainloop:
|
|||
addc r9,r9,r11
|
||||
#addze r10,r10
|
||||
$ST r9,`2*$BNSZ`(r3)
|
||||
|
||||
|
||||
#mul_add(rp[3],ap[3],w,c1);
|
||||
$LD r8,`3*$BNSZ`(r4)
|
||||
$UMULL r11,r6,r8
|
||||
|
@ -1916,7 +1916,7 @@ Lppcasm_maw_mainloop:
|
|||
addi r3,r3,`4*$BNSZ`
|
||||
addi r4,r4,`4*$BNSZ`
|
||||
bdnz- Lppcasm_maw_mainloop
|
||||
|
||||
|
||||
Lppcasm_maw_leftover:
|
||||
andi. r5,r5,0x3
|
||||
beq Lppcasm_maw_adios
|
||||
|
@ -1933,10 +1933,10 @@ Lppcasm_maw_leftover:
|
|||
addc r9,r9,r12
|
||||
addze r12,r10
|
||||
$ST r9,0(r3)
|
||||
|
||||
|
||||
bdz Lppcasm_maw_adios
|
||||
#mul_add(rp[1],ap[1],w,c1);
|
||||
$LDU r8,$BNSZ(r4)
|
||||
$LDU r8,$BNSZ(r4)
|
||||
$UMULL r9,r6,r8
|
||||
$UMULH r10,r6,r8
|
||||
$LDU r11,$BNSZ(r3)
|
||||
|
@ -1945,7 +1945,7 @@ Lppcasm_maw_leftover:
|
|||
addc r9,r9,r12
|
||||
addze r12,r10
|
||||
$ST r9,0(r3)
|
||||
|
||||
|
||||
bdz Lppcasm_maw_adios
|
||||
#mul_add(rp[2],ap[2],w,c1);
|
||||
$LDU r8,$BNSZ(r4)
|
||||
|
@ -1957,8 +1957,8 @@ Lppcasm_maw_leftover:
|
|||
addc r9,r9,r12
|
||||
addze r12,r10
|
||||
$ST r9,0(r3)
|
||||
|
||||
Lppcasm_maw_adios:
|
||||
|
||||
Lppcasm_maw_adios:
|
||||
addi r3,r12,0
|
||||
blr
|
||||
.align 4
|
||||
|
|
|
@ -154,7 +154,7 @@ $T0a="f24"; $T0b="f25";
|
|||
$T1a="f26"; $T1b="f27";
|
||||
$T2a="f28"; $T2b="f29";
|
||||
$T3a="f30"; $T3b="f31";
|
||||
|
||||
|
||||
# sp----------->+-------------------------------+
|
||||
# | saved sp |
|
||||
# +-------------------------------+
|
||||
|
@ -189,7 +189,7 @@ $T3a="f30"; $T3b="f31";
|
|||
# . .
|
||||
# . .
|
||||
# +-------------------------------+
|
||||
|
||||
|
||||
$code=<<___;
|
||||
.machine "any"
|
||||
.text
|
||||
|
@ -260,7 +260,7 @@ $code.=<<___;
|
|||
li $i,-64
|
||||
add $nap_d,$tp,$num
|
||||
and $nap_d,$nap_d,$i ; align to 64 bytes
|
||||
|
||||
|
||||
mulld $t7,$a0,$t3 ; ap[0]*bp[0]
|
||||
; nap_d is off by 1, because it's used with stfdu/lfdu
|
||||
addi $nap_d,$nap_d,-8
|
||||
|
@ -416,7 +416,7 @@ $code.=<<___;
|
|||
stfd $T2b,`$FRAME+40`($sp)
|
||||
stfd $T3a,`$FRAME+48`($sp)
|
||||
stfd $T3b,`$FRAME+56`($sp)
|
||||
|
||||
|
||||
.align 5
|
||||
L1st:
|
||||
___
|
||||
|
@ -562,7 +562,7 @@ $code.=<<___;
|
|||
std $t0,8($tp) ; tp[j-1]
|
||||
stdu $t4,16($tp) ; tp[j]
|
||||
bdnz- L1st
|
||||
|
||||
|
||||
fctid $dota,$dota
|
||||
fctid $dotb,$dotb
|
||||
|
||||
|
@ -614,7 +614,7 @@ $code.=<<___;
|
|||
|
||||
slwi $t7,$num,2
|
||||
subf $nap_d,$t7,$nap_d ; rewind pointer
|
||||
|
||||
|
||||
li $i,8 ; i=1
|
||||
.align 5
|
||||
Louter:
|
||||
|
@ -741,7 +741,7 @@ $code.=<<___;
|
|||
stfd $T2b,`$FRAME+40`($sp)
|
||||
stfd $T3a,`$FRAME+48`($sp)
|
||||
stfd $T3b,`$FRAME+56`($sp)
|
||||
|
||||
|
||||
.align 5
|
||||
Linner:
|
||||
fmul $T1a,$A1,$ba
|
||||
|
@ -857,7 +857,7 @@ $code.=<<___;
|
|||
std $t3,-16($tp) ; tp[j-1]
|
||||
std $t5,-8($tp) ; tp[j]
|
||||
bdnz- Linner
|
||||
|
||||
|
||||
fctid $dota,$dota
|
||||
fctid $dotb,$dotb
|
||||
ld $t0,`$FRAME+0`($sp)
|
||||
|
@ -933,7 +933,7 @@ $code.=<<___;
|
|||
cmpw $i,$num
|
||||
blt- Louter
|
||||
___
|
||||
|
||||
|
||||
$code.=<<___ if ($SIZE_T==8);
|
||||
subf $np,$num,$np ; rewind np
|
||||
addi $j,$j,1 ; restore counter
|
||||
|
@ -1048,7 +1048,7 @@ Lcopy: ; copy or in-place refresh
|
|||
stdu $i,16($tp)
|
||||
bdnz- Lcopy
|
||||
___
|
||||
|
||||
|
||||
$code.=<<___;
|
||||
$POP $i,0($sp)
|
||||
li r3,1 ; signal "handled"
|
||||
|
|
|
@ -102,7 +102,7 @@ $frame=32; # size of above frame rounded up to 16n
|
|||
&lea ($num,&DWP(-3,"edi")); # num=num-1 to assist modulo-scheduling
|
||||
#&mov ($_num,$num); # redundant as $num is not reused
|
||||
&mov ($_sp,"ebp"); # saved stack pointer!
|
||||
|
||||
|
||||
if($sse2) {
|
||||
$acc0="mm0"; # mmx register bank layout
|
||||
$acc1="mm1";
|
||||
|
@ -183,7 +183,7 @@ $mask="mm7";
|
|||
|
||||
&paddq ($car1,$car0);
|
||||
&movq (&QWP($frame,"esp",$num,4),$car1); # tp[num].tp[num-1]
|
||||
|
||||
|
||||
&inc ($i); # i++
|
||||
&set_label("outer");
|
||||
&xor ($j,$j); # j=0
|
||||
|
@ -262,7 +262,7 @@ $mask="mm7";
|
|||
|
||||
&set_label("non_sse2",16);
|
||||
}
|
||||
|
||||
|
||||
if (0) {
|
||||
&mov ("esp",$_sp);
|
||||
&xor ("eax","eax"); # signal "not fast enough [yet]"
|
||||
|
@ -325,7 +325,7 @@ $carry="ebp";
|
|||
&inc ($j);
|
||||
|
||||
&jmp (&label("2ndmadd"));
|
||||
|
||||
|
||||
&set_label("1stmadd",16);
|
||||
&mov ($carry,"edx");
|
||||
&mul ($word); # ap[j]*bp[i]
|
||||
|
@ -362,7 +362,7 @@ $carry="ebp";
|
|||
&mov ("eax",&DWP(4,$inp)); # np[1]
|
||||
&adc ("edx",0);
|
||||
&mov ($j,1);
|
||||
|
||||
|
||||
&set_label("2ndmadd",16);
|
||||
&mov ($carry,"edx");
|
||||
&mul ($word); # np[j]*m
|
||||
|
@ -401,7 +401,7 @@ $carry="ebp";
|
|||
&xor ("edx","edx");
|
||||
&mov ("eax",&DWP(0,$inp));
|
||||
&jmp (&label("1stmadd"));
|
||||
|
||||
|
||||
&set_label("bn_sqr_mont",16);
|
||||
$sbit=$num;
|
||||
&mov ($_num,$num);
|
||||
|
@ -452,7 +452,7 @@ $sbit=$num;
|
|||
&adc ("edx",0);
|
||||
&mov ("eax",&DWP(4,$inp)); # np[1]
|
||||
&mov ($j,1);
|
||||
|
||||
|
||||
&set_label("3rdmadd",16);
|
||||
&mov ($carry,"edx");
|
||||
&mul ($word); # np[j]*m
|
||||
|
@ -492,7 +492,7 @@ $sbit=$num;
|
|||
&cmp ($j,$num);
|
||||
&mov (&DWP($frame+4,"esp",$num,4),"eax"); # tp[num]=
|
||||
&je (&label("common_tail"));
|
||||
|
||||
|
||||
&mov ($word,&DWP(4,$inp,$j,4)); # ap[i]
|
||||
&lea ($j,&DWP(1,$j));
|
||||
&mov ("eax",$word);
|
||||
|
@ -552,7 +552,7 @@ $sbit=$num;
|
|||
|
||||
&jmp (&label("3rdmadd"));
|
||||
}
|
||||
|
||||
|
||||
&set_label("common_tail",16);
|
||||
&mov ($np,$_np); # load modulus pointer
|
||||
&mov ($rp,$_rp); # load result pointer
|
||||
|
|
|
@ -686,7 +686,8 @@ $code.=<<___;
|
|||
.size bn_mul4x_mont,.-bn_mul4x_mont
|
||||
___
|
||||
}}}
|
||||
{{{
|
||||
|
||||
{{{
|
||||
######################################################################
|
||||
# void bn_sqr4x_mont(
|
||||
my $rptr="%rdi"; # const BN_ULONG *rptr,
|
||||
|
@ -1191,7 +1192,8 @@ $code.=<<___;
|
|||
mov $S[2],-16($tptr)
|
||||
mov $S[3],-8($tptr)
|
||||
___
|
||||
}
|
||||
}
|
||||
|
||||
##############################################################
|
||||
# Montgomery reduction part, "word-by-word" algorithm.
|
||||
#
|
||||
|
@ -1398,7 +1400,8 @@ $code.=<<___;
|
|||
mov 0(%rsp),$num # restore $num
|
||||
mov $topbit,($tptr) # save $topbit
|
||||
___
|
||||
}
|
||||
}
|
||||
|
||||
##############################################################
|
||||
# Post-condition, 4x unrolled copy from bn_mul_mont
|
||||
#
|
||||
|
|
|
@ -559,6 +559,6 @@ int cbs_get_any_asn1_element_internal(CBS *cbs, CBS *out, unsigned int *out_tag,
|
|||
int CBS_asn1_indefinite_to_definite(CBS *in, uint8_t **out, size_t *out_len);
|
||||
#endif /* LIBRESSL_INTERNAL */
|
||||
|
||||
__END_HIDDEN_DECLS
|
||||
__END_HIDDEN_DECLS
|
||||
|
||||
#endif /* OPENSSL_HEADER_BYTESTRING_H */
|
||||
|
|
|
@ -772,9 +772,9 @@ if ($OPENSSL) {
|
|||
64, 40,211,123,187,201, 67,193, 21,227,173,244,119,199,128,158);
|
||||
|
||||
sub S1110 { my $i=shift; $i=@SBOX[$i]; return $i<<24|$i<<16|$i<<8; }
|
||||
sub S4404 { my $i=shift; $i=($i<<1|$i>>7)&0xff; $i=@SBOX[$i]; return $i<<24|$i<<16|$i; }
|
||||
sub S0222 { my $i=shift; $i=@SBOX[$i]; $i=($i<<1|$i>>7)&0xff; return $i<<16|$i<<8|$i; }
|
||||
sub S3033 { my $i=shift; $i=@SBOX[$i]; $i=($i>>1|$i<<7)&0xff; return $i<<24|$i<<8|$i; }
|
||||
sub S4404 { my $i=shift; $i=($i<<1|$i>>7)&0xff; $i=@SBOX[$i]; return $i<<24|$i<<16|$i; }
|
||||
sub S0222 { my $i=shift; $i=@SBOX[$i]; $i=($i<<1|$i>>7)&0xff; return $i<<16|$i<<8|$i; }
|
||||
sub S3033 { my $i=shift; $i=@SBOX[$i]; $i=($i>>1|$i<<7)&0xff; return $i<<24|$i<<8|$i; }
|
||||
|
||||
&rodataseg();
|
||||
&set_label("Camellia_SIGMA",64);
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* $OpenBSD: camellia.c,v 1.12 2022/11/26 16:08:51 tb Exp $ */
|
||||
/* ====================================================================
|
||||
* Copyright 2006 NTT (Nippon Telegraph and Telephone Corporation) .
|
||||
* Copyright 2006 NTT (Nippon Telegraph and Telephone Corporation) .
|
||||
* ALL RIGHTS RESERVED.
|
||||
*
|
||||
* Intellectual Property information for Camellia:
|
||||
|
@ -24,7 +24,7 @@
|
|||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
|
@ -54,21 +54,21 @@
|
|||
* This package is an SSL implementation written
|
||||
* by Eric Young (eay@cryptsoft.com).
|
||||
* The implementation was written so as to conform with Netscapes SSL.
|
||||
*
|
||||
*
|
||||
* This library is free for commercial and non-commercial use as long as
|
||||
* the following conditions are aheared to. The following conditions
|
||||
* apply to all code found in this distribution, be it the RC4, RSA,
|
||||
* lhash, DES, etc., code; not just the SSL code. The SSL documentation
|
||||
* included with this distribution is covered by the same copyright terms
|
||||
* except that the holder is Tim Hudson (tjh@cryptsoft.com).
|
||||
*
|
||||
*
|
||||
* Copyright remains Eric Young's, and as such any Copyright notices in
|
||||
* the code are not to be removed.
|
||||
* If this package is used in a product, Eric Young should be given attribution
|
||||
* as the author of the parts of the library used.
|
||||
* This can be in the form of a textual message at program startup or
|
||||
* in documentation (online or textual) provided with the package.
|
||||
*
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
|
@ -83,10 +83,10 @@
|
|||
* Eric Young (eay@cryptsoft.com)"
|
||||
* The word 'cryptographic' can be left out if the rouines from the library
|
||||
* being used are not cryptographic related :-).
|
||||
* 4. If you include any Windows specific code (or a derivative thereof) from
|
||||
* 4. If you include any Windows specific code (or a derivative thereof) from
|
||||
* the apps directory (application code) you must include an acknowledgement:
|
||||
* "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
|
||||
*
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
|
@ -98,7 +98,7 @@
|
|||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
*
|
||||
* The licence and distribution terms for any publically available version or
|
||||
* derivative of this code cannot be changed. i.e. this code cannot simply be
|
||||
* copied and put under another distribution licence
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* $OpenBSD: cmll_local.h,v 1.3 2023/09/04 08:43:41 tb Exp $ */
|
||||
/* ====================================================================
|
||||
* Copyright 2006 NTT (Nippon Telegraph and Telephone Corporation) .
|
||||
* Copyright 2006 NTT (Nippon Telegraph and Telephone Corporation) .
|
||||
* ALL RIGHTS RESERVED.
|
||||
*
|
||||
* Intellectual Property information for Camellia:
|
||||
|
@ -24,7 +24,7 @@
|
|||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
|
@ -54,21 +54,21 @@
|
|||
* This package is an SSL implementation written
|
||||
* by Eric Young (eay@cryptsoft.com).
|
||||
* The implementation was written so as to conform with Netscapes SSL.
|
||||
*
|
||||
*
|
||||
* This library is free for commercial and non-commercial use as long as
|
||||
* the following conditions are aheared to. The following conditions
|
||||
* apply to all code found in this distribution, be it the RC4, RSA,
|
||||
* lhash, DES, etc., code; not just the SSL code. The SSL documentation
|
||||
* included with this distribution is covered by the same copyright terms
|
||||
* except that the holder is Tim Hudson (tjh@cryptsoft.com).
|
||||
*
|
||||
*
|
||||
* Copyright remains Eric Young's, and as such any Copyright notices in
|
||||
* the code are not to be removed.
|
||||
* If this package is used in a product, Eric Young should be given attribution
|
||||
* as the author of the parts of the library used.
|
||||
* This can be in the form of a textual message at program startup or
|
||||
* in documentation (online or textual) provided with the package.
|
||||
*
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
|
@ -83,10 +83,10 @@
|
|||
* Eric Young (eay@cryptsoft.com)"
|
||||
* The word 'cryptographic' can be left out if the rouines from the library
|
||||
* being used are not cryptographic related :-).
|
||||
* 4. If you include any Windows specific code (or a derivative thereof) from
|
||||
* 4. If you include any Windows specific code (or a derivative thereof) from
|
||||
* the apps directory (application code) you must include an acknowledgement:
|
||||
* "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
|
||||
*
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
|
@ -98,7 +98,7 @@
|
|||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
*
|
||||
* The licence and distribution terms for any publically available version or
|
||||
* derivative of this code cannot be changed. i.e. this code cannot simply be
|
||||
* copied and put under another distribution licence
|
||||
|
|
|
@ -64,7 +64,7 @@ where "name" is the name in the configuration file this function corresponds
|
|||
to.
|
||||
|
||||
A set of builtin modules (currently only an ASN1 non functional test module)
|
||||
can be added by calling OPENSSL_load_builtin_modules().
|
||||
can be added by calling OPENSSL_load_builtin_modules().
|
||||
|
||||
The function OPENSSL_config() is intended as a simple configuration function
|
||||
that any application can call to perform various default configuration tasks.
|
||||
|
|
|
@ -59,21 +59,21 @@ print <<"EOF";
|
|||
* This package is an SSL implementation written
|
||||
* by Eric Young (eay\@cryptsoft.com).
|
||||
* The implementation was written so as to conform with Netscapes SSL.
|
||||
*
|
||||
*
|
||||
* This library is free for commercial and non-commercial use as long as
|
||||
* the following conditions are aheared to. The following conditions
|
||||
* apply to all code found in this distribution, be it the RC4, RSA,
|
||||
* lhash, DES, etc., code; not just the SSL code. The SSL documentation
|
||||
* included with this distribution is covered by the same copyright terms
|
||||
* except that the holder is Tim Hudson (tjh\@cryptsoft.com).
|
||||
*
|
||||
*
|
||||
* Copyright remains Eric Young's, and as such any Copyright notices in
|
||||
* the code are not to be removed.
|
||||
* If this package is used in a product, Eric Young should be given attribution
|
||||
* as the author of the parts of the library used.
|
||||
* This can be in the form of a textual message at program startup or
|
||||
* in documentation (online or textual) provided with the package.
|
||||
*
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
|
@ -88,10 +88,10 @@ print <<"EOF";
|
|||
* Eric Young (eay\@cryptsoft.com)"
|
||||
* The word 'cryptographic' can be left out if the rouines from the library
|
||||
* being used are not cryptographic related :-).
|
||||
* 4. If you include any Windows specific code (or a derivative thereof) from
|
||||
* 4. If you include any Windows specific code (or a derivative thereof) from
|
||||
* the apps directory (application code) you must include an acknowledgement:
|
||||
* "This product includes software written by Tim Hudson (tjh\@cryptsoft.com)"
|
||||
*
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
|
@ -103,7 +103,7 @@ print <<"EOF";
|
|||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
*
|
||||
* The licence and distribution terms for any publically available version or
|
||||
* derivative of this code cannot be changed. i.e. this code cannot simply be
|
||||
* copied and put under another distribution licence
|
||||
|
|
|
@ -74,7 +74,7 @@ sub DES_encrypt_internal()
|
|||
|
||||
&function_end_B("_x86_DES_encrypt");
|
||||
}
|
||||
|
||||
|
||||
sub DES_decrypt_internal()
|
||||
{
|
||||
&function_begin_B("_x86_DES_decrypt");
|
||||
|
@ -111,7 +111,7 @@ sub DES_decrypt_internal()
|
|||
|
||||
&function_end_B("_x86_DES_decrypt");
|
||||
}
|
||||
|
||||
|
||||
sub DES_encrypt
|
||||
{
|
||||
local($name,$do_ip)=@_;
|
||||
|
@ -269,7 +269,7 @@ sub IP_new
|
|||
&R_PERM_OP($l,$tt,$r,14,"0x33333333",$r);
|
||||
&R_PERM_OP($tt,$r,$l,22,"0x03fc03fc",$r);
|
||||
&R_PERM_OP($l,$r,$tt, 9,"0xaaaaaaaa",$r);
|
||||
|
||||
|
||||
if ($lr != 3)
|
||||
{
|
||||
if (($lr-3) < 0)
|
||||
|
|
|
@ -331,7 +331,7 @@ $4:
|
|||
sll out1, 28, out1 ! rotate
|
||||
xor $1, local1, $1 ! 1 finished, local1 now sbox 7
|
||||
|
||||
ld [global2+local2], local2 ! 2
|
||||
ld [global2+local2], local2 ! 2
|
||||
srl out0, 24, local1 ! 7
|
||||
or out1, local0, out1 ! rotate
|
||||
|
||||
|
@ -1358,7 +1358,7 @@ DES_encrypt2:
|
|||
DES_encrypt3:
|
||||
|
||||
save %sp, FRAME, %sp
|
||||
|
||||
|
||||
sethi %hi(.PIC.DES_SPtrans-1f),global1
|
||||
or global1,%lo(.PIC.DES_SPtrans-1f),global1
|
||||
1: call .+8
|
||||
|
@ -1403,7 +1403,7 @@ DES_encrypt3:
|
|||
DES_decrypt3:
|
||||
|
||||
save %sp, FRAME, %sp
|
||||
|
||||
|
||||
sethi %hi(.PIC.DES_SPtrans-1f),global1
|
||||
or global1,%lo(.PIC.DES_SPtrans-1f),global1
|
||||
1: call .+8
|
||||
|
@ -1448,7 +1448,7 @@ DES_decrypt3:
|
|||
DES_ncbc_encrypt:
|
||||
|
||||
save %sp, FRAME, %sp
|
||||
|
||||
|
||||
define({INPUT}, { [%sp+BIAS+ARG0+0*ARGSZ] })
|
||||
define({OUTPUT}, { [%sp+BIAS+ARG0+1*ARGSZ] })
|
||||
define({IVEC}, { [%sp+BIAS+ARG0+4*ARGSZ] })
|
||||
|
@ -1459,7 +1459,7 @@ DES_ncbc_encrypt:
|
|||
add %o7,global1,global1
|
||||
sub global1,.PIC.DES_SPtrans-.des_and,out2
|
||||
|
||||
cmp in5, 0 ! enc
|
||||
cmp in5, 0 ! enc
|
||||
|
||||
#ifdef OPENSSL_SYSNAME_ULTRASPARC
|
||||
be,pn %icc, .ncbc.dec
|
||||
|
|
|
@ -27,7 +27,7 @@ sub DES_encrypt3
|
|||
&IP_new($L,$R,"edx",0);
|
||||
|
||||
# put them back
|
||||
|
||||
|
||||
if ($enc)
|
||||
{
|
||||
&mov(&DWP(4,"ebx","",0),$R);
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
|
|
|
@ -5,21 +5,21 @@
|
|||
* This package is an SSL implementation written
|
||||
* by Eric Young (eay@cryptsoft.com).
|
||||
* The implementation was written so as to conform with Netscapes SSL.
|
||||
*
|
||||
*
|
||||
* This library is free for commercial and non-commercial use as long as
|
||||
* the following conditions are aheared to. The following conditions
|
||||
* apply to all code found in this distribution, be it the RC4, RSA,
|
||||
* lhash, DES, etc., code; not just the SSL code. The SSL documentation
|
||||
* included with this distribution is covered by the same copyright terms
|
||||
* except that the holder is Tim Hudson (tjh@cryptsoft.com).
|
||||
*
|
||||
*
|
||||
* Copyright remains Eric Young's, and as such any Copyright notices in
|
||||
* the code are not to be removed.
|
||||
* If this package is used in a product, Eric Young should be given attribution
|
||||
* as the author of the parts of the library used.
|
||||
* This can be in the form of a textual message at program startup or
|
||||
* in documentation (online or textual) provided with the package.
|
||||
*
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
|
@ -34,10 +34,10 @@
|
|||
* Eric Young (eay@cryptsoft.com)"
|
||||
* The word 'cryptographic' can be left out if the rouines from the library
|
||||
* being used are not cryptographic related :-).
|
||||
* 4. If you include any Windows specific code (or a derivative thereof) from
|
||||
* 4. If you include any Windows specific code (or a derivative thereof) from
|
||||
* the apps directory (application code) you must include an acknowledgement:
|
||||
* "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
|
||||
*
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
|
@ -49,7 +49,7 @@
|
|||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
*
|
||||
* The licence and distribution terms for any publically available version or
|
||||
* derivative of this code cannot be changed. i.e. this code cannot simply be
|
||||
* copied and put under another distribution licence
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
|
|
|
@ -5,21 +5,21 @@
|
|||
* This package is an SSL implementation written
|
||||
* by Eric Young (eay@cryptsoft.com).
|
||||
* The implementation was written so as to conform with Netscapes SSL.
|
||||
*
|
||||
*
|
||||
* This library is free for commercial and non-commercial use as long as
|
||||
* the following conditions are aheared to. The following conditions
|
||||
* apply to all code found in this distribution, be it the RC4, RSA,
|
||||
* lhash, DES, etc., code; not just the SSL code. The SSL documentation
|
||||
* included with this distribution is covered by the same copyright terms
|
||||
* except that the holder is Tim Hudson (tjh@cryptsoft.com).
|
||||
*
|
||||
*
|
||||
* Copyright remains Eric Young's, and as such any Copyright notices in
|
||||
* the code are not to be removed.
|
||||
* If this package is used in a product, Eric Young should be given attribution
|
||||
* as the author of the parts of the library used.
|
||||
* This can be in the form of a textual message at program startup or
|
||||
* in documentation (online or textual) provided with the package.
|
||||
*
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
|
@ -34,10 +34,10 @@
|
|||
* Eric Young (eay@cryptsoft.com)"
|
||||
* The word 'cryptographic' can be left out if the rouines from the library
|
||||
* being used are not cryptographic related :-).
|
||||
* 4. If you include any Windows specific code (or a derivative thereof) from
|
||||
* 4. If you include any Windows specific code (or a derivative thereof) from
|
||||
* the apps directory (application code) you must include an acknowledgement:
|
||||
* "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
|
||||
*
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
|
@ -49,7 +49,7 @@
|
|||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
*
|
||||
* The licence and distribution terms for any publically available version or
|
||||
* derivative of this code cannot be changed. i.e. this code cannot simply be
|
||||
* copied and put under another distribution licence
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
|
@ -98,7 +98,7 @@ pkey_dh_init(EVP_PKEY_CTX *ctx)
|
|||
ctx->data = dctx;
|
||||
ctx->keygen_info = dctx->gentmp;
|
||||
ctx->keygen_info_count = 2;
|
||||
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@ -149,7 +149,7 @@ pkey_dh_ctrl(EVP_PKEY_CTX *ctx, int type, int p1, void *p2)
|
|||
return -2;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
pkey_dh_ctrl_str(EVP_PKEY_CTX *ctx, const char *type, const char *value)
|
||||
{
|
||||
|
|
|
@ -5,21 +5,21 @@
|
|||
* This package is an SSL implementation written
|
||||
* by Eric Young (eay@cryptsoft.com).
|
||||
* The implementation was written so as to conform with Netscapes SSL.
|
||||
*
|
||||
*
|
||||
* This library is free for commercial and non-commercial use as long as
|
||||
* the following conditions are aheared to. The following conditions
|
||||
* apply to all code found in this distribution, be it the RC4, RSA,
|
||||
* lhash, DES, etc., code; not just the SSL code. The SSL documentation
|
||||
* included with this distribution is covered by the same copyright terms
|
||||
* except that the holder is Tim Hudson (tjh@cryptsoft.com).
|
||||
*
|
||||
*
|
||||
* Copyright remains Eric Young's, and as such any Copyright notices in
|
||||
* the code are not to be removed.
|
||||
* If this package is used in a product, Eric Young should be given attribution
|
||||
* as the author of the parts of the library used.
|
||||
* This can be in the form of a textual message at program startup or
|
||||
* in documentation (online or textual) provided with the package.
|
||||
*
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
|
@ -34,10 +34,10 @@
|
|||
* Eric Young (eay@cryptsoft.com)"
|
||||
* The word 'cryptographic' can be left out if the rouines from the library
|
||||
* being used are not cryptographic related :-).
|
||||
* 4. If you include any Windows specific code (or a derivative thereof) from
|
||||
* 4. If you include any Windows specific code (or a derivative thereof) from
|
||||
* the apps directory (application code) you must include an acknowledgement:
|
||||
* "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
|
||||
*
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
|
@ -49,7 +49,7 @@
|
|||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
*
|
||||
* The licence and distribution terms for any publically available version or
|
||||
* derivative of this code cannot be changed. i.e. this code cannot simply be
|
||||
* copied and put under another distribution licence
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
|
|
|
@ -66,7 +66,7 @@ typedef struct {
|
|||
unsigned char k3[16];
|
||||
unsigned char k2[16];
|
||||
unsigned char k1[16];
|
||||
} gost_subst_block;
|
||||
} gost_subst_block;
|
||||
|
||||
#if defined(__i386) || defined(__i386__) || defined(__x86_64) || defined(__x86_64__)
|
||||
# define c2l(c,l) ((l)=*((const unsigned int *)(c)), (c)+=4)
|
||||
|
|
|
@ -125,8 +125,8 @@ xor_blocks(unsigned char *result, const unsigned char *a,
|
|||
result[i] = a[i] ^ b[i];
|
||||
}
|
||||
|
||||
/*
|
||||
* Calculate H(i+1) = Hash(Hi,Mi)
|
||||
/*
|
||||
* Calculate H(i+1) = Hash(Hi,Mi)
|
||||
* Where H and M are 32 bytes long
|
||||
*/
|
||||
static int
|
||||
|
|
|
@ -67,7 +67,7 @@ if (ul != 0) \
|
|||
r-=((r)>>16); \
|
||||
} \
|
||||
else \
|
||||
r=(-(int)a-b+1); /* assuming a or b is 0 and in range */
|
||||
r=(-(int)a-b+1); /* assuming a or b is 0 and in range */
|
||||
|
||||
/* 7/12/95 - Many thanks to Rhys Weatherley <rweather@us.oracle.com>
|
||||
* for pointing out that I was assuming little endian
|
||||
|
|
|
@ -45,7 +45,7 @@ sub R0
|
|||
local($pos,$a,$b,$c,$d,$K,$ki,$s,$t)=@_;
|
||||
|
||||
&mov($tmp1,$C) if $pos < 0;
|
||||
&mov($tmp2,&DWP($xo[$ki]*4,$K,"",0)) if $pos < 0; # very first one
|
||||
&mov($tmp2,&DWP($xo[$ki]*4,$K,"",0)) if $pos < 0; # very first one
|
||||
|
||||
# body proper
|
||||
|
||||
|
|
|
@ -410,7 +410,7 @@ gcm_ghash_neon:
|
|||
#ifdef __ARMEL__
|
||||
vrev64.8 $Z,$Z
|
||||
#endif
|
||||
sub $Xi,#16
|
||||
sub $Xi,#16
|
||||
vst1.64 `&Dhi("$Z")`,[$Xi,:64]! @ write out Xi
|
||||
vst1.64 `&Dlo("$Z")`,[$Xi,:64]
|
||||
|
||||
|
|
|
@ -121,7 +121,7 @@ $code.=<<___ if ($SIZE_T==4);
|
|||
b L\$parisc1_gmult
|
||||
nop
|
||||
___
|
||||
|
||||
|
||||
$code.=<<___;
|
||||
ldb 15($Xi),$nlo
|
||||
ldo 8($Htbl),$Hll
|
||||
|
@ -207,7 +207,7 @@ L\$oop_gmult_pa2
|
|||
std $Zll,8($Xi)
|
||||
std $Zhh,0($Xi)
|
||||
___
|
||||
|
||||
|
||||
$code.=<<___ if ($SIZE_T==4);
|
||||
b L\$done_gmult
|
||||
nop
|
||||
|
@ -378,7 +378,7 @@ $code.=<<___ if ($SIZE_T==4);
|
|||
b L\$parisc1_ghash
|
||||
nop
|
||||
___
|
||||
|
||||
|
||||
$code.=<<___;
|
||||
ldb 15($Xi),$nlo
|
||||
ldo 8($Htbl),$Hll
|
||||
|
@ -475,7 +475,7 @@ L\$oop_ghash_pa2
|
|||
cmpb,*<> $inp,$len,L\$outer_ghash_pa2
|
||||
copy $Zll,$nlo
|
||||
___
|
||||
|
||||
|
||||
$code.=<<___ if ($SIZE_T==4);
|
||||
b L\$done_ghash
|
||||
nop
|
||||
|
|
|
@ -125,7 +125,7 @@ for (@ARGV) { $sse2=1 if (/-DOPENSSL_IA32_SSE2/); }
|
|||
($Zhh,$Zhl,$Zlh,$Zll) = ("ebp","edx","ecx","ebx");
|
||||
$inp = "edi";
|
||||
$Htbl = "esi";
|
||||
|
||||
|
||||
$unroll = 0; # Affects x86 loop. Folded loop performs ~7% worse
|
||||
# than unrolled, which has to be weighted against
|
||||
# 2.5x x86-specific code size reduction.
|
||||
|
@ -243,7 +243,7 @@ sub deposit_rem_4bit {
|
|||
&mov (&DWP($bias+56,"esp"),0xA9C0<<16);
|
||||
&mov (&DWP($bias+60,"esp"),0xB5E0<<16);
|
||||
}
|
||||
|
||||
|
||||
$suffix = $x86only ? "" : "_x86";
|
||||
|
||||
&function_begin("gcm_gmult_4bit".$suffix);
|
||||
|
@ -326,7 +326,7 @@ $suffix = $x86only ? "" : "_x86";
|
|||
&mov (&DWP(0,$inp),$Zhh);
|
||||
&stack_pop(16+4+1);
|
||||
&function_end("gcm_ghash_4bit".$suffix);
|
||||
|
||||
|
||||
if (!$x86only) {{{
|
||||
|
||||
&static_label("rem_4bit");
|
||||
|
@ -425,7 +425,7 @@ $S=12; # shift factor for rem_4bit
|
|||
&mov (&DWP(8,$inp),$Zlh);
|
||||
&mov (&DWP(0,$inp),$Zhh);
|
||||
&function_end("gcm_gmult_4bit_mmx");
|
||||
|
||||
|
||||
# Streamed version performs 20% better on P4, 7% on Opteron,
|
||||
# 10% on Core2 and PIII...
|
||||
&function_begin("gcm_ghash_4bit_mmx");
|
||||
|
@ -477,7 +477,7 @@ $S=12; # shift factor for rem_4bit
|
|||
|
||||
&stack_pop(4+1);
|
||||
&function_end("gcm_ghash_4bit_mmx");
|
||||
|
||||
|
||||
}} else {{ # "June" MMX version...
|
||||
# ... has slower "April" gcm_gmult_4bit_mmx with folded
|
||||
# loop. This is done to conserve code size...
|
||||
|
@ -593,7 +593,7 @@ sub mmx_loop() {
|
|||
&mov (&DWP(8,$inp),$Zlh);
|
||||
&mov (&DWP(0,$inp),$Zhh);
|
||||
&function_end("gcm_gmult_4bit_mmx");
|
||||
|
||||
|
||||
######################################################################
|
||||
# Below subroutine is "528B" variant of "4-bit" GCM GHASH function
|
||||
# (see gcm128.c for details). It provides further 20-40% performance
|
||||
|
@ -782,7 +782,7 @@ sub mmx_loop() {
|
|||
&bswap ($dat);
|
||||
&pshufw ($Zhi,$Zhi,0b00011011); # 76543210
|
||||
&bswap ("ebx");
|
||||
|
||||
|
||||
&cmp ("ecx",&DWP(528+16+8,"esp")); # are we done?
|
||||
&jne (&label("outer"));
|
||||
}
|
||||
|
@ -797,7 +797,7 @@ sub mmx_loop() {
|
|||
}
|
||||
&function_end("gcm_ghash_4bit_mmx");
|
||||
}}
|
||||
|
||||
|
||||
if ($sse2) {{
|
||||
######################################################################
|
||||
# PCLMULQDQ version.
|
||||
|
@ -862,7 +862,7 @@ my ($Xhi,$Xi,$Hkey)=@_;
|
|||
&pxor ($Xhi,$T2);
|
||||
&pxor ($Xi,$T3); #
|
||||
}
|
||||
|
||||
|
||||
if (1) { # Algorithm 9 with <<1 twist.
|
||||
# Reduction is shorter and uses only two
|
||||
# temporary registers, which makes it better
|
||||
|
@ -1015,7 +1015,7 @@ my ($Xhi,$Xi) = @_;
|
|||
&psllq ($Xi,57); #
|
||||
&movdqa ($T2,$Xi); #
|
||||
&pslldq ($Xi,8);
|
||||
&psrldq ($T2,8); #
|
||||
&psrldq ($T2,8); #
|
||||
&pxor ($Xi,$T1);
|
||||
&pshufd ($T1,$T3,0b01001110);
|
||||
&pxor ($Xhi,$T2); #
|
||||
|
@ -1073,7 +1073,7 @@ my ($Xhi,$Xi) = @_;
|
|||
&pshufb ($Xi,$T3);
|
||||
&movdqu (&QWP(0,$Xip),$Xi);
|
||||
&function_end("gcm_ghash_clmul");
|
||||
|
||||
|
||||
} else { # Algorithm 5. Kept for reference purposes.
|
||||
|
||||
sub reduction_alg5 { # 19/16 times faster than Intel version
|
||||
|
@ -1250,7 +1250,7 @@ my ($Xhi,$Xi)=@_;
|
|||
&function_end("gcm_ghash_clmul");
|
||||
|
||||
}
|
||||
|
||||
|
||||
&rodataseg();
|
||||
&set_label("bswap",64);
|
||||
&data_byte(15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0);
|
||||
|
|
|
@ -79,7 +79,7 @@ sub AUTOLOAD() # thunk [simplified] 32-bit style perlasm
|
|||
$arg = "\$$arg" if ($arg*1 eq $arg);
|
||||
$code .= "\t$opcode\t".join(',',$arg,reverse @_)."\n";
|
||||
}
|
||||
|
||||
|
||||
{ my $N;
|
||||
sub loop() {
|
||||
my $inp = shift;
|
||||
|
@ -184,7 +184,7 @@ $code.=<<___;
|
|||
ret
|
||||
.size gcm_gmult_4bit,.-gcm_gmult_4bit
|
||||
___
|
||||
|
||||
|
||||
# per-function register layout
|
||||
$inp="%rdx";
|
||||
$len="%rcx";
|
||||
|
@ -341,7 +341,7 @@ $code.=<<___;
|
|||
ret
|
||||
.size gcm_ghash_4bit,.-gcm_ghash_4bit
|
||||
___
|
||||
|
||||
|
||||
######################################################################
|
||||
# PCLMULQDQ version.
|
||||
|
||||
|
@ -389,7 +389,7 @@ $code.=<<___;
|
|||
psllq \$57,$Xi #
|
||||
movdqa $Xi,$T2 #
|
||||
pslldq \$8,$Xi
|
||||
psrldq \$8,$T2 #
|
||||
psrldq \$8,$T2 #
|
||||
pxor $T1,$Xi
|
||||
pxor $T2,$Xhi #
|
||||
|
||||
|
@ -404,7 +404,7 @@ $code.=<<___;
|
|||
pxor $T2,$Xi #
|
||||
___
|
||||
}
|
||||
|
||||
|
||||
{ my ($Htbl,$Xip)=@_4args;
|
||||
|
||||
$code.=<<___;
|
||||
|
@ -465,7 +465,7 @@ $code.=<<___;
|
|||
.size gcm_gmult_clmul,.-gcm_gmult_clmul
|
||||
___
|
||||
}
|
||||
|
||||
|
||||
{ my ($Xip,$Htbl,$inp,$len)=@_4args;
|
||||
my $Xn="%xmm6";
|
||||
my $Xhn="%xmm7";
|
||||
|
@ -552,7 +552,7 @@ $code.=<<___;
|
|||
psllq \$57,$Xi #
|
||||
movdqa $Xi,$T2 #
|
||||
pslldq \$8,$Xi
|
||||
psrldq \$8,$T2 #
|
||||
psrldq \$8,$T2 #
|
||||
pxor $T1,$Xi
|
||||
pxor $T2,$Xhi #
|
||||
|
||||
|
@ -675,7 +675,7 @@ $code.=<<___;
|
|||
.align 64
|
||||
.text
|
||||
___
|
||||
|
||||
|
||||
# EXCEPTION_DISPOSITION handler (EXCEPTION_RECORD *rec,ULONG64 frame,
|
||||
# CONTEXT *context,DISPATCHER_CONTEXT *disp)
|
||||
if ($win64) {
|
||||
|
@ -802,7 +802,7 @@ se_handler:
|
|||
.byte 0x04,0xa2,0x00,0x00 #sub rsp,0x58
|
||||
___
|
||||
}
|
||||
|
||||
|
||||
$code =~ s/\`([^\`]*)\`/eval($1)/gem;
|
||||
|
||||
print $code;
|
||||
|
|
|
@ -58,7 +58,7 @@ while (<IN>)
|
|||
{
|
||||
print "WARNING: Duplicate short name \"$d\"\n";
|
||||
}
|
||||
else
|
||||
else
|
||||
{ $snames{$d} = "X"; }
|
||||
$sn{$1}=$d;
|
||||
}
|
||||
|
@ -68,7 +68,7 @@ while (<IN>)
|
|||
{
|
||||
print "WARNING: Duplicate long name \"$d\"\n";
|
||||
}
|
||||
else
|
||||
else
|
||||
{ $lnames{$d} = "X"; }
|
||||
$ln{$1}=$d;
|
||||
}
|
||||
|
@ -110,7 +110,7 @@ for ($i=0; $i<$n; $i++)
|
|||
$ln=$sn;
|
||||
$ln{$nid{$i}} = $sn;
|
||||
}
|
||||
|
||||
|
||||
$out ="{";
|
||||
$out.="\"$sn\"";
|
||||
$out.=","."\"$ln\"";
|
||||
|
@ -181,21 +181,21 @@ print OUT <<'EOF';
|
|||
* This package is an SSL implementation written
|
||||
* by Eric Young (eay@cryptsoft.com).
|
||||
* The implementation was written so as to conform with Netscapes SSL.
|
||||
*
|
||||
*
|
||||
* This library is free for commercial and non-commercial use as long as
|
||||
* the following conditions are aheared to. The following conditions
|
||||
* apply to all code found in this distribution, be it the RC4, RSA,
|
||||
* lhash, DES, etc., code; not just the SSL code. The SSL documentation
|
||||
* included with this distribution is covered by the same copyright terms
|
||||
* except that the holder is Tim Hudson (tjh@cryptsoft.com).
|
||||
*
|
||||
*
|
||||
* Copyright remains Eric Young's, and as such any Copyright notices in
|
||||
* the code are not to be removed.
|
||||
* If this package is used in a product, Eric Young should be given attribution
|
||||
* as the author of the parts of the library used.
|
||||
* This can be in the form of a textual message at program startup or
|
||||
* in documentation (online or textual) provided with the package.
|
||||
*
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
|
@ -210,10 +210,10 @@ print OUT <<'EOF';
|
|||
* Eric Young (eay@cryptsoft.com)"
|
||||
* The word 'cryptographic' can be left out if the rouines from the library
|
||||
* being used are not cryptographic related :-).
|
||||
* 4. If you include any Windows specific code (or a derivative thereof) from
|
||||
* 4. If you include any Windows specific code (or a derivative thereof) from
|
||||
* the apps directory (application code) you must include an acknowledgement:
|
||||
* "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
|
||||
*
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
|
@ -225,7 +225,7 @@ print OUT <<'EOF';
|
|||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
*
|
||||
* The licence and distribution terms for any publically available version or
|
||||
* derivative of this code cannot be changed. i.e. this code cannot simply be
|
||||
* copied and put under another distribution licence
|
||||
|
|
|
@ -133,21 +133,21 @@ print OUT <<'EOF';
|
|||
* This package is an SSL implementation written
|
||||
* by Eric Young (eay@cryptsoft.com).
|
||||
* The implementation was written so as to conform with Netscapes SSL.
|
||||
*
|
||||
*
|
||||
* This library is free for commercial and non-commercial use as long as
|
||||
* the following conditions are aheared to. The following conditions
|
||||
* apply to all code found in this distribution, be it the RC4, RSA,
|
||||
* lhash, DES, etc., code; not just the SSL code. The SSL documentation
|
||||
* included with this distribution is covered by the same copyright terms
|
||||
* except that the holder is Tim Hudson (tjh@cryptsoft.com).
|
||||
*
|
||||
*
|
||||
* Copyright remains Eric Young's, and as such any Copyright notices in
|
||||
* the code are not to be removed.
|
||||
* If this package is used in a product, Eric Young should be given attribution
|
||||
* as the author of the parts of the library used.
|
||||
* This can be in the form of a textual message at program startup or
|
||||
* in documentation (online or textual) provided with the package.
|
||||
*
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
|
@ -162,10 +162,10 @@ print OUT <<'EOF';
|
|||
* Eric Young (eay@cryptsoft.com)"
|
||||
* The word 'cryptographic' can be left out if the rouines from the library
|
||||
* being used are not cryptographic related :-).
|
||||
* 4. If you include any Windows specific code (or a derivative thereof) from
|
||||
* 4. If you include any Windows specific code (or a derivative thereof) from
|
||||
* the apps directory (application code) you must include an acknowledgement:
|
||||
* "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
|
||||
*
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
|
@ -177,7 +177,7 @@ print OUT <<'EOF';
|
|||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
*
|
||||
* The licence and distribution terms for any publically available version or
|
||||
* derivative of this code cannot be changed. i.e. this code cannot simply be
|
||||
* copied and put under another distribution licence
|
||||
|
|
|
@ -578,7 +578,7 @@ id-cmc 19 : id-cmc-responseInfo
|
|||
id-cmc 21 : id-cmc-queryPending
|
||||
id-cmc 22 : id-cmc-popLinkRandom
|
||||
id-cmc 23 : id-cmc-popLinkWitness
|
||||
id-cmc 24 : id-cmc-confirmCertAcceptance
|
||||
id-cmc 24 : id-cmc-confirmCertAcceptance
|
||||
|
||||
# other names
|
||||
id-on 1 : id-on-personalData
|
||||
|
@ -1309,7 +1309,7 @@ cryptocom 1 8 1 : id-GostR3410-2001-ParamSet-cc : GOST R 3410-2001 Parameter Se
|
|||
# Definitions for Camellia cipher - ECB, CFB, OFB MODE
|
||||
|
||||
!Alias ntt-ds 0 3 4401 5
|
||||
!Alias camellia ntt-ds 3 1 9
|
||||
!Alias camellia ntt-ds 3 1 9
|
||||
|
||||
camellia 1 : CAMELLIA-128-ECB : camellia-128-ecb
|
||||
!Cname camellia-128-ofb128
|
||||
|
|
|
@ -1,22 +1,22 @@
|
|||
21 0:d=0 hl=2 l= 0 cons: univ: SEQUENCE
|
||||
21 0:d=0 hl=2 l= 0 cons: univ: SEQUENCE
|
||||
00 2:d=0 hl=2 l= 9 prim: univ: OBJECT_IDENTIFIER :pkcs-7-signedData
|
||||
21 13:d=0 hl=2 l= 0 cons: cont: 00 # explicit tag
|
||||
21 15:d=0 hl=2 l= 0 cons: univ: SEQUENCE
|
||||
00 17:d=0 hl=2 l= 1 prim: univ: INTEGER # version
|
||||
20 20:d=0 hl=2 l= 0 cons: univ: SET
|
||||
21 22:d=0 hl=2 l= 0 cons: univ: SEQUENCE
|
||||
21 15:d=0 hl=2 l= 0 cons: univ: SEQUENCE
|
||||
00 17:d=0 hl=2 l= 1 prim: univ: INTEGER # version
|
||||
20 20:d=0 hl=2 l= 0 cons: univ: SET
|
||||
21 22:d=0 hl=2 l= 0 cons: univ: SEQUENCE
|
||||
00 24:d=0 hl=2 l= 9 prim: univ: OBJECT_IDENTIFIER :pkcs-7-data
|
||||
00 35:d=0 hl=2 l= 0 prim: univ: EOC
|
||||
00 35:d=0 hl=2 l= 0 prim: univ: EOC
|
||||
21 37:d=0 hl=2 l= 0 cons: cont: 00 # cert tag
|
||||
20 39:d=0 hl=4 l=545 cons: univ: SEQUENCE
|
||||
20 588:d=0 hl=4 l=524 cons: univ: SEQUENCE
|
||||
00 1116:d=0 hl=2 l= 0 prim: univ: EOC
|
||||
20 39:d=0 hl=4 l=545 cons: univ: SEQUENCE
|
||||
20 588:d=0 hl=4 l=524 cons: univ: SEQUENCE
|
||||
00 1116:d=0 hl=2 l= 0 prim: univ: EOC
|
||||
21 1118:d=0 hl=2 l= 0 cons: cont: 01 # crl tag
|
||||
20 1120:d=0 hl=4 l=653 cons: univ: SEQUENCE
|
||||
20 1777:d=0 hl=4 l=285 cons: univ: SEQUENCE
|
||||
00 2066:d=0 hl=2 l= 0 prim: univ: EOC
|
||||
21 2068:d=0 hl=2 l= 0 cons: univ: SET # signers
|
||||
00 2070:d=0 hl=2 l= 0 prim: univ: EOC
|
||||
00 2072:d=0 hl=2 l= 0 prim: univ: EOC
|
||||
00 2074:d=0 hl=2 l= 0 prim: univ: EOC
|
||||
00 2076:d=0 hl=2 l= 0 prim: univ: EOC
|
||||
20 1120:d=0 hl=4 l=653 cons: univ: SEQUENCE
|
||||
20 1777:d=0 hl=4 l=285 cons: univ: SEQUENCE
|
||||
00 2066:d=0 hl=2 l= 0 prim: univ: EOC
|
||||
21 2068:d=0 hl=2 l= 0 cons: univ: SET # signers
|
||||
00 2070:d=0 hl=2 l= 0 prim: univ: EOC
|
||||
00 2072:d=0 hl=2 l= 0 prim: univ: EOC
|
||||
00 2074:d=0 hl=2 l= 0 prim: univ: EOC
|
||||
00 2076:d=0 hl=2 l= 0 prim: univ: EOC
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
# des_cblock (*ivec);
|
||||
# int enc;
|
||||
#
|
||||
# calls
|
||||
# calls
|
||||
# des_encrypt((DES_LONG *)tin,schedule,DES_ENCRYPT);
|
||||
#
|
||||
|
||||
|
@ -29,7 +29,7 @@ sub cbc
|
|||
# name is the function name
|
||||
# enc_func and dec_func and the functions to call for encrypt/decrypt
|
||||
# swap is true if byte order needs to be reversed
|
||||
# iv_off is parameter number for the iv
|
||||
# iv_off is parameter number for the iv
|
||||
# enc_off is parameter number for the encrypt/decrypt flag
|
||||
# p1,p2,p3 are the offsets for parameters to be passed to the
|
||||
# underlying calls.
|
||||
|
@ -116,7 +116,7 @@ sub cbc
|
|||
#############################################################
|
||||
|
||||
&set_label("encrypt_loop");
|
||||
# encrypt start
|
||||
# encrypt start
|
||||
# "eax" and "ebx" hold iv (or the last cipher text)
|
||||
|
||||
&mov("ecx", &DWP(0,$in,"",0)); # load first 4 bytes
|
||||
|
@ -209,7 +209,7 @@ sub cbc
|
|||
#############################################################
|
||||
#############################################################
|
||||
&set_label("decrypt",1);
|
||||
# decrypt start
|
||||
# decrypt start
|
||||
&and($count,0xfffffff8);
|
||||
# The next 2 instructions are only for if the jz is taken
|
||||
&mov("eax", &DWP($data_off+8,"esp","",0)); # get iv[0]
|
||||
|
|
|
@ -19,7 +19,7 @@ my $globl = sub {
|
|||
my $ret;
|
||||
|
||||
$name =~ s|^[\.\_]||;
|
||||
|
||||
|
||||
SWITCH: for ($flavour) {
|
||||
/aix/ && do { $name = ".$name";
|
||||
last;
|
||||
|
|
|
@ -61,7 +61,7 @@ So a very simple version of this function could be coded as
|
|||
|
||||
push(@INC,"perlasm","../../perlasm");
|
||||
require "x86asm.pl";
|
||||
|
||||
|
||||
&asm_init($ARGV[0],"cacl.pl");
|
||||
|
||||
&external_label("other");
|
||||
|
|
|
@ -57,7 +57,7 @@
|
|||
# 9. .init segment is allowed to contain calls to functions only.
|
||||
# a. If function accepts more than 4 arguments *and* >4th argument
|
||||
# is declared as non 64-bit value, do clear its upper part.
|
||||
|
||||
|
||||
my $flavour = shift;
|
||||
my $output = shift;
|
||||
if ($flavour =~ /\./) { $output = $flavour; undef $flavour; }
|
||||
|
@ -141,7 +141,7 @@ my %globals;
|
|||
if ($gas) {
|
||||
if ($self->{op} eq "movz") { # movz is pain...
|
||||
sprintf "%s%s%s",$self->{op},$self->{sz},shift;
|
||||
} elsif ($self->{op} =~ /^set/) {
|
||||
} elsif ($self->{op} =~ /^set/) {
|
||||
"$self->{op}";
|
||||
} elsif ($self->{op} eq "ret") {
|
||||
my $epilogue = "";
|
||||
|
@ -168,7 +168,7 @@ my %globals;
|
|||
$self->{op} .= $self->{sz};
|
||||
} elsif ($self->{op} eq "call" && $current_segment eq ".CRT\$XCU") {
|
||||
$self->{op} = "\tDQ";
|
||||
}
|
||||
}
|
||||
$self->{op};
|
||||
}
|
||||
}
|
||||
|
@ -608,7 +608,7 @@ my %globals;
|
|||
if ($sz eq "D" && ($current_segment=~/.[px]data/ || $dir eq ".rva"))
|
||||
{ $var=~s/([_a-z\$\@][_a-z0-9\$\@]*)/$nasm?"$1 wrt ..imagebase":"imagerel $1"/egi; }
|
||||
$var;
|
||||
};
|
||||
};
|
||||
|
||||
$sz =~ tr/bvlrq/BWDDQ/;
|
||||
$self->{value} = "\tD$sz\t";
|
||||
|
@ -618,7 +618,7 @@ my %globals;
|
|||
};
|
||||
/\.byte/ && do { my @str=split(/,\s*/,$line);
|
||||
map(s/(0b[0-1]+)/oct($1)/eig,@str);
|
||||
map(s/0x([0-9a-f]+)/0$1h/ig,@str) if ($masm);
|
||||
map(s/0x([0-9a-f]+)/0$1h/ig,@str) if ($masm);
|
||||
while ($#str>15) {
|
||||
$self->{value}.="DB\t"
|
||||
.join(",",@str[0..15])."\n";
|
||||
|
@ -802,7 +802,7 @@ while($line=<>) {
|
|||
} elsif ($opcode=opcode->re(\$line)) {
|
||||
my $asm = eval("\$".$opcode->mnemonic());
|
||||
undef @bytes;
|
||||
|
||||
|
||||
if ((ref($asm) eq 'CODE') && scalar(@bytes=&$asm($line))) {
|
||||
print $gas?".byte\t":"DB\t",join(',',@bytes),"\n";
|
||||
next;
|
||||
|
@ -857,7 +857,8 @@ print "END\n" if ($masm);
|
|||
|
||||
close STDOUT;
|
||||
|
||||
#################################################
|
||||
|
||||
#################################################
|
||||
# Cross-reference x86_64 ABI "card"
|
||||
#
|
||||
# Unix Win64
|
||||
|
@ -877,7 +878,7 @@ close STDOUT;
|
|||
# %r13 - -
|
||||
# %r14 - -
|
||||
# %r15 - -
|
||||
#
|
||||
#
|
||||
# (*) volatile register
|
||||
# (-) preserved by callee
|
||||
# (#) Nth argument, volatile
|
||||
|
@ -922,7 +923,8 @@ close STDOUT;
|
|||
# endif
|
||||
# ret
|
||||
#
|
||||
#################################################
|
||||
|
||||
#################################################
|
||||
# Win64 SEH, Structured Exception Handling.
|
||||
#
|
||||
# Unlike on Unix systems(*) lack of Win64 stack unwinding information
|
||||
|
|
|
@ -211,7 +211,7 @@ static const ASN1_ADB_TABLE PKCS12_BAGS_adbtbl[] = {
|
|||
.field_name = "value.x509cert",
|
||||
.item = &ASN1_OCTET_STRING_it,
|
||||
},
|
||||
|
||||
|
||||
},
|
||||
{
|
||||
.value = NID_x509Crl,
|
||||
|
@ -222,7 +222,7 @@ static const ASN1_ADB_TABLE PKCS12_BAGS_adbtbl[] = {
|
|||
.field_name = "value.x509crl",
|
||||
.item = &ASN1_OCTET_STRING_it,
|
||||
},
|
||||
|
||||
|
||||
},
|
||||
{
|
||||
.value = NID_sdsiCertificate,
|
||||
|
@ -233,7 +233,7 @@ static const ASN1_ADB_TABLE PKCS12_BAGS_adbtbl[] = {
|
|||
.field_name = "value.sdsicert",
|
||||
.item = &ASN1_IA5STRING_it,
|
||||
},
|
||||
|
||||
|
||||
},
|
||||
};
|
||||
|
||||
|
@ -321,7 +321,7 @@ static const ASN1_ADB_TABLE PKCS12_SAFEBAG_adbtbl[] = {
|
|||
.field_name = "value.keybag",
|
||||
.item = &PKCS8_PRIV_KEY_INFO_it,
|
||||
},
|
||||
|
||||
|
||||
},
|
||||
{
|
||||
.value = NID_pkcs8ShroudedKeyBag,
|
||||
|
@ -332,7 +332,7 @@ static const ASN1_ADB_TABLE PKCS12_SAFEBAG_adbtbl[] = {
|
|||
.field_name = "value.shkeybag",
|
||||
.item = &X509_SIG_it,
|
||||
},
|
||||
|
||||
|
||||
},
|
||||
{
|
||||
.value = NID_safeContentsBag,
|
||||
|
@ -353,7 +353,7 @@ static const ASN1_ADB_TABLE PKCS12_SAFEBAG_adbtbl[] = {
|
|||
.field_name = "value.bag",
|
||||
.item = &PKCS12_BAGS_it,
|
||||
},
|
||||
|
||||
|
||||
},
|
||||
{
|
||||
.value = NID_crlBag,
|
||||
|
@ -364,7 +364,7 @@ static const ASN1_ADB_TABLE PKCS12_SAFEBAG_adbtbl[] = {
|
|||
.field_name = "value.bag",
|
||||
.item = &PKCS12_BAGS_it,
|
||||
},
|
||||
|
||||
|
||||
},
|
||||
{
|
||||
.value = NID_secretBag,
|
||||
|
@ -375,7 +375,7 @@ static const ASN1_ADB_TABLE PKCS12_SAFEBAG_adbtbl[] = {
|
|||
.field_name = "value.bag",
|
||||
.item = &PKCS12_BAGS_it,
|
||||
},
|
||||
|
||||
|
||||
},
|
||||
};
|
||||
|
||||
|
|
|
@ -84,7 +84,7 @@ static const ASN1_ADB_TABLE PKCS7_adbtbl[] = {
|
|||
.field_name = "d.data",
|
||||
.item = &ASN1_OCTET_STRING_NDEF_it,
|
||||
},
|
||||
|
||||
|
||||
},
|
||||
{
|
||||
.value = NID_pkcs7_signed,
|
||||
|
@ -95,7 +95,7 @@ static const ASN1_ADB_TABLE PKCS7_adbtbl[] = {
|
|||
.field_name = "d.sign",
|
||||
.item = &PKCS7_SIGNED_it,
|
||||
},
|
||||
|
||||
|
||||
},
|
||||
{
|
||||
.value = NID_pkcs7_enveloped,
|
||||
|
@ -106,7 +106,7 @@ static const ASN1_ADB_TABLE PKCS7_adbtbl[] = {
|
|||
.field_name = "d.enveloped",
|
||||
.item = &PKCS7_ENVELOPE_it,
|
||||
},
|
||||
|
||||
|
||||
},
|
||||
{
|
||||
.value = NID_pkcs7_signedAndEnveloped,
|
||||
|
@ -117,7 +117,7 @@ static const ASN1_ADB_TABLE PKCS7_adbtbl[] = {
|
|||
.field_name = "d.signed_and_enveloped",
|
||||
.item = &PKCS7_SIGN_ENVELOPE_it,
|
||||
},
|
||||
|
||||
|
||||
},
|
||||
{
|
||||
.value = NID_pkcs7_digest,
|
||||
|
@ -128,7 +128,7 @@ static const ASN1_ADB_TABLE PKCS7_adbtbl[] = {
|
|||
.field_name = "d.digest",
|
||||
.item = &PKCS7_DIGEST_it,
|
||||
},
|
||||
|
||||
|
||||
},
|
||||
{
|
||||
.value = NID_pkcs7_encrypted,
|
||||
|
@ -139,7 +139,7 @@ static const ASN1_ADB_TABLE PKCS7_adbtbl[] = {
|
|||
.field_name = "d.encrypted",
|
||||
.item = &PKCS7_ENCRYPT_it,
|
||||
},
|
||||
|
||||
|
||||
},
|
||||
};
|
||||
|
||||
|
|
|
@ -985,7 +985,7 @@ PKCS7_dataVerify(X509_STORE *cert_store, X509_STORE_CTX *ctx, BIO *bio,
|
|||
|
||||
return PKCS7_signatureVerify(bio, p7, si, x509);
|
||||
err:
|
||||
|
||||
|
||||
return ret;
|
||||
}
|
||||
LCRYPTO_ALIAS(PKCS7_dataVerify);
|
||||
|
|
|
@ -17,19 +17,19 @@ X-Newsreader: NN version 6.5.0 #3 (NOV)
|
|||
|
||||
Ron Rivest's Cipher No.2
|
||||
------------------------
|
||||
|
||||
|
||||
Ron Rivest's Cipher No.2 (hereafter referred to as RRC.2, other people may
|
||||
refer to it by other names) is word oriented, operating on a block of 64 bits
|
||||
divided into four 16-bit words, with a key table of 64 words. All data units
|
||||
are little-endian. This functional description of the algorithm is based in
|
||||
the paper "The RC5 Encryption Algorithm" (RC5 is a trademark of RSADSI), using
|
||||
the same general layout, terminology, and pseudocode style.
|
||||
|
||||
|
||||
|
||||
|
||||
Notation and RRC.2 Primitive Operations
|
||||
|
||||
|
||||
RRC.2 uses the following primitive operations:
|
||||
|
||||
|
||||
1. Two's-complement addition of words, denoted by "+". The inverse operation,
|
||||
subtraction, is denoted by "-".
|
||||
2. Bitwise exclusive OR, denoted by "^".
|
||||
|
@ -37,141 +37,141 @@ RRC.2 uses the following primitive operations:
|
|||
4. Bitwise NOT, denoted by "~".
|
||||
5. A left-rotation of words; the rotation of word x left by y is denoted
|
||||
x <<< y. The inverse operation, right-rotation, is denoted x >>> y.
|
||||
|
||||
|
||||
These operations are directly and efficiently supported by most processors.
|
||||
|
||||
|
||||
|
||||
|
||||
The RRC.2 Algorithm
|
||||
|
||||
|
||||
RRC.2 consists of three components, a *key expansion* algorithm, an
|
||||
*encryption* algorithm, and a *decryption* algorithm.
|
||||
|
||||
|
||||
|
||||
|
||||
Key Expansion
|
||||
|
||||
|
||||
The purpose of the key-expansion routine is to expand the user's key K to fill
|
||||
the expanded key array S, so S resembles an array of random binary words
|
||||
determined by the user's secret key K.
|
||||
|
||||
|
||||
Initialising the S-box
|
||||
|
||||
|
||||
RRC.2 uses a single 256-byte S-box derived from the ciphertext contents of
|
||||
Beale Cipher No.1 XOR'd with a one-time pad. The Beale Ciphers predate modern
|
||||
cryptography by enough time that there should be no concerns about trapdoors
|
||||
hidden in the data. They have been published widely, and the S-box can be
|
||||
easily recreated from the one-time pad values and the Beale Cipher data taken
|
||||
from a standard source. To initialise the S-box:
|
||||
|
||||
|
||||
for i = 0 to 255 do
|
||||
sBox[ i ] = ( beale[ i ] mod 256 ) ^ pad[ i ]
|
||||
|
||||
|
||||
The contents of Beale Cipher No.1 and the necessary one-time pad are given as
|
||||
an appendix at the end of this document. For efficiency, implementors may wish
|
||||
to skip the Beale Cipher expansion and store the sBox table directly.
|
||||
|
||||
|
||||
Expanding the Secret Key to 128 Bytes
|
||||
|
||||
|
||||
The secret key is first expanded to fill 128 bytes (64 words). The expansion
|
||||
consists of taking the sum of the first and last bytes in the user key, looking
|
||||
up the sum (modulo 256) in the S-box, and appending the result to the key. The
|
||||
operation is repeated with the second byte and new last byte of the key until
|
||||
all 128 bytes have been generated. Note that the following pseudocode treats
|
||||
the S array as an array of 128 bytes rather than 64 words.
|
||||
|
||||
|
||||
for j = 0 to length-1 do
|
||||
S[ j ] = K[ j ]
|
||||
for j = length to 127 do
|
||||
s[ j ] = sBox[ ( S[ j-length ] + S[ j-1 ] ) mod 256 ];
|
||||
|
||||
|
||||
At this point it is possible to perform a truncation of the effective key
|
||||
length to ease the creation of espionage-enabled software products. However
|
||||
since the author cannot conceive why anyone would want to do this, it will not
|
||||
be considered further.
|
||||
|
||||
|
||||
The final phase of the key expansion involves replacing the first byte of S
|
||||
with the entry selected from the S-box:
|
||||
|
||||
|
||||
S[ 0 ] = sBox[ S[ 0 ] ]
|
||||
|
||||
|
||||
|
||||
|
||||
Encryption
|
||||
|
||||
|
||||
The cipher has 16 full rounds, each divided into 4 subrounds. Two of the full
|
||||
rounds perform an additional transformation on the data. Note that the
|
||||
following pseudocode treats the S array as an array of 64 words rather than 128
|
||||
bytes.
|
||||
|
||||
|
||||
for i = 0 to 15 do
|
||||
j = i * 4;
|
||||
word0 = ( word0 + ( word1 & ~word3 ) + ( word2 & word3 ) + S[ j+0 ] ) <<< 1
|
||||
word1 = ( word1 + ( word2 & ~word0 ) + ( word3 & word0 ) + S[ j+1 ] ) <<< 2
|
||||
word2 = ( word2 + ( word3 & ~word1 ) + ( word0 & word1 ) + S[ j+2 ] ) <<< 3
|
||||
word3 = ( word3 + ( word0 & ~word2 ) + ( word1 & word2 ) + S[ j+3 ] ) <<< 5
|
||||
|
||||
|
||||
In addition the fifth and eleventh rounds add the contents of the S-box indexed
|
||||
by one of the data words to another of the data words following the four
|
||||
subrounds as follows:
|
||||
|
||||
|
||||
word0 = word0 + S[ word3 & 63 ];
|
||||
word1 = word1 + S[ word0 & 63 ];
|
||||
word2 = word2 + S[ word1 & 63 ];
|
||||
word3 = word3 + S[ word2 & 63 ];
|
||||
|
||||
|
||||
|
||||
|
||||
Decryption
|
||||
|
||||
|
||||
The decryption operation is simply the inverse of the encryption operation.
|
||||
Note that the following pseudocode treats the S array as an array of 64 words
|
||||
rather than 128 bytes.
|
||||
|
||||
|
||||
for i = 15 downto 0 do
|
||||
j = i * 4;
|
||||
word3 = ( word3 >>> 5 ) - ( word0 & ~word2 ) - ( word1 & word2 ) - S[ j+3 ]
|
||||
word2 = ( word2 >>> 3 ) - ( word3 & ~word1 ) - ( word0 & word1 ) - S[ j+2 ]
|
||||
word1 = ( word1 >>> 2 ) - ( word2 & ~word0 ) - ( word3 & word0 ) - S[ j+1 ]
|
||||
word0 = ( word0 >>> 1 ) - ( word1 & ~word3 ) - ( word2 & word3 ) - S[ j+0 ]
|
||||
|
||||
|
||||
In addition the fifth and eleventh rounds subtract the contents of the S-box
|
||||
indexed by one of the data words from another one of the data words following
|
||||
the four subrounds as follows:
|
||||
|
||||
|
||||
word3 = word3 - S[ word2 & 63 ]
|
||||
word2 = word2 - S[ word1 & 63 ]
|
||||
word1 = word1 - S[ word0 & 63 ]
|
||||
word0 = word0 - S[ word3 & 63 ]
|
||||
|
||||
|
||||
|
||||
|
||||
Test Vectors
|
||||
|
||||
|
||||
The following test vectors may be used to test the correctness of an RRC.2
|
||||
implementation:
|
||||
|
||||
|
||||
Key: 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
|
||||
Plain: 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
|
||||
Cipher: 0x1C, 0x19, 0x8A, 0x83, 0x8D, 0xF0, 0x28, 0xB7
|
||||
|
||||
|
||||
Key: 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01
|
||||
Plain: 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
|
||||
Cipher: 0x21, 0x82, 0x9C, 0x78, 0xA9, 0xF9, 0xC0, 0x74
|
||||
|
||||
|
||||
Key: 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
|
||||
Plain: 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF
|
||||
Cipher: 0x13, 0xDB, 0x35, 0x17, 0xD3, 0x21, 0x86, 0x9E
|
||||
|
||||
|
||||
Key: 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
|
||||
0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F
|
||||
Plain: 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
|
||||
Cipher: 0x50, 0xDC, 0x01, 0x62, 0xBD, 0x75, 0x7F, 0x31
|
||||
|
||||
|
||||
|
||||
|
||||
Appendix: Beale Cipher No.1, "The Locality of the Vault", and One-time Pad for
|
||||
Creating the S-Box
|
||||
|
||||
|
||||
Beale Cipher No.1.
|
||||
|
||||
|
||||
71, 194, 38,1701, 89, 76, 11, 83,1629, 48, 94, 63, 132, 16, 111, 95,
|
||||
84, 341, 975, 14, 40, 64, 27, 81, 139, 213, 63, 90,1120, 8, 15, 3,
|
||||
126,2018, 40, 74, 758, 485, 604, 230, 436, 664, 582, 150, 251, 284, 308, 231,
|
||||
|
@ -188,9 +188,9 @@ Beale Cipher No.1.
|
|||
93, 86, 116, 530, 82, 568, 9, 102, 38, 416, 89, 71, 216, 728, 965, 818,
|
||||
2, 38, 121, 195, 14, 326, 148, 234, 18, 55, 131, 234, 361, 824, 5, 81,
|
||||
623, 48, 961, 19, 26, 33, 10,1101, 365, 92, 88, 181, 275, 346, 201, 206
|
||||
|
||||
|
||||
One-time Pad.
|
||||
|
||||
|
||||
158, 186, 223, 97, 64, 145, 190, 190, 117, 217, 163, 70, 206, 176, 183, 194,
|
||||
146, 43, 248, 141, 3, 54, 72, 223, 233, 153, 91, 210, 36, 131, 244, 161,
|
||||
105, 120, 113, 191, 113, 86, 19, 245, 213, 221, 43, 27, 242, 157, 73, 213,
|
||||
|
@ -207,10 +207,10 @@ One-time Pad.
|
|||
142, 86, 146, 221, 179, 166, 161, 74, 69, 182, 88, 120, 128, 58, 76, 155,
|
||||
15, 30, 77, 216, 165, 117, 107, 90, 169, 127, 143, 181, 208, 137, 200, 127,
|
||||
170, 195, 26, 84, 255, 132, 150, 58, 103, 250, 120, 221, 237, 37, 8, 99
|
||||
|
||||
|
||||
|
||||
|
||||
Implementation
|
||||
|
||||
|
||||
A non-US based programmer who has never seen any encryption code before will
|
||||
shortly be implementing RRC.2 based solely on this specification and not on
|
||||
knowledge of any other encryption algorithms. Stand by.
|
||||
|
|
|
@ -18,5 +18,5 @@
|
|||
So if you are paranoid, used Triple DES, else IDEA. If RC2
|
||||
does get used more, perhaps more people will look for weaknesses in
|
||||
it.
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -38,7 +38,7 @@ my ($rc4,$md5)=(1,1); # what to generate?
|
|||
my $D="#" if (!$md5); # if set to "#", MD5 is stitched into RC4(),
|
||||
# but its result is discarded. Idea here is
|
||||
# to be able to use 'openssl speed rc4' for
|
||||
# benchmarking the stitched subroutine...
|
||||
# benchmarking the stitched subroutine...
|
||||
|
||||
my $flavour = shift;
|
||||
my $output = shift;
|
||||
|
@ -405,7 +405,7 @@ $code.=<<___ if ($rc4 && (!$md5 || $D));
|
|||
and \$63,$len # remaining bytes
|
||||
jnz .Loop1
|
||||
jmp .Ldone
|
||||
|
||||
|
||||
.align 16
|
||||
.Loop1:
|
||||
add $TX[0]#b,$YY#b
|
||||
|
|
|
@ -91,7 +91,7 @@ sub unrolledloopbody {
|
|||
for ($i=0;$i<4;$i++) {
|
||||
$code.=<<___;
|
||||
ldo 1($XX[0]),$XX[1]
|
||||
`sprintf("$LDX %$TY(%$key),%$dat1") if ($i>0)`
|
||||
`sprintf("$LDX %$TY(%$key),%$dat1") if ($i>0)`
|
||||
and $mask,$XX[1],$XX[1]
|
||||
$LDX $YY($key),$TY
|
||||
$MKX $YY,$key,$ix
|
||||
|
@ -158,7 +158,7 @@ RC4
|
|||
ldo `2*$SZ`($key),$key
|
||||
|
||||
ldi 0xff,$mask
|
||||
ldi 3,$dat0
|
||||
ldi 3,$dat0
|
||||
|
||||
ldo 1($XX[0]),$XX[0] ; warm up loop
|
||||
and $mask,$XX[0],$XX[0]
|
||||
|
|
|
@ -41,7 +41,7 @@
|
|||
|
||||
# April 2005
|
||||
#
|
||||
# P4 EM64T core appears to be "allergic" to 64-bit inc/dec. Replacing
|
||||
# P4 EM64T core appears to be "allergic" to 64-bit inc/dec. Replacing
|
||||
# those with add/sub results in 50% performance improvement of folded
|
||||
# loop...
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@ $KL2=0x6ED9EBA1;
|
|||
$KL3=0x8F1BBCDC;
|
||||
$KL4=0xA953FD4E;
|
||||
$KR0=0x50A28BE6;
|
||||
$KR1=0x5C4DD124;
|
||||
$KR1=0x5C4DD124;
|
||||
$KR2=0x6D703EF3;
|
||||
$KR3=0x7A6D76E9;
|
||||
|
||||
|
@ -531,28 +531,28 @@ sub ripemd160_block
|
|||
# &mov($tmp2, &wparam(0)); # Moved into last round
|
||||
|
||||
&mov($tmp1, &DWP( 4,$tmp2,"",0)); # ctx->B
|
||||
&add($D, $tmp1);
|
||||
&add($D, $tmp1);
|
||||
&mov($tmp1, &swtmp(16+2)); # $c
|
||||
&add($D, $tmp1);
|
||||
|
||||
&mov($tmp1, &DWP( 8,$tmp2,"",0)); # ctx->C
|
||||
&add($E, $tmp1);
|
||||
&add($E, $tmp1);
|
||||
&mov($tmp1, &swtmp(16+3)); # $d
|
||||
&add($E, $tmp1);
|
||||
|
||||
&mov($tmp1, &DWP(12,$tmp2,"",0)); # ctx->D
|
||||
&add($A, $tmp1);
|
||||
&add($A, $tmp1);
|
||||
&mov($tmp1, &swtmp(16+4)); # $e
|
||||
&add($A, $tmp1);
|
||||
|
||||
|
||||
&mov($tmp1, &DWP(16,$tmp2,"",0)); # ctx->E
|
||||
&add($B, $tmp1);
|
||||
&add($B, $tmp1);
|
||||
&mov($tmp1, &swtmp(16+0)); # $a
|
||||
&add($B, $tmp1);
|
||||
|
||||
&mov($tmp1, &DWP( 0,$tmp2,"",0)); # ctx->A
|
||||
&add($C, $tmp1);
|
||||
&add($C, $tmp1);
|
||||
&mov($tmp1, &swtmp(16+1)); # $b
|
||||
&add($C, $tmp1);
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
#
|
||||
# Pentium PIII P4 AMD K8 Core2
|
||||
# gcc 46 36 41 27 26
|
||||
# icc 57 33 38 25 23
|
||||
# icc 57 33 38 25 23
|
||||
# x86 asm 40 30 33 20 18
|
||||
# x86_64 asm(*) - - 21 16 16
|
||||
#
|
||||
|
@ -145,7 +145,7 @@ sub BODY_00_15() {
|
|||
&mov ($Boff,"ebx");
|
||||
&mov ($Coff,"ecx");
|
||||
&mov ($Doff,"edi");
|
||||
&mov ($E,&DWP(16,"esi"));
|
||||
&mov ($E,&DWP(16,"esi"));
|
||||
&mov ("ebx",&DWP(20,"esi"));
|
||||
&mov ("ecx",&DWP(24,"esi"));
|
||||
&mov ("edi",&DWP(28,"esi"));
|
||||
|
|
|
@ -334,7 +334,7 @@ if ($sse2) {
|
|||
&BODY_00_15_sse2(1);
|
||||
|
||||
&set_label("16_79_sse2",16);
|
||||
#&movq ("mm2",&QWP(8*(9+16-1),"esp")); #prefetched in BODY_00_15
|
||||
#&movq ("mm2",&QWP(8*(9+16-1),"esp")); #prefetched in BODY_00_15
|
||||
#&movq ("mm6",&QWP(8*(9+16-14),"esp"));
|
||||
&movq ("mm1","mm2");
|
||||
|
||||
|
|
|
@ -370,7 +370,7 @@ $code.=<<___ if ($SZ==8 && $SIZE_T==4);
|
|||
___
|
||||
|
||||
@V=( $Ahi, $Alo, $Bhi, $Blo, $Chi, $Clo, $Dhi, $Dlo,
|
||||
$Ehi, $Elo, $Fhi, $Flo, $Ghi, $Glo, $Hhi, $Hlo) =
|
||||
$Ehi, $Elo, $Fhi, $Flo, $Ghi, $Glo, $Hhi, $Hlo) =
|
||||
( "%r1", "%r2", "%r3", "%r4", "%r5", "%r6", "%r7", "%r8",
|
||||
"%r9","%r10","%r11","%r12","%r13","%r14","%r15","%r16");
|
||||
$a0 ="%r17";
|
||||
|
@ -421,7 +421,7 @@ $code.=<<___;
|
|||
add $t0,$hlo,$hlo
|
||||
shd $ahi,$alo,$Sigma0[0],$t0
|
||||
addc $t1,$hhi,$hhi ; h += Sigma1(e)
|
||||
shd $alo,$ahi,$Sigma0[0],$t1
|
||||
shd $alo,$ahi,$Sigma0[0],$t1
|
||||
add $a0,$hlo,$hlo
|
||||
shd $ahi,$alo,$Sigma0[1],$t2
|
||||
addc $a1,$hhi,$hhi ; h += Ch(e,f,g)
|
||||
|
|
|
@ -93,7 +93,7 @@ if ($output =~ /512/) {
|
|||
|
||||
$locals=0; # X[16] is register resident
|
||||
@X=("%o0","%o1","%o2","%o3","%o4","%o5","%g1","%o7");
|
||||
|
||||
|
||||
$A="%l0";
|
||||
$B="%l1";
|
||||
$C="%l2";
|
||||
|
@ -244,7 +244,7 @@ $code.=<<___;
|
|||
$SLL $a,`$SZ*8-@Sigma0[1]`,$tmp1
|
||||
xor $tmp0,$h,$h
|
||||
$SRL $a,@Sigma0[2],$tmp0
|
||||
xor $tmp1,$h,$h
|
||||
xor $tmp1,$h,$h
|
||||
$SLL $a,`$SZ*8-@Sigma0[0]`,$tmp1
|
||||
xor $tmp0,$h,$h
|
||||
xor $tmp1,$h,$h ! Sigma0(a)
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
|
@ -65,7 +65,7 @@
|
|||
|
||||
/* In C++ we get problems because an explicit cast is needed from (void *)
|
||||
* we use CHECKED_STACK_OF to ensure the correct type is passed in the macros
|
||||
* below.
|
||||
* below.
|
||||
*/
|
||||
|
||||
#define CHECKED_STACK_OF(type, p) \
|
||||
|
|
|
@ -69,7 +69,7 @@ while(<IN>) {
|
|||
}
|
||||
next if($inside_block != 1);
|
||||
$new_stackfile .= "/* This block of defines is updated by util/mkstack.pl, please do not touch! */";
|
||||
|
||||
|
||||
foreach $type_thing (sort @stacklst) {
|
||||
$new_stackfile .= <<EOF;
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
# multiplying 64 by CPU clock frequency and dividing by relevant
|
||||
# value from the given table:
|
||||
#
|
||||
# $SCALE=2/8 icc8 gcc3
|
||||
# $SCALE=2/8 icc8 gcc3
|
||||
# Intel P4 3200/4600 4600(*) 6400
|
||||
# Intel PIII 2900/3000 4900 5400
|
||||
# AMD K[78] 2500/1800 9900 8200(**)
|
||||
|
@ -492,4 +492,4 @@ for($i=0;$i<8;$i++) {
|
|||
&L(0xca,0x2d,0xbf,0x07,0xad,0x5a,0x83,0x33);
|
||||
&previous();
|
||||
|
||||
&asm_finish();
|
||||
&asm_finish();
|
||||
|
|
|
@ -5,21 +5,21 @@
|
|||
* This package is an SSL implementation written
|
||||
* by Eric Young (eay@cryptsoft.com).
|
||||
* The implementation was written so as to conform with Netscapes SSL.
|
||||
*
|
||||
*
|
||||
* This library is free for commercial and non-commercial use as long as
|
||||
* the following conditions are aheared to. The following conditions
|
||||
* apply to all code found in this distribution, be it the RC4, RSA,
|
||||
* lhash, DES, etc., code; not just the SSL code. The SSL documentation
|
||||
* included with this distribution is covered by the same copyright terms
|
||||
* except that the holder is Tim Hudson (tjh@cryptsoft.com).
|
||||
*
|
||||
*
|
||||
* Copyright remains Eric Young's, and as such any Copyright notices in
|
||||
* the code are not to be removed.
|
||||
* If this package is used in a product, Eric Young should be given attribution
|
||||
* as the author of the parts of the library used.
|
||||
* This can be in the form of a textual message at program startup or
|
||||
* in documentation (online or textual) provided with the package.
|
||||
*
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
|
@ -34,10 +34,10 @@
|
|||
* Eric Young (eay@cryptsoft.com)"
|
||||
* The word 'cryptographic' can be left out if the rouines from the library
|
||||
* being used are not cryptographic related :-).
|
||||
* 4. If you include any Windows specific code (or a derivative thereof) from
|
||||
* 4. If you include any Windows specific code (or a derivative thereof) from
|
||||
* the apps directory (application code) you must include an acknowledgement:
|
||||
* "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
|
||||
*
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
|
@ -49,7 +49,7 @@
|
|||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
*
|
||||
* The licence and distribution terms for any publically available version or
|
||||
* derivative of this code cannot be changed. i.e. this code cannot simply be
|
||||
* copied and put under another distribution licence
|
||||
|
@ -57,7 +57,7 @@
|
|||
*/
|
||||
/* ====================================================================
|
||||
* Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED.
|
||||
* ECDH support in OpenSSL originally developed by
|
||||
* ECDH support in OpenSSL originally developed by
|
||||
* SUN MICROSYSTEMS, INC., and contributed to the OpenSSL project.
|
||||
*/
|
||||
|
||||
|
@ -213,7 +213,7 @@ DECLARE_STACK_OF(X509_TRUST)
|
|||
#define X509_FLAG_NO_AUX (1L << 10)
|
||||
#define X509_FLAG_NO_ATTRIBUTES (1L << 11)
|
||||
|
||||
/* Flags specific to X509_NAME_print_ex() */
|
||||
/* Flags specific to X509_NAME_print_ex() */
|
||||
|
||||
/* The field separator information */
|
||||
|
||||
|
|
|
@ -126,7 +126,7 @@ void acpipci_intr_disestablish(void *, void *);
|
|||
|
||||
uint32_t acpipci_iort_map_msi(pci_chipset_tag_t, pcitag_t,
|
||||
struct interrupt_controller **);
|
||||
|
||||
|
||||
extern LIST_HEAD(, interrupt_controller) interrupt_controllers;
|
||||
|
||||
int
|
||||
|
|
|
@ -507,7 +507,7 @@ aha2840_load_seeprom(struct ahc_softc *ahc)
|
|||
|
||||
if (bootverbose)
|
||||
printf("%s: Reading SEEPROM...", ahc_name(ahc));
|
||||
have_seeprom = read_seeprom(&sd,
|
||||
have_seeprom = read_seeprom(&sd,
|
||||
(u_int16_t *)&sc,
|
||||
/*start_addr*/0,
|
||||
sizeof(sc)/2);
|
||||
|
|
|
@ -45,7 +45,7 @@
|
|||
|
||||
#define MAC_STR "%02x:%02x:%02x:%02x:%02x:%02x"
|
||||
#define MAC_ARGS(mac) \
|
||||
mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]
|
||||
mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]
|
||||
|
||||
typedef struct {
|
||||
uint16_t offset;
|
||||
|
|
|
@ -276,7 +276,7 @@ tascodec_set_port(void *priv, mixer_ctrl_t *mc)
|
|||
tascodec_write(sc, PWR_CTL, mode);
|
||||
}
|
||||
return 0;
|
||||
|
||||
|
||||
}
|
||||
|
||||
return EINVAL;
|
||||
|
|
|
@ -200,7 +200,7 @@ ihidev_attach(struct device *parent, struct device *self, void *aux)
|
|||
|
||||
if (sc->sc_refcnt > 0)
|
||||
return;
|
||||
|
||||
|
||||
/* power down until we're opened */
|
||||
if (ihidev_hid_command(sc, I2C_HID_CMD_SET_POWER, &I2C_HID_POWER_OFF)) {
|
||||
printf("%s: failed to power down\n", sc->sc_dev.dv_xname);
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by Mark Tinguely and Jim Lowe
|
||||
* 4. The name of the author may not be used to endorse or promote products
|
||||
* 4. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
||||
|
|
|
@ -243,7 +243,7 @@ gem_config(struct gem_softc *sc)
|
|||
|
||||
mii_flags = MIIF_DOPAUSE;
|
||||
|
||||
/*
|
||||
/*
|
||||
* Look for an external PHY.
|
||||
*/
|
||||
if (sc->sc_mif_config & GEM_MIF_CONFIG_MDI1) {
|
||||
|
@ -293,7 +293,7 @@ gem_config(struct gem_softc *sc)
|
|||
MII_OFFSET_ANY, mii_flags);
|
||||
}
|
||||
|
||||
/*
|
||||
/*
|
||||
* Try the external PCS SERDES if we didn't find any MII
|
||||
* devices.
|
||||
*/
|
||||
|
@ -785,11 +785,11 @@ gem_init(struct ifnet *ifp)
|
|||
gem_iff(sc);
|
||||
|
||||
/* step 6 & 7. Program Descriptor Ring Base Addresses */
|
||||
bus_space_write_4(t, h, GEM_TX_RING_PTR_HI,
|
||||
bus_space_write_4(t, h, GEM_TX_RING_PTR_HI,
|
||||
(((uint64_t)GEM_CDTXADDR(sc,0)) >> 32));
|
||||
bus_space_write_4(t, h, GEM_TX_RING_PTR_LO, GEM_CDTXADDR(sc, 0));
|
||||
|
||||
bus_space_write_4(t, h, GEM_RX_RING_PTR_HI,
|
||||
bus_space_write_4(t, h, GEM_RX_RING_PTR_HI,
|
||||
(((uint64_t)GEM_CDRXADDR(sc,0)) >> 32));
|
||||
bus_space_write_4(t, h, GEM_RX_RING_PTR_LO, GEM_CDRXADDR(sc, 0));
|
||||
|
||||
|
@ -820,7 +820,7 @@ gem_init(struct ifnet *ifp)
|
|||
/* Encode Receive Descriptor ring size: four possible values */
|
||||
v = gem_ringsize(GEM_NRXDESC /*XXX*/);
|
||||
/* Enable DMA */
|
||||
bus_space_write_4(t, h, GEM_RX_CONFIG,
|
||||
bus_space_write_4(t, h, GEM_RX_CONFIG,
|
||||
v|(GEM_THRSH_1024<<GEM_RX_CONFIG_FIFO_THRS_SHIFT)|
|
||||
(2<<GEM_RX_CONFIG_FBOFF_SHFT)|GEM_RX_CONFIG_RXDMA_EN|
|
||||
(0<<GEM_RX_CONFIG_CXM_START_SHFT));
|
||||
|
@ -944,11 +944,11 @@ gem_init_regs(struct gem_softc *sc)
|
|||
/*
|
||||
* Set the station address.
|
||||
*/
|
||||
bus_space_write_4(t, h, GEM_MAC_ADDR0,
|
||||
bus_space_write_4(t, h, GEM_MAC_ADDR0,
|
||||
(sc->sc_arpcom.ac_enaddr[4]<<8) | sc->sc_arpcom.ac_enaddr[5]);
|
||||
bus_space_write_4(t, h, GEM_MAC_ADDR1,
|
||||
bus_space_write_4(t, h, GEM_MAC_ADDR1,
|
||||
(sc->sc_arpcom.ac_enaddr[2]<<8) | sc->sc_arpcom.ac_enaddr[3]);
|
||||
bus_space_write_4(t, h, GEM_MAC_ADDR2,
|
||||
bus_space_write_4(t, h, GEM_MAC_ADDR2,
|
||||
(sc->sc_arpcom.ac_enaddr[0]<<8) | sc->sc_arpcom.ac_enaddr[1]);
|
||||
}
|
||||
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue