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/x86_64cpuid.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/x86_64cpuid.pl')
| -rw-r--r-- | src/lib/libcrypto/x86_64cpuid.pl | 35 |
1 files changed, 0 insertions, 35 deletions
diff --git a/src/lib/libcrypto/x86_64cpuid.pl b/src/lib/libcrypto/x86_64cpuid.pl index 6ebfd017ea..8422e91342 100644 --- a/src/lib/libcrypto/x86_64cpuid.pl +++ b/src/lib/libcrypto/x86_64cpuid.pl | |||
| @@ -172,41 +172,6 @@ OPENSSL_ia32_cpuid: | |||
| 172 | or %r9,%rax | 172 | or %r9,%rax |
| 173 | ret | 173 | ret |
| 174 | .size OPENSSL_ia32_cpuid,.-OPENSSL_ia32_cpuid | 174 | .size OPENSSL_ia32_cpuid,.-OPENSSL_ia32_cpuid |
| 175 | |||
| 176 | .globl OPENSSL_cleanse | ||
| 177 | .type OPENSSL_cleanse,\@abi-omnipotent | ||
| 178 | .align 16 | ||
| 179 | OPENSSL_cleanse: | ||
| 180 | xor %rax,%rax | ||
| 181 | cmp \$15,$arg2 | ||
| 182 | jae .Lot | ||
| 183 | cmp \$0,$arg2 | ||
| 184 | je .Lret | ||
| 185 | .Little: | ||
| 186 | mov %al,($arg1) | ||
| 187 | sub \$1,$arg2 | ||
| 188 | lea 1($arg1),$arg1 | ||
| 189 | jnz .Little | ||
| 190 | .Lret: | ||
| 191 | ret | ||
| 192 | .align 16 | ||
| 193 | .Lot: | ||
| 194 | test \$7,$arg1 | ||
| 195 | jz .Laligned | ||
| 196 | mov %al,($arg1) | ||
| 197 | lea -1($arg2),$arg2 | ||
| 198 | lea 1($arg1),$arg1 | ||
| 199 | jmp .Lot | ||
| 200 | .Laligned: | ||
| 201 | mov %rax,($arg1) | ||
| 202 | lea -8($arg2),$arg2 | ||
| 203 | test \$-8,$arg2 | ||
| 204 | lea 8($arg1),$arg1 | ||
| 205 | jnz .Laligned | ||
| 206 | cmp \$0,$arg2 | ||
| 207 | jne .Little | ||
| 208 | ret | ||
| 209 | .size OPENSSL_cleanse,.-OPENSSL_cleanse | ||
| 210 | ___ | 175 | ___ |
| 211 | 176 | ||
| 212 | print<<___ if (!$win64); | 177 | print<<___ if (!$win64); |
