summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/pariscid.pl
diff options
context:
space:
mode:
authormiod <>2014-04-17 18:16:45 +0000
committermiod <>2014-04-17 18:16:45 +0000
commit6b39fdab5868da712ead9164b4680bd7a7d86773 (patch)
tree90883ba640e038606eee09fb5c784c3df7903a8e /src/lib/libcrypto/pariscid.pl
parentd2037bc80eb83a1694b3e3458e6df04d0b9b29f1 (diff)
downloadopenbsd-6b39fdab5868da712ead9164b4680bd7a7d86773.tar.gz
openbsd-6b39fdab5868da712ead9164b4680bd7a7d86773.tar.bz2
openbsd-6b39fdab5868da712ead9164b4680bd7a7d86773.zip
Ok, there was a need for OPENSSL_cleanse() instead of bzero() to prevent
supposedly smart compilers from optimizing memory cleanups away. Understood. Ok, in case of an hypothetically super smart compiler, OPENSSL_cleanse() had to be convoluted enough for the compiler not to recognize that this was actually bzero() in disguise. Understood. But then why there had been optimized assembler versions of OPENSSL_cleanse() is beyond me. Did someone not trust the C obfuscation?
Diffstat (limited to 'src/lib/libcrypto/pariscid.pl')
-rw-r--r--src/lib/libcrypto/pariscid.pl44
1 files changed, 0 insertions, 44 deletions
diff --git a/src/lib/libcrypto/pariscid.pl b/src/lib/libcrypto/pariscid.pl
index bfc56fdc7f..38985afbac 100644
--- a/src/lib/libcrypto/pariscid.pl
+++ b/src/lib/libcrypto/pariscid.pl
@@ -87,50 +87,6 @@ OPENSSL_wipe_cpu
87 .PROCEND 87 .PROCEND
88___ 88___
89{ 89{
90my $inp="%r26";
91my $len="%r25";
92
93$code.=<<___;
94 .EXPORT OPENSSL_cleanse,ENTRY,ARGW0=GR,ARGW1=GR
95 .ALIGN 8
96OPENSSL_cleanse
97 .PROC
98 .CALLINFO NO_CALLS
99 .ENTRY
100 cmpib,*= 0,$len,L\$done
101 nop
102 cmpib,*>>= 15,$len,L\$ittle
103 ldi $SIZE_T-1,%r1
104
105L\$align
106 and,*<> $inp,%r1,%r28
107 b,n L\$aligned
108 stb %r0,0($inp)
109 ldo -1($len),$len
110 b L\$align
111 ldo 1($inp),$inp
112
113L\$aligned
114 andcm $len,%r1,%r28
115L\$ot
116 $ST %r0,0($inp)
117 addib,*<> -$SIZE_T,%r28,L\$ot
118 ldo $SIZE_T($inp),$inp
119
120 and,*<> $len,%r1,$len
121 b,n L\$done
122L\$ittle
123 stb %r0,0($inp)
124 addib,*<> -1,$len,L\$ittle
125 ldo 1($inp),$inp
126L\$done
127 bv ($rp)
128 .EXIT
129 nop
130 .PROCEND
131___
132}
133{
134my ($out,$cnt,$max)=("%r26","%r25","%r24"); 90my ($out,$cnt,$max)=("%r26","%r25","%r24");
135my ($tick,$lasttick)=("%r23","%r22"); 91my ($tick,$lasttick)=("%r23","%r22");
136my ($diff,$lastdiff)=("%r21","%r20"); 92my ($diff,$lastdiff)=("%r21","%r20");