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/ia64cpuid.S | |
| 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/ia64cpuid.S')
| -rw-r--r-- | src/lib/libcrypto/ia64cpuid.S | 39 |
1 files changed, 0 insertions, 39 deletions
diff --git a/src/lib/libcrypto/ia64cpuid.S b/src/lib/libcrypto/ia64cpuid.S index 7832b9b640..517d938888 100644 --- a/src/lib/libcrypto/ia64cpuid.S +++ b/src/lib/libcrypto/ia64cpuid.S | |||
| @@ -126,42 +126,3 @@ OPENSSL_wipe_cpu: | |||
| 126 | mov ar.lc=r3 | 126 | mov ar.lc=r3 |
| 127 | br.ret.sptk b0 };; | 127 | br.ret.sptk b0 };; |
| 128 | .endp OPENSSL_wipe_cpu# | 128 | .endp OPENSSL_wipe_cpu# |
| 129 | |||
| 130 | .global OPENSSL_cleanse# | ||
| 131 | .proc OPENSSL_cleanse# | ||
| 132 | OPENSSL_cleanse: | ||
| 133 | { .mib; cmp.eq p6,p0=0,r33 // len==0 | ||
| 134 | #if defined(_HPUX_SOURCE) && !defined(_LP64) | ||
| 135 | addp4 r32=0,r32 | ||
| 136 | #endif | ||
| 137 | (p6) br.ret.spnt b0 };; | ||
| 138 | { .mib; and r2=7,r32 | ||
| 139 | cmp.leu p6,p0=15,r33 // len>=15 | ||
| 140 | (p6) br.cond.dptk .Lot };; | ||
| 141 | |||
| 142 | .Little: | ||
| 143 | { .mib; st1 [r32]=r0,1 | ||
| 144 | cmp.ltu p6,p7=1,r33 } // len>1 | ||
| 145 | { .mbb; add r33=-1,r33 // len-- | ||
| 146 | (p6) br.cond.dptk .Little | ||
| 147 | (p7) br.ret.sptk.many b0 };; | ||
| 148 | |||
| 149 | .Lot: | ||
| 150 | { .mib; cmp.eq p6,p0=0,r2 | ||
| 151 | (p6) br.cond.dptk .Laligned };; | ||
| 152 | { .mmi; st1 [r32]=r0,1;; | ||
| 153 | and r2=7,r32 } | ||
| 154 | { .mib; add r33=-1,r33 | ||
| 155 | br .Lot };; | ||
| 156 | |||
| 157 | .Laligned: | ||
| 158 | { .mmi; st8 [r32]=r0,8 | ||
| 159 | and r2=-8,r33 // len&~7 | ||
| 160 | add r33=-8,r33 };; // len-=8 | ||
| 161 | { .mib; cmp.ltu p6,p0=8,r2 // ((len+8)&~7)>8 | ||
| 162 | (p6) br.cond.dptk .Laligned };; | ||
| 163 | |||
| 164 | { .mbb; cmp.eq p6,p7=r0,r33 | ||
| 165 | (p7) br.cond.dpnt .Little | ||
| 166 | (p6) br.ret.sptk.many b0 };; | ||
| 167 | .endp OPENSSL_cleanse# | ||
