summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/alphacpuid.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/alphacpuid.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/alphacpuid.pl')
-rw-r--r--src/lib/libcrypto/alphacpuid.pl37
1 files changed, 0 insertions, 37 deletions
diff --git a/src/lib/libcrypto/alphacpuid.pl b/src/lib/libcrypto/alphacpuid.pl
index 4b3cbb9827..f6aea6a766 100644
--- a/src/lib/libcrypto/alphacpuid.pl
+++ b/src/lib/libcrypto/alphacpuid.pl
@@ -86,41 +86,4 @@ OPENSSL_rdtsc:
86 rpcc $0 86 rpcc $0
87 ret ($26) 87 ret ($26)
88.end OPENSSL_rdtsc 88.end OPENSSL_rdtsc
89
90.globl OPENSSL_cleanse
91.ent OPENSSL_cleanse
92OPENSSL_cleanse:
93 .frame $30,0,$26
94 .prologue 0
95 beq $17,.Ldone
96 and $16,7,$0
97 bic $17,7,$at
98 beq $at,.Little
99 beq $0,.Laligned
100
101.Little:
102 subq $0,8,$0
103 ldq_u $1,0($16)
104 mov $16,$2
105.Lalign:
106 mskbl $1,$16,$1
107 lda $16,1($16)
108 subq $17,1,$17
109 addq $0,1,$0
110 beq $17,.Lout
111 bne $0,.Lalign
112.Lout: stq_u $1,0($2)
113 beq $17,.Ldone
114 bic $17,7,$at
115 beq $at,.Little
116
117.Laligned:
118 stq $31,0($16)
119 subq $17,8,$17
120 lda $16,8($16)
121 bic $17,7,$at
122 bne $at,.Laligned
123 bne $17,.Little
124.Ldone: ret ($26)
125.end OPENSSL_cleanse
126___ 89___