Skip to content

Commit

Permalink
Add alphacpuid.s
Browse files Browse the repository at this point in the history
  • Loading branch information
Andy Polyakov committed May 15, 2007
1 parent b2dba9b commit e119769
Show file tree
Hide file tree
Showing 3 changed files with 124 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Configure
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ my $x86_out_asm="x86cpuid-out.o:bn86-out.o co86-out.o mo86-out.o:dx86-out.o yx86
my $x86_64_asm="x86_64cpuid.o:x86_64-gcc.o x86_64-mont.o::aes-x86_64.o::md5-x86_64.o:sha1-x86_64.o sha256-x86_64.o sha512-x86_64.o::rc4-x86_64.o:::wp-x86_64.o";
my $ia64_asm="ia64cpuid.o:bn-ia64.o::aes_core.o aes_cbc.o aes-ia64.o::md5-ia64.o:sha1-ia64.o sha256-ia64.o sha512-ia64.o::rc4-ia64.o rc4_skey.o:::";
my $sparcv9_asm="sparcv9cap.o sparccpuid.o:bn-sparcv9.o sparcv9-mont.o sparcv9a-mont.o:des_enc-sparc.o fcrypt_b.o:aes_core.o aes_cbc.o aes-sparcv9.o:::sha1-sparcv9.o sha256-sparcv9.o sha512-sparcv9.o:::::";
my $alpha_asm=":bn_asm.o alpha-mont.o::::::::::";
my $alpha_asm="alphacpuid.o:bn_asm.o alpha-mont.o::::::::::";
my $s390x_asm=":bn_asm.o s390x-mont.o::aes_core.o aes_cbc.o aes-s390x.o:::sha1-s390x.o sha256-s390x.o sha512-s390x.o:::::";
my $no_asm=":::::::::::";

Expand Down
14 changes: 7 additions & 7 deletions TABLE
Original file line number Diff line number Diff line change
Expand Up @@ -2696,7 +2696,7 @@ $thread_cflag = -D_REENTRANT
$sys_id =
$lflags =
$bn_ops = SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_PTR DES_RISC1 DES_UNROLL
$cpuid_obj =
$cpuid_obj = alphacpuid.o
$bn_obj = bn_asm.o alpha-mont.o
$des_obj =
$aes_obj =
Expand Down Expand Up @@ -2724,7 +2724,7 @@ $thread_cflag = -D_REENTRANT
$sys_id =
$lflags = -ldl
$bn_ops = SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_RISC1 DES_UNROLL
$cpuid_obj =
$cpuid_obj = alphacpuid.o
$bn_obj = bn_asm.o alpha-mont.o
$des_obj =
$aes_obj =
Expand Down Expand Up @@ -2752,7 +2752,7 @@ $thread_cflag = -D_REENTRANT
$sys_id =
$lflags =
$bn_ops = SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_PTR DES_RISC1 DES_UNROLL
$cpuid_obj =
$cpuid_obj = alphacpuid.o
$bn_obj = bn_asm.o alpha-mont.o
$des_obj =
$aes_obj =
Expand Down Expand Up @@ -2780,7 +2780,7 @@ $thread_cflag = -D_REENTRANT
$sys_id =
$lflags = -ldl
$bn_ops = SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_RISC1 DES_UNROLL
$cpuid_obj =
$cpuid_obj = alphacpuid.o
$bn_obj = bn_asm.o alpha-mont.o
$des_obj =
$aes_obj =
Expand Down Expand Up @@ -3480,7 +3480,7 @@ $thread_cflag = (unknown)
$sys_id =
$lflags =
$bn_ops = SIXTY_FOUR_BIT_LONG RC4_CHUNK
$cpuid_obj =
$cpuid_obj = alphacpuid.o
$bn_obj = bn_asm.o alpha-mont.o
$des_obj =
$aes_obj =
Expand Down Expand Up @@ -3508,7 +3508,7 @@ $thread_cflag = (unknown)
$sys_id =
$lflags =
$bn_ops = SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_UNROLL DES_RISC1
$cpuid_obj =
$cpuid_obj = alphacpuid.o
$bn_obj = bn_asm.o alpha-mont.o
$des_obj =
$aes_obj =
Expand Down Expand Up @@ -4096,7 +4096,7 @@ $thread_cflag = -pthread
$sys_id =
$lflags =
$bn_ops = SIXTY_FOUR_BIT_LONG RC4_CHUNK
$cpuid_obj =
$cpuid_obj = alphacpuid.o
$bn_obj = bn_asm.o alpha-mont.o
$des_obj =
$aes_obj =
Expand Down
116 changes: 116 additions & 0 deletions crypto/alphacpuid.s
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
.text

.set noat

.globl OPENSSL_wipe_cpu
.ent OPENSSL_wipe_cpu
OPENSSL_wipe_cpu:
.frame $30,0,$26
.prologue 0
clr $1
clr $2
clr $3
clr $4
clr $5
clr $6
clr $7
clr $8
clr $16
clr $17
clr $18
clr $19
clr $20
clr $21
clr $22
clr $23
clr $24
clr $25
clr $27
clr $at
clr $29
fclr $f0
fclr $f1
fclr $f10
fclr $f11
fclr $f12
fclr $f13
fclr $f14
fclr $f15
fclr $f16
fclr $f17
fclr $f18
fclr $f19
fclr $f20
fclr $f21
fclr $f22
fclr $f23
fclr $f24
fclr $f25
fclr $f26
fclr $f27
fclr $f28
fclr $f29
fclr $f30
mov $sp,$0
ret ($26)
.end OPENSSL_wipe_cpu

.globl OPENSSL_atomic_add
.ent OPENSSL_atomic_add
OPENSSL_atomic_add:
.frame $30,0,$26
.prologue 0
1: ldl_l $0,($16)
addl $0,$17,$1
stl_c $1,($16)
beq $1,1b
addl $0,$17,$0
ret ($26)
.end OPENSSL_atomic_add

.globl OPENSSL_rdtsc
.ent OPENSSL_rdtsc
OPENSSL_rdtsc:
.frame $30,0,$26
.prologue 0
rpcc $0
ret ($26)
.end OPENSSL_rdtsc

.globl OPENSSL_cleanse
.ent OPENSSL_cleanse
OPENSSL_cleanse:
.frame $30,0,$26
.prologue 0
and $16,7,$0
bic $17,7,$at
beq $at,.Little
beq $0,.Laligned

.Little:
ldq_u $1,0($16)
mov $16,$2
.Lalign:
mskbl $1,$16,$1
lda $16,1($16)
subq $17,1,$17
subq $0,1,$0
beq $17,.Lout
bne $0,.Lalign
.Lout: stq_u $1,0($2)
beq $17,.Ldone
bic $17,7,$at
mov $17,$0
beq $at,.Little

.Laligned:
stq $31,0($16)
subq $17,8,$17
lda $16,8($16)
bic $17,7,$at
bne $at,.Laligned
beq $17,.Ldone
mov $17,$0
br .Little
.Ldone: ret ($26)
.end OPENSSL_cleanse

0 comments on commit e119769

Please sign in to comment.