diff options
| author | miod <> | 2014-04-17 18:16:45 +0000 |
|---|---|---|
| committer | miod <> | 2014-04-17 18:16:45 +0000 |
| commit | 777aa5b3f157309dd7bae673d3f2ae8f37e71457 (patch) | |
| tree | 90883ba640e038606eee09fb5c784c3df7903a8e /src/lib/libcrypto/pariscid.pl | |
| parent | 22bab90c92ee62bbe16d73084a853233fc368a8e (diff) | |
| download | openbsd-777aa5b3f157309dd7bae673d3f2ae8f37e71457.tar.gz openbsd-777aa5b3f157309dd7bae673d3f2ae8f37e71457.tar.bz2 openbsd-777aa5b3f157309dd7bae673d3f2ae8f37e71457.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.pl | 44 |
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 | { |
| 90 | my $inp="%r26"; | ||
| 91 | my $len="%r25"; | ||
| 92 | |||
| 93 | $code.=<<___; | ||
| 94 | .EXPORT OPENSSL_cleanse,ENTRY,ARGW0=GR,ARGW1=GR | ||
| 95 | .ALIGN 8 | ||
| 96 | OPENSSL_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 | |||
| 105 | L\$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 | |||
| 113 | L\$aligned | ||
| 114 | andcm $len,%r1,%r28 | ||
| 115 | L\$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 | ||
| 122 | L\$ittle | ||
| 123 | stb %r0,0($inp) | ||
| 124 | addib,*<> -1,$len,L\$ittle | ||
| 125 | ldo 1($inp),$inp | ||
| 126 | L\$done | ||
| 127 | bv ($rp) | ||
| 128 | .EXIT | ||
| 129 | nop | ||
| 130 | .PROCEND | ||
| 131 | ___ | ||
| 132 | } | ||
| 133 | { | ||
| 134 | my ($out,$cnt,$max)=("%r26","%r25","%r24"); | 90 | my ($out,$cnt,$max)=("%r26","%r25","%r24"); |
| 135 | my ($tick,$lasttick)=("%r23","%r22"); | 91 | my ($tick,$lasttick)=("%r23","%r22"); |
| 136 | my ($diff,$lastdiff)=("%r21","%r20"); | 92 | my ($diff,$lastdiff)=("%r21","%r20"); |
