summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/x86cpuid.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/x86cpuid.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/x86cpuid.pl')
-rw-r--r--src/lib/libcrypto/x86cpuid.pl34
1 files changed, 0 insertions, 34 deletions
diff --git a/src/lib/libcrypto/x86cpuid.pl b/src/lib/libcrypto/x86cpuid.pl
index b270b44337..0da613f697 100644
--- a/src/lib/libcrypto/x86cpuid.pl
+++ b/src/lib/libcrypto/x86cpuid.pl
@@ -307,40 +307,6 @@ for (@ARGV) { $sse2=1 if (/-DOPENSSL_IA32_SSE2/); }
307 } 307 }
308&function_end_B("OPENSSL_indirect_call"); 308&function_end_B("OPENSSL_indirect_call");
309 309
310&function_begin_B("OPENSSL_cleanse");
311 &mov ("edx",&wparam(0));
312 &mov ("ecx",&wparam(1));
313 &xor ("eax","eax");
314 &cmp ("ecx",7);
315 &jae (&label("lot"));
316 &cmp ("ecx",0);
317 &je (&label("ret"));
318&set_label("little");
319 &mov (&BP(0,"edx"),"al");
320 &sub ("ecx",1);
321 &lea ("edx",&DWP(1,"edx"));
322 &jnz (&label("little"));
323&set_label("ret");
324 &ret ();
325
326&set_label("lot",16);
327 &test ("edx",3);
328 &jz (&label("aligned"));
329 &mov (&BP(0,"edx"),"al");
330 &lea ("ecx",&DWP(-1,"ecx"));
331 &lea ("edx",&DWP(1,"edx"));
332 &jmp (&label("lot"));
333&set_label("aligned");
334 &mov (&DWP(0,"edx"),"eax");
335 &lea ("ecx",&DWP(-4,"ecx"));
336 &test ("ecx",-4);
337 &lea ("edx",&DWP(4,"edx"));
338 &jnz (&label("aligned"));
339 &cmp ("ecx",0);
340 &jne (&label("little"));
341 &ret ();
342&function_end_B("OPENSSL_cleanse");
343
344&function_begin_B("OPENSSL_ia32_rdrand"); 310&function_begin_B("OPENSSL_ia32_rdrand");
345 &mov ("ecx",8); 311 &mov ("ecx",8);
346&set_label("loop"); 312&set_label("loop");