summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/modes/asm/ghash-sparcv9.pl
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/lib/libcrypto/modes/asm/ghash-sparcv9.pl35
1 files changed, 28 insertions, 7 deletions
diff --git a/src/lib/libcrypto/modes/asm/ghash-sparcv9.pl b/src/lib/libcrypto/modes/asm/ghash-sparcv9.pl
index 70e7b044a3..ce75045f09 100644
--- a/src/lib/libcrypto/modes/asm/ghash-sparcv9.pl
+++ b/src/lib/libcrypto/modes/asm/ghash-sparcv9.pl
@@ -67,7 +67,7 @@ $inp="%i2";
67$len="%i3"; 67$len="%i3";
68 68
69$code.=<<___; 69$code.=<<___;
70.section ".text",#alloc,#execinstr 70.section ".rodata",#alloc
71 71
72.align 64 72.align 64
73rem_4bit: 73rem_4bit:
@@ -78,18 +78,30 @@ rem_4bit:
78.type rem_4bit,#object 78.type rem_4bit,#object
79.size rem_4bit,(.-rem_4bit) 79.size rem_4bit,(.-rem_4bit)
80 80
81.section ".text",#alloc,#execinstr
81.globl gcm_ghash_4bit 82.globl gcm_ghash_4bit
82.align 32 83.align 32
83gcm_ghash_4bit: 84gcm_ghash_4bit:
84 save %sp,-$frame,%sp 85 save %sp,-$frame,%sp
86#ifdef __PIC__
87 sethi %hi(_GLOBAL_OFFSET_TABLE_-4), $tmp
88 rd %pc, $rem
89 or $tmp, %lo(_GLOBAL_OFFSET_TABLE_+4), $tmp
90 add $tmp, $rem, $tmp
91#endif
92
85 ldub [$inp+15],$nlo 93 ldub [$inp+15],$nlo
86 ldub [$Xi+15],$xi0 94 ldub [$Xi+15],$xi0
87 ldub [$Xi+14],$xi1 95 ldub [$Xi+14],$xi1
88 add $len,$inp,$len 96 add $len,$inp,$len
89 add $Htbl,8,$Htblo 97 add $Htbl,8,$Htblo
90 98
911: call .+8 99#ifdef __PIC__
92 add %o7,rem_4bit-1b,$rem_4bit 100 set rem_4bit, $rem_4bit
101 ldx [$rem_4bit+$tmp], $rem_4bit
102#else
103 set rem_4bit, $rem_4bit
104#endif
93 105
94.Louter: 106.Louter:
95 xor $xi0,$nlo,$nlo 107 xor $xi0,$nlo,$nlo
@@ -223,11 +235,22 @@ $code.=<<___;
223.align 32 235.align 32
224gcm_gmult_4bit: 236gcm_gmult_4bit:
225 save %sp,-$frame,%sp 237 save %sp,-$frame,%sp
238#ifdef __PIC__
239 sethi %hi(_GLOBAL_OFFSET_TABLE_-4), $tmp
240 rd %pc, $rem
241 or $tmp, %lo(_GLOBAL_OFFSET_TABLE_+4), $tmp
242 add $tmp, $rem, $tmp
243#endif
244
226 ldub [$Xi+15],$nlo 245 ldub [$Xi+15],$nlo
227 add $Htbl,8,$Htblo 246 add $Htbl,8,$Htblo
228 247
2291: call .+8 248#ifdef __PIC__
230 add %o7,rem_4bit-1b,$rem_4bit 249 set rem_4bit, $rem_4bit
250 ldx [$rem_4bit+$tmp], $rem_4bit
251#else
252 set rem_4bit, $rem_4bit
253#endif
231 254
232 and $nlo,0xf0,$nhi 255 and $nlo,0xf0,$nhi
233 and $nlo,0x0f,$nlo 256 and $nlo,0x0f,$nlo
@@ -321,8 +344,6 @@ gcm_gmult_4bit:
321 restore 344 restore
322.type gcm_gmult_4bit,#function 345.type gcm_gmult_4bit,#function
323.size gcm_gmult_4bit,(.-gcm_gmult_4bit) 346.size gcm_gmult_4bit,(.-gcm_gmult_4bit)
324.asciz "GHASH for SPARCv9, CRYPTOGAMS by <appro\@openssl.org>"
325.align 4
326___ 347___
327 348
328$code =~ s/\`([^\`]*)\`/eval $1/gem; 349$code =~ s/\`([^\`]*)\`/eval $1/gem;