diff options
author | miod <> | 2014-04-17 18:16:45 +0000 |
---|---|---|
committer | miod <> | 2014-04-17 18:16:45 +0000 |
commit | 6b39fdab5868da712ead9164b4680bd7a7d86773 (patch) | |
tree | 90883ba640e038606eee09fb5c784c3df7903a8e /src/lib/libcrypto/armv4cpuid.S | |
parent | d2037bc80eb83a1694b3e3458e6df04d0b9b29f1 (diff) | |
download | openbsd-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/armv4cpuid.S')
-rw-r--r-- | src/lib/libcrypto/armv4cpuid.S | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/src/lib/libcrypto/armv4cpuid.S b/src/lib/libcrypto/armv4cpuid.S index 2d618deaa4..bdfde19c1f 100644 --- a/src/lib/libcrypto/armv4cpuid.S +++ b/src/lib/libcrypto/armv4cpuid.S | |||
@@ -54,38 +54,6 @@ OPENSSL_atomic_add: | |||
54 | #endif | 54 | #endif |
55 | .size OPENSSL_atomic_add,.-OPENSSL_atomic_add | 55 | .size OPENSSL_atomic_add,.-OPENSSL_atomic_add |
56 | 56 | ||
57 | .global OPENSSL_cleanse | ||
58 | .type OPENSSL_cleanse,%function | ||
59 | OPENSSL_cleanse: | ||
60 | eor ip,ip,ip | ||
61 | cmp r1,#7 | ||
62 | subhs r1,r1,#4 | ||
63 | bhs .Lot | ||
64 | cmp r1,#0 | ||
65 | beq .Lcleanse_done | ||
66 | .Little: | ||
67 | strb ip,[r0],#1 | ||
68 | subs r1,r1,#1 | ||
69 | bhi .Little | ||
70 | b .Lcleanse_done | ||
71 | |||
72 | .Lot: tst r0,#3 | ||
73 | beq .Laligned | ||
74 | strb ip,[r0],#1 | ||
75 | sub r1,r1,#1 | ||
76 | b .Lot | ||
77 | .Laligned: | ||
78 | str ip,[r0],#4 | ||
79 | subs r1,r1,#4 | ||
80 | bhs .Laligned | ||
81 | adds r1,r1,#4 | ||
82 | bne .Little | ||
83 | .Lcleanse_done: | ||
84 | tst lr,#1 | ||
85 | moveq pc,lr | ||
86 | .word 0xe12fff1e @ bx lr | ||
87 | .size OPENSSL_cleanse,.-OPENSSL_cleanse | ||
88 | |||
89 | .global OPENSSL_wipe_cpu | 57 | .global OPENSSL_wipe_cpu |
90 | .type OPENSSL_wipe_cpu,%function | 58 | .type OPENSSL_wipe_cpu,%function |
91 | OPENSSL_wipe_cpu: | 59 | OPENSSL_wipe_cpu: |