sync with OpenBSD -current
This commit is contained in:
parent
6278c437f5
commit
784d5aeff3
93 changed files with 1817 additions and 10181 deletions
|
@ -1,4 +1,4 @@
|
|||
/* $OpenBSD: aes_core.c,v 1.19 2024/03/27 11:15:44 jsing Exp $ */
|
||||
/* $OpenBSD: aes_core.c,v 1.22 2024/03/29 11:19:01 jsing Exp $ */
|
||||
/**
|
||||
* rijndael-alg-fst.c
|
||||
*
|
||||
|
@ -50,6 +50,10 @@ Td3[x] = Si[x].[09, 0d, 0b, 0e];
|
|||
Td4[x] = Si[x].[01];
|
||||
*/
|
||||
|
||||
#if !defined(HAVE_AES_SET_ENCRYPT_KEY_INTERNAL) || \
|
||||
!defined(HAVE_AES_SET_DECRYPT_KEY_INTERNAL) || \
|
||||
!defined(HAVE_AES_ENCRYPT_INTERNAL) || \
|
||||
!defined(HAVE_AES_DECRYPT_INTERNAL)
|
||||
static const u32 Te0[256] = {
|
||||
0xc66363a5U, 0xf87c7c84U, 0xee777799U, 0xf67b7b8dU,
|
||||
0xfff2f20dU, 0xd66b6bbdU, 0xde6f6fb1U, 0x91c5c554U,
|
||||
|
@ -579,6 +583,10 @@ static const u32 Td3[256] = {
|
|||
0xa8017139U, 0x0cb3de08U, 0xb4e49cd8U, 0x56c19064U,
|
||||
0xcb84617bU, 0x32b670d5U, 0x6c5c7448U, 0xb85742d0U,
|
||||
};
|
||||
#endif
|
||||
|
||||
#if !defined(HAVE_AES_ENCRYPT_INTERNAL) || \
|
||||
!defined(HAVE_AES_DECRYPT_INTERNAL)
|
||||
static const u8 Td4[256] = {
|
||||
0x52U, 0x09U, 0x6aU, 0xd5U, 0x30U, 0x36U, 0xa5U, 0x38U,
|
||||
0xbfU, 0x40U, 0xa3U, 0x9eU, 0x81U, 0xf3U, 0xd7U, 0xfbU,
|
||||
|
@ -613,17 +621,29 @@ static const u8 Td4[256] = {
|
|||
0x17U, 0x2bU, 0x04U, 0x7eU, 0xbaU, 0x77U, 0xd6U, 0x26U,
|
||||
0xe1U, 0x69U, 0x14U, 0x63U, 0x55U, 0x21U, 0x0cU, 0x7dU,
|
||||
};
|
||||
#endif
|
||||
|
||||
#if !defined(HAVE_AES_SET_ENCRYPT_KEY_INTERNAL) || \
|
||||
!defined(HAVE_AES_SET_DECRYPT_KEY_INTERNAL)
|
||||
static const u32 rcon[] = {
|
||||
0x01000000, 0x02000000, 0x04000000, 0x08000000,
|
||||
0x10000000, 0x20000000, 0x40000000, 0x80000000,
|
||||
0x1B000000, 0x36000000, /* for 128-bit blocks, Rijndael never uses more than 10 rcon values */
|
||||
};
|
||||
#endif
|
||||
|
||||
/**
|
||||
#ifdef HAVE_AES_SET_ENCRYPT_KEY_INTERNAL
|
||||
int aes_set_encrypt_key_internal(const unsigned char *userKey, const int bits,
|
||||
AES_KEY *key);
|
||||
|
||||
#else
|
||||
|
||||
/*
|
||||
* Expand the cipher key into the encryption key schedule.
|
||||
*/
|
||||
int
|
||||
AES_set_encrypt_key(const unsigned char *userKey, const int bits, AES_KEY *key)
|
||||
static inline int
|
||||
aes_set_encrypt_key_internal(const unsigned char *userKey, const int bits,
|
||||
AES_KEY *key)
|
||||
{
|
||||
u32 *rk;
|
||||
int i = 0;
|
||||
|
@ -719,12 +739,25 @@ AES_set_encrypt_key(const unsigned char *userKey, const int bits, AES_KEY *key)
|
|||
}
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
int
|
||||
AES_set_encrypt_key(const unsigned char *userKey, const int bits, AES_KEY *key)
|
||||
{
|
||||
return aes_set_encrypt_key_internal(userKey, bits, key);
|
||||
}
|
||||
|
||||
#ifdef HAVE_AES_SET_DECRYPT_KEY_INTERNAL
|
||||
int aes_set_decrypt_key_internal(const unsigned char *userKey, const int bits,
|
||||
AES_KEY *key);
|
||||
|
||||
#else
|
||||
/*
|
||||
* Expand the cipher key into the decryption key schedule.
|
||||
*/
|
||||
int
|
||||
AES_set_decrypt_key(const unsigned char *userKey, const int bits, AES_KEY *key)
|
||||
static inline int
|
||||
aes_set_decrypt_key_internal(const unsigned char *userKey, const int bits,
|
||||
AES_KEY *key)
|
||||
{
|
||||
u32 *rk;
|
||||
int i, j, status;
|
||||
|
@ -778,14 +811,25 @@ AES_set_decrypt_key(const unsigned char *userKey, const int bits, AES_KEY *key)
|
|||
}
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef AES_ASM
|
||||
int
|
||||
AES_set_decrypt_key(const unsigned char *userKey, const int bits, AES_KEY *key)
|
||||
{
|
||||
return aes_set_decrypt_key_internal(userKey, bits, key);
|
||||
}
|
||||
|
||||
#ifdef HAVE_AES_ENCRYPT_INTERNAL
|
||||
void aes_encrypt_internal(const unsigned char *in, unsigned char *out,
|
||||
const AES_KEY *key);
|
||||
|
||||
#else
|
||||
/*
|
||||
* Encrypt a single block
|
||||
* in and out can overlap
|
||||
* Encrypt a single block - in and out can overlap.
|
||||
*/
|
||||
void
|
||||
AES_encrypt(const unsigned char *in, unsigned char *out, const AES_KEY *key)
|
||||
static inline void
|
||||
aes_encrypt_internal(const unsigned char *in, unsigned char *out,
|
||||
const AES_KEY *key)
|
||||
{
|
||||
const u32 *rk;
|
||||
u32 s0, s1, s2, s3, t0, t1, t2, t3;
|
||||
|
@ -969,13 +1013,25 @@ AES_encrypt(const unsigned char *in, unsigned char *out, const AES_KEY *key)
|
|||
rk[3];
|
||||
crypto_store_htobe32(&out[3 * 4], s3);
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Decrypt a single block
|
||||
* in and out can overlap
|
||||
*/
|
||||
void
|
||||
AES_decrypt(const unsigned char *in, unsigned char *out, const AES_KEY *key)
|
||||
AES_encrypt(const unsigned char *in, unsigned char *out, const AES_KEY *key)
|
||||
{
|
||||
return aes_encrypt_internal(in, out, key);
|
||||
}
|
||||
|
||||
#ifdef HAVE_AES_DECRYPT_INTERNAL
|
||||
void aes_decrypt_internal(const unsigned char *in, unsigned char *out,
|
||||
const AES_KEY *key);
|
||||
|
||||
#else
|
||||
/*
|
||||
* Decrypt a single block - in and out can overlap.
|
||||
*/
|
||||
static inline void
|
||||
aes_decrypt_internal(const unsigned char *in, unsigned char *out,
|
||||
const AES_KEY *key)
|
||||
{
|
||||
const u32 *rk;
|
||||
u32 s0, s1, s2, s3, t0, t1, t2, t3;
|
||||
|
@ -1159,4 +1215,10 @@ AES_decrypt(const unsigned char *in, unsigned char *out, const AES_KEY *key)
|
|||
rk[3];
|
||||
crypto_store_htobe32(&out[3 * 4], s3);
|
||||
}
|
||||
#endif /* AES_ASM */
|
||||
#endif
|
||||
|
||||
void
|
||||
AES_decrypt(const unsigned char *in, unsigned char *out, const AES_KEY *key)
|
||||
{
|
||||
return aes_decrypt_internal(in, out, key);
|
||||
}
|
||||
|
|
|
@ -1158,8 +1158,8 @@ sub enclast()
|
|||
&data_word(0x00000000, 0x00000000, 0x00000000, 0x00000000);
|
||||
&previous();
|
||||
|
||||
# void AES_encrypt (const void *inp,void *out,const AES_KEY *key);
|
||||
&function_begin("AES_encrypt");
|
||||
# void aes_encrypt_internal(const void *inp, void *out, const AES_KEY *key);
|
||||
&function_begin("aes_encrypt_internal");
|
||||
&mov ($acc,&wparam(0)); # load inp
|
||||
&mov ($key,&wparam(2)); # load key
|
||||
|
||||
|
@ -1213,7 +1213,7 @@ sub enclast()
|
|||
&mov (&DWP(4,$acc),$s1);
|
||||
&mov (&DWP(8,$acc),$s2);
|
||||
&mov (&DWP(12,$acc),$s3);
|
||||
&function_end("AES_encrypt");
|
||||
&function_end("aes_encrypt_internal");
|
||||
|
||||
#--------------------------------------------------------------------#
|
||||
|
||||
|
@ -1947,8 +1947,8 @@ sub declast()
|
|||
&data_byte(0xe1, 0x69, 0x14, 0x63, 0x55, 0x21, 0x0c, 0x7d);
|
||||
&previous();
|
||||
|
||||
# void AES_decrypt (const void *inp,void *out,const AES_KEY *key);
|
||||
&function_begin("AES_decrypt");
|
||||
# void aes_decrypt_internal(const void *inp, void *out, const AES_KEY *key);
|
||||
&function_begin("aes_decrypt_internal");
|
||||
&mov ($acc,&wparam(0)); # load inp
|
||||
&mov ($key,&wparam(2)); # load key
|
||||
|
||||
|
@ -2002,7 +2002,7 @@ sub declast()
|
|||
&mov (&DWP(4,$acc),$s1);
|
||||
&mov (&DWP(8,$acc),$s2);
|
||||
&mov (&DWP(12,$acc),$s3);
|
||||
&function_end("AES_decrypt");
|
||||
&function_end("aes_decrypt_internal");
|
||||
|
||||
# void aes_cbc_encrypt_internal(const void char *inp, unsigned char *out,
|
||||
# size_t length, const AES_KEY *key, unsigned char *ivp,const int enc);
|
||||
|
@ -2849,12 +2849,12 @@ sub enckey()
|
|||
&set_label("exit");
|
||||
&function_end("_x86_AES_set_encrypt_key");
|
||||
|
||||
# int AES_set_encrypt_key(const unsigned char *userKey, const int bits,
|
||||
# AES_KEY *key)
|
||||
&function_begin_B("AES_set_encrypt_key");
|
||||
# int aes_set_encrypt_key_internal(const unsigned char *userKey, const int bits,
|
||||
# AES_KEY *key)
|
||||
&function_begin_B("aes_set_encrypt_key_internal");
|
||||
&call ("_x86_AES_set_encrypt_key");
|
||||
&ret ();
|
||||
&function_end_B("AES_set_encrypt_key");
|
||||
&function_end_B("aes_set_encrypt_key_internal");
|
||||
|
||||
sub deckey()
|
||||
{ my ($i,$key,$tp1,$tp2,$tp4,$tp8) = @_;
|
||||
|
@ -2911,9 +2911,9 @@ sub deckey()
|
|||
&mov (&DWP(4*$i,$key),$tp1);
|
||||
}
|
||||
|
||||
# int AES_set_decrypt_key(const unsigned char *userKey, const int bits,
|
||||
# AES_KEY *key)
|
||||
&function_begin_B("AES_set_decrypt_key");
|
||||
# int aes_set_decrypt_key_internal(const unsigned char *userKey, const int bits,
|
||||
# AES_KEY *key)
|
||||
&function_begin_B("aes_set_decrypt_key_internal");
|
||||
&call ("_x86_AES_set_encrypt_key");
|
||||
&cmp ("eax",0);
|
||||
&je (&label("proceed"));
|
||||
|
@ -2969,6 +2969,6 @@ sub deckey()
|
|||
&jb (&label("permute"));
|
||||
|
||||
&xor ("eax","eax"); # return success
|
||||
&function_end("AES_set_decrypt_key");
|
||||
&function_end("aes_set_decrypt_key_internal");
|
||||
|
||||
&asm_finish();
|
||||
|
|
|
@ -161,17 +161,17 @@ AES_Te:
|
|||
.word 0x1B000000, 0x36000000, 0, 0, 0, 0, 0, 0
|
||||
.size AES_Te,.-AES_Te
|
||||
|
||||
@ void AES_encrypt(const unsigned char *in, unsigned char *out,
|
||||
@ const AES_KEY *key) {
|
||||
.global AES_encrypt
|
||||
.type AES_encrypt,%function
|
||||
@ void aes_encrypt_internal(const unsigned char *in, unsigned char *out,
|
||||
@ const AES_KEY *key) {
|
||||
.global aes_encrypt_internal
|
||||
.type aes_encrypt_internal,%function
|
||||
.align 5
|
||||
AES_encrypt:
|
||||
sub r3,pc,#8 @ AES_encrypt
|
||||
aes_encrypt_internal:
|
||||
sub r3,pc,#8 @ aes_encrypt_internal
|
||||
stmdb sp!,{r1,r4-r12,lr}
|
||||
mov $rounds,r0 @ inp
|
||||
mov $key,r2
|
||||
sub $tbl,r3,#AES_encrypt-AES_Te @ Te
|
||||
sub $tbl,r3,#aes_encrypt_internal-AES_Te @ Te
|
||||
#if __ARM_ARCH__<7 || defined(__STRICT_ALIGNMENT)
|
||||
ldrb $s0,[$rounds,#3] @ load input data in endian-neutral
|
||||
ldrb $t1,[$rounds,#2] @ manner...
|
||||
|
@ -265,7 +265,7 @@ AES_encrypt:
|
|||
moveq pc,lr @ be binary compatible with V4, yet
|
||||
bx lr @ interoperable with Thumb ISA:-)
|
||||
#endif
|
||||
.size AES_encrypt,.-AES_encrypt
|
||||
.size aes_encrypt_internal,.-aes_encrypt_internal
|
||||
|
||||
.type _armv4_AES_encrypt,%function
|
||||
.align 2
|
||||
|
@ -404,12 +404,12 @@ _armv4_AES_encrypt:
|
|||
ldr pc,[sp],#4 @ pop and return
|
||||
.size _armv4_AES_encrypt,.-_armv4_AES_encrypt
|
||||
|
||||
.global AES_set_encrypt_key
|
||||
.type AES_set_encrypt_key,%function
|
||||
.global aes_set_encrypt_key_internal
|
||||
.type aes_set_encrypt_key_internal,%function
|
||||
.align 5
|
||||
AES_set_encrypt_key:
|
||||
aes_set_encrypt_key_internal:
|
||||
_armv4_AES_set_encrypt_key:
|
||||
sub r3,pc,#8 @ AES_set_encrypt_key
|
||||
sub r3,pc,#8 @ aes_set_encrypt_key_internal
|
||||
teq r0,#0
|
||||
moveq r0,#-1
|
||||
beq .Labrt
|
||||
|
@ -679,12 +679,12 @@ _armv4_AES_set_encrypt_key:
|
|||
.Labrt: tst lr,#1
|
||||
moveq pc,lr @ be binary compatible with V4, yet
|
||||
bx lr @ interoperable with Thumb ISA:-)
|
||||
.size AES_set_encrypt_key,.-AES_set_encrypt_key
|
||||
.size aes_set_encrypt_key_internal,.-aes_set_encrypt_key_internal
|
||||
|
||||
.global AES_set_decrypt_key
|
||||
.type AES_set_decrypt_key,%function
|
||||
.global aes_set_decrypt_key_internal
|
||||
.type aes_set_decrypt_key_internal,%function
|
||||
.align 5
|
||||
AES_set_decrypt_key:
|
||||
aes_set_decrypt_key_internal:
|
||||
str lr,[sp,#-4]! @ push lr
|
||||
bl _armv4_AES_set_encrypt_key
|
||||
teq r0,#0
|
||||
|
@ -773,7 +773,7 @@ $code.=<<___;
|
|||
moveq pc,lr @ be binary compatible with V4, yet
|
||||
bx lr @ interoperable with Thumb ISA:-)
|
||||
#endif
|
||||
.size AES_set_decrypt_key,.-AES_set_decrypt_key
|
||||
.size aes_set_decrypt_key_internal,.-aes_set_decrypt_key_internal
|
||||
|
||||
.type AES_Td,%object
|
||||
.align 5
|
||||
|
@ -877,17 +877,17 @@ AES_Td:
|
|||
.byte 0xe1, 0x69, 0x14, 0x63, 0x55, 0x21, 0x0c, 0x7d
|
||||
.size AES_Td,.-AES_Td
|
||||
|
||||
@ void AES_decrypt(const unsigned char *in, unsigned char *out,
|
||||
@ const AES_KEY *key) {
|
||||
.global AES_decrypt
|
||||
.type AES_decrypt,%function
|
||||
@ void aes_decrypt_internal(const unsigned char *in, unsigned char *out,
|
||||
@ const AES_KEY *key) {
|
||||
.global aes_decrypt_internal
|
||||
.type aes_decrypt_internal,%function
|
||||
.align 5
|
||||
AES_decrypt:
|
||||
sub r3,pc,#8 @ AES_decrypt
|
||||
aes_decrypt_internal:
|
||||
sub r3,pc,#8 @ aes_decrypt_internal
|
||||
stmdb sp!,{r1,r4-r12,lr}
|
||||
mov $rounds,r0 @ inp
|
||||
mov $key,r2
|
||||
sub $tbl,r3,#AES_decrypt-AES_Td @ Td
|
||||
sub $tbl,r3,#aes_decrypt_internal-AES_Td @ Td
|
||||
#if __ARM_ARCH__<7 || defined(__STRICT_ALIGNMENT)
|
||||
ldrb $s0,[$rounds,#3] @ load input data in endian-neutral
|
||||
ldrb $t1,[$rounds,#2] @ manner...
|
||||
|
@ -981,7 +981,7 @@ AES_decrypt:
|
|||
moveq pc,lr @ be binary compatible with V4, yet
|
||||
bx lr @ interoperable with Thumb ISA:-)
|
||||
#endif
|
||||
.size AES_decrypt,.-AES_decrypt
|
||||
.size aes_decrypt_internal,.-aes_decrypt_internal
|
||||
|
||||
.type _armv4_AES_decrypt,%function
|
||||
.align 2
|
||||
|
|
|
@ -355,9 +355,9 @@ _mips_AES_encrypt:
|
|||
.end _mips_AES_encrypt
|
||||
|
||||
.align 5
|
||||
.globl AES_encrypt
|
||||
.ent AES_encrypt
|
||||
AES_encrypt:
|
||||
.globl aes_encrypt_internal
|
||||
.ent aes_encrypt_internal
|
||||
aes_encrypt_internal:
|
||||
.frame $sp,$FRAMESIZE,$ra
|
||||
.mask $SAVED_REGS_MASK,-$SZREG
|
||||
.set noreorder
|
||||
|
@ -387,7 +387,7 @@ $code.=<<___ if ($flavour =~ /nubi/i); # optimize non-nubi prologue
|
|||
___
|
||||
$code.=<<___ if ($flavour !~ /o32/i); # non-o32 PIC-ification
|
||||
.cplocal $Tbl
|
||||
.cpsetup $pf,$zero,AES_encrypt
|
||||
.cpsetup $pf,$zero,aes_encrypt_internal
|
||||
___
|
||||
$code.=<<___;
|
||||
.set reorder
|
||||
|
@ -435,7 +435,7 @@ ___
|
|||
$code.=<<___;
|
||||
jr $ra
|
||||
$PTR_ADD $sp,$FRAMESIZE
|
||||
.end AES_encrypt
|
||||
.end aes_encrypt_internal
|
||||
___
|
||||
|
||||
$code.=<<___;
|
||||
|
@ -691,9 +691,9 @@ _mips_AES_decrypt:
|
|||
.end _mips_AES_decrypt
|
||||
|
||||
.align 5
|
||||
.globl AES_decrypt
|
||||
.ent AES_decrypt
|
||||
AES_decrypt:
|
||||
.globl aes_decrypt_internal
|
||||
.ent aes_decrypt_internal
|
||||
aes_decrypt_internal:
|
||||
.frame $sp,$FRAMESIZE,$ra
|
||||
.mask $SAVED_REGS_MASK,-$SZREG
|
||||
.set noreorder
|
||||
|
@ -723,7 +723,7 @@ $code.=<<___ if ($flavour =~ /nubi/i); # optimize non-nubi prologue
|
|||
___
|
||||
$code.=<<___ if ($flavour !~ /o32/i); # non-o32 PIC-ification
|
||||
.cplocal $Tbl
|
||||
.cpsetup $pf,$zero,AES_decrypt
|
||||
.cpsetup $pf,$zero,aes_decrypt_internal
|
||||
___
|
||||
$code.=<<___;
|
||||
.set reorder
|
||||
|
@ -771,7 +771,7 @@ ___
|
|||
$code.=<<___;
|
||||
jr $ra
|
||||
$PTR_ADD $sp,$FRAMESIZE
|
||||
.end AES_decrypt
|
||||
.end aes_decrypt_internal
|
||||
___
|
||||
}}}
|
||||
|
||||
|
@ -1038,9 +1038,9 @@ _mips_AES_set_encrypt_key:
|
|||
nop
|
||||
.end _mips_AES_set_encrypt_key
|
||||
|
||||
.globl AES_set_encrypt_key
|
||||
.ent AES_set_encrypt_key
|
||||
AES_set_encrypt_key:
|
||||
.globl aes_set_encrypt_key_internal
|
||||
.ent aes_set_encrypt_key_internal
|
||||
aes_set_encrypt_key_internal:
|
||||
.frame $sp,$FRAMESIZE,$ra
|
||||
.mask $SAVED_REGS_MASK,-$SZREG
|
||||
.set noreorder
|
||||
|
@ -1062,7 +1062,7 @@ $code.=<<___ if ($flavour =~ /nubi/i); # optimize non-nubi prologue
|
|||
___
|
||||
$code.=<<___ if ($flavour !~ /o32/i); # non-o32 PIC-ification
|
||||
.cplocal $Tbl
|
||||
.cpsetup $pf,$zero,AES_set_encrypt_key
|
||||
.cpsetup $pf,$zero,aes_set_encrypt_key_internal
|
||||
___
|
||||
$code.=<<___;
|
||||
.set reorder
|
||||
|
@ -1085,7 +1085,7 @@ ___
|
|||
$code.=<<___;
|
||||
jr $ra
|
||||
$PTR_ADD $sp,$FRAMESIZE
|
||||
.end AES_set_encrypt_key
|
||||
.end aes_set_encrypt_key_internal
|
||||
___
|
||||
|
||||
my ($head,$tail)=($inp,$bits);
|
||||
|
@ -1093,9 +1093,9 @@ 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);
|
||||
$code.=<<___;
|
||||
.align 5
|
||||
.globl AES_set_decrypt_key
|
||||
.ent AES_set_decrypt_key
|
||||
AES_set_decrypt_key:
|
||||
.globl aes_set_decrypt_key_internal
|
||||
.ent aes_set_decrypt_key_internal
|
||||
aes_set_decrypt_key_internal:
|
||||
.frame $sp,$FRAMESIZE,$ra
|
||||
.mask $SAVED_REGS_MASK,-$SZREG
|
||||
.set noreorder
|
||||
|
@ -1117,7 +1117,7 @@ $code.=<<___ if ($flavour =~ /nubi/i); # optimize non-nubi prologue
|
|||
___
|
||||
$code.=<<___ if ($flavour !~ /o32/i); # non-o32 PIC-ification
|
||||
.cplocal $Tbl
|
||||
.cpsetup $pf,$zero,AES_set_decrypt_key
|
||||
.cpsetup $pf,$zero,aes_set_decrypt_key_internal
|
||||
___
|
||||
$code.=<<___;
|
||||
.set reorder
|
||||
|
@ -1228,7 +1228,7 @@ ___
|
|||
$code.=<<___;
|
||||
jr $ra
|
||||
$PTR_ADD $sp,$FRAMESIZE
|
||||
.end AES_set_decrypt_key
|
||||
.end aes_set_decrypt_key_internal
|
||||
___
|
||||
}}}
|
||||
|
||||
|
|
|
@ -66,9 +66,9 @@ $code=<<___;
|
|||
.LEVEL $LEVEL
|
||||
.text
|
||||
|
||||
.EXPORT AES_encrypt,ENTRY,ARGW0=GR,ARGW1=GR,ARGW2=GR
|
||||
.EXPORT aes_encrypt_internal,ENTRY,ARGW0=GR,ARGW1=GR,ARGW2=GR
|
||||
.ALIGN 64
|
||||
AES_encrypt
|
||||
aes_encrypt_internal
|
||||
.PROC
|
||||
.CALLINFO FRAME=`$FRAME-16*$SIZE_T`,NO_CALLS,SAVE_RP,ENTRY_GR=18
|
||||
.ENTRY
|
||||
|
@ -540,9 +540,9 @@ L\$AES_Te
|
|||
___
|
||||
|
||||
$code.=<<___;
|
||||
.EXPORT AES_decrypt,ENTRY,ARGW0=GR,ARGW1=GR,ARGW2=GR
|
||||
.EXPORT aes_decrypt_internal,ENTRY,ARGW0=GR,ARGW1=GR,ARGW2=GR
|
||||
.ALIGN 16
|
||||
AES_decrypt
|
||||
aes_decrypt_internal
|
||||
.PROC
|
||||
.CALLINFO FRAME=`$FRAME-16*$SIZE_T`,NO_CALLS,SAVE_RP,ENTRY_GR=18
|
||||
.ENTRY
|
||||
|
|
|
@ -327,9 +327,9 @@ $code.=<<___;
|
|||
.byte 0xe1, 0x69, 0x14, 0x63, 0x55, 0x21, 0x0c, 0x7d
|
||||
|
||||
|
||||
.globl .AES_encrypt
|
||||
.globl .aes_encrypt_internal
|
||||
.align 7
|
||||
.AES_encrypt:
|
||||
.aes_encrypt_internal:
|
||||
$STU $sp,-$FRAME($sp)
|
||||
mflr r0
|
||||
|
||||
|
@ -754,9 +754,9 @@ Lenc_compact_done:
|
|||
xor $s3,$s3,$t3
|
||||
blr
|
||||
|
||||
.globl .AES_decrypt
|
||||
.globl .aes_decrypt_internal
|
||||
.align 7
|
||||
.AES_decrypt:
|
||||
.aes_decrypt_internal:
|
||||
$STU $sp,-$FRAME($sp)
|
||||
mflr r0
|
||||
|
||||
|
|
|
@ -511,8 +511,8 @@ _sparcv9_AES_encrypt:
|
|||
.size _sparcv9_AES_encrypt,(.-_sparcv9_AES_encrypt)
|
||||
|
||||
.align 32
|
||||
.globl AES_encrypt
|
||||
AES_encrypt:
|
||||
.globl aes_encrypt_internal
|
||||
aes_encrypt_internal:
|
||||
save %sp,-$frame,%sp
|
||||
#ifdef __PIC__
|
||||
sethi %hi(_GLOBAL_OFFSET_TABLE_-4), %o5
|
||||
|
@ -638,8 +638,8 @@ AES_encrypt:
|
|||
|
||||
ret
|
||||
restore
|
||||
.type AES_encrypt,#function
|
||||
.size AES_encrypt,(.-AES_encrypt)
|
||||
.type aes_encrypt_internal,#function
|
||||
.size aes_encrypt_internal,(.-aes_encrypt_internal)
|
||||
|
||||
___
|
||||
|
||||
|
@ -1075,8 +1075,8 @@ _sparcv9_AES_decrypt:
|
|||
.size _sparcv9_AES_decrypt,(.-_sparcv9_AES_decrypt)
|
||||
|
||||
.align 32
|
||||
.globl AES_decrypt
|
||||
AES_decrypt:
|
||||
.globl aes_decrypt_internal
|
||||
aes_decrypt_internal:
|
||||
save %sp,-$frame,%sp
|
||||
#ifdef __PIC__
|
||||
sethi %hi(_GLOBAL_OFFSET_TABLE_-4), %o5
|
||||
|
@ -1202,8 +1202,8 @@ AES_decrypt:
|
|||
|
||||
ret
|
||||
restore
|
||||
.type AES_decrypt,#function
|
||||
.size AES_decrypt,(.-AES_decrypt)
|
||||
.type aes_decrypt_internal,#function
|
||||
.size aes_decrypt_internal,(.-aes_decrypt_internal)
|
||||
___
|
||||
|
||||
# fmovs instructions substituting for FP nops were originally added
|
||||
|
|
|
@ -586,15 +586,15 @@ $code.=<<___;
|
|||
.size _x86_64_AES_encrypt_compact,.-_x86_64_AES_encrypt_compact
|
||||
___
|
||||
|
||||
# void AES_encrypt (const void *inp,void *out,const AES_KEY *key);
|
||||
# void aes_encrypt_internal(const void *inp, void *out, const AES_KEY *key);
|
||||
$code.=<<___;
|
||||
.globl AES_encrypt
|
||||
.type AES_encrypt,\@function,3
|
||||
.globl aes_encrypt_internal
|
||||
.type aes_encrypt_internal,\@function,3
|
||||
.align 16
|
||||
.globl asm_AES_encrypt
|
||||
.hidden asm_AES_encrypt
|
||||
asm_AES_encrypt:
|
||||
AES_encrypt:
|
||||
aes_encrypt_internal:
|
||||
_CET_ENDBR
|
||||
push %rbx
|
||||
push %rbp
|
||||
|
@ -655,7 +655,7 @@ AES_encrypt:
|
|||
lea 48(%rsi),%rsp
|
||||
.Lenc_epilogue:
|
||||
ret
|
||||
.size AES_encrypt,.-AES_encrypt
|
||||
.size aes_encrypt_internal,.-aes_encrypt_internal
|
||||
___
|
||||
|
||||
#------------------------------------------------------------------#
|
||||
|
@ -1188,15 +1188,15 @@ $code.=<<___;
|
|||
.size _x86_64_AES_decrypt_compact,.-_x86_64_AES_decrypt_compact
|
||||
___
|
||||
|
||||
# void AES_decrypt (const void *inp,void *out,const AES_KEY *key);
|
||||
# void aes_decrypt_internal(const void *inp, void *out, const AES_KEY *key);
|
||||
$code.=<<___;
|
||||
.globl AES_decrypt
|
||||
.type AES_decrypt,\@function,3
|
||||
.globl aes_decrypt_internal
|
||||
.type aes_decrypt_internal,\@function,3
|
||||
.align 16
|
||||
.globl asm_AES_decrypt
|
||||
.hidden asm_AES_decrypt
|
||||
asm_AES_decrypt:
|
||||
AES_decrypt:
|
||||
aes_decrypt_internal:
|
||||
_CET_ENDBR
|
||||
push %rbx
|
||||
push %rbp
|
||||
|
@ -1259,7 +1259,7 @@ AES_decrypt:
|
|||
lea 48(%rsi),%rsp
|
||||
.Ldec_epilogue:
|
||||
ret
|
||||
.size AES_decrypt,.-AES_decrypt
|
||||
.size aes_decrypt_internal,.-aes_decrypt_internal
|
||||
___
|
||||
#------------------------------------------------------------------#
|
||||
|
||||
|
@ -1290,13 +1290,13 @@ $code.=<<___;
|
|||
___
|
||||
}
|
||||
|
||||
# int AES_set_encrypt_key(const unsigned char *userKey, const int bits,
|
||||
# AES_KEY *key)
|
||||
# int aes_set_encrypt_key_internal(const unsigned char *userKey, const int bits,
|
||||
# AES_KEY *key)
|
||||
$code.=<<___;
|
||||
.globl AES_set_encrypt_key
|
||||
.type AES_set_encrypt_key,\@function,3
|
||||
.globl aes_set_encrypt_key_internal
|
||||
.type aes_set_encrypt_key_internal,\@function,3
|
||||
.align 16
|
||||
AES_set_encrypt_key:
|
||||
aes_set_encrypt_key_internal:
|
||||
_CET_ENDBR
|
||||
push %rbx
|
||||
push %rbp
|
||||
|
@ -1318,7 +1318,7 @@ AES_set_encrypt_key:
|
|||
add \$56,%rsp
|
||||
.Lenc_key_epilogue:
|
||||
ret
|
||||
.size AES_set_encrypt_key,.-AES_set_encrypt_key
|
||||
.size aes_set_encrypt_key_internal,.-aes_set_encrypt_key_internal
|
||||
|
||||
.type _x86_64_AES_set_encrypt_key,\@abi-omnipotent
|
||||
.align 16
|
||||
|
@ -1562,13 +1562,13 @@ $code.=<<___;
|
|||
___
|
||||
}
|
||||
|
||||
# int AES_set_decrypt_key(const unsigned char *userKey, const int bits,
|
||||
# AES_KEY *key)
|
||||
# int aes_set_decrypt_key_internal(const unsigned char *userKey, const int bits,
|
||||
# AES_KEY *key)
|
||||
$code.=<<___;
|
||||
.globl AES_set_decrypt_key
|
||||
.type AES_set_decrypt_key,\@function,3
|
||||
.globl aes_set_decrypt_key_internal
|
||||
.type aes_set_decrypt_key_internal,\@function,3
|
||||
.align 16
|
||||
AES_set_decrypt_key:
|
||||
aes_set_decrypt_key_internal:
|
||||
_CET_ENDBR
|
||||
push %rbx
|
||||
push %rbp
|
||||
|
@ -1638,7 +1638,7 @@ $code.=<<___;
|
|||
add \$56,%rsp
|
||||
.Ldec_key_epilogue:
|
||||
ret
|
||||
.size AES_set_decrypt_key,.-AES_set_decrypt_key
|
||||
.size aes_set_decrypt_key_internal,.-aes_set_decrypt_key_internal
|
||||
___
|
||||
|
||||
# void aes_cbc_encrypt_internal(const void char *inp, unsigned char *out,
|
||||
|
@ -2782,21 +2782,21 @@ cbc_se_handler:
|
|||
|
||||
.section .pdata
|
||||
.align 4
|
||||
.rva .LSEH_begin_AES_encrypt
|
||||
.rva .LSEH_end_AES_encrypt
|
||||
.rva .LSEH_info_AES_encrypt
|
||||
.rva .LSEH_begin_aes_encrypt_internal
|
||||
.rva .LSEH_end_aes_encrypt_internal
|
||||
.rva .LSEH_info_aes_encrypt_internal
|
||||
|
||||
.rva .LSEH_begin_AES_decrypt
|
||||
.rva .LSEH_end_AES_decrypt
|
||||
.rva .LSEH_info_AES_decrypt
|
||||
.rva .LSEH_begin_aes_decrypt_internal
|
||||
.rva .LSEH_end_aes_decrypt_internal
|
||||
.rva .LSEH_info_aes_decrypt_internal
|
||||
|
||||
.rva .LSEH_begin_AES_set_encrypt_key
|
||||
.rva .LSEH_end_AES_set_encrypt_key
|
||||
.rva .LSEH_info_AES_set_encrypt_key
|
||||
.rva .LSEH_begin_aes_set_encrypt_key_internal
|
||||
.rva .LSEH_end_aes_set_encrypt_key_internal
|
||||
.rva .LSEH_info_aes_set_encrypt_key_internal
|
||||
|
||||
.rva .LSEH_begin_AES_set_decrypt_key
|
||||
.rva .LSEH_end_AES_set_decrypt_key
|
||||
.rva .LSEH_info_AES_set_decrypt_key
|
||||
.rva .LSEH_begin_aes_set_decrypt_key_internal
|
||||
.rva .LSEH_end_aes_set_decrypt_key_internal
|
||||
.rva .LSEH_info_aes_set_decrypt_key_internal
|
||||
|
||||
.rva .LSEH_begin_aes_cbc_encrypt_internal
|
||||
.rva .LSEH_end_aes_cbc_encrypt_internal
|
||||
|
@ -2804,19 +2804,19 @@ cbc_se_handler:
|
|||
|
||||
.section .xdata
|
||||
.align 8
|
||||
.LSEH_info_AES_encrypt:
|
||||
.LSEH_info_aes_encrypt_internal:
|
||||
.byte 9,0,0,0
|
||||
.rva block_se_handler
|
||||
.rva .Lenc_prologue,.Lenc_epilogue # HandlerData[]
|
||||
.LSEH_info_AES_decrypt:
|
||||
.LSEH_info_aes_decrypt_internal:
|
||||
.byte 9,0,0,0
|
||||
.rva block_se_handler
|
||||
.rva .Ldec_prologue,.Ldec_epilogue # HandlerData[]
|
||||
.LSEH_info_AES_set_encrypt_key:
|
||||
.LSEH_info_aes_set_encrypt_key_internal:
|
||||
.byte 9,0,0,0
|
||||
.rva key_se_handler
|
||||
.rva .Lenc_key_prologue,.Lenc_key_epilogue # HandlerData[]
|
||||
.LSEH_info_AES_set_decrypt_key:
|
||||
.LSEH_info_aes_set_decrypt_key_internal:
|
||||
.byte 9,0,0,0
|
||||
.rva key_se_handler
|
||||
.rva .Ldec_key_prologue,.Ldec_key_epilogue # HandlerData[]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue