27
27
28
28
# OpenSSL wrapper
29
29
# --------------------------------------------------------------------
30
- # Hash API isn't available on Windows
31
- when not defined (windows):
30
+ # Hash API isn't available on Windows, MacOS uses LibreSSL which doesn't provide OpenSSL 3.0 API as well
31
+ when not defined (windows) and not defined (macosx) :
32
32
proc EVP_Q_digest [T: byte | char ](
33
33
ossl_libctx: pointer ,
34
34
algoName: cstring ,
@@ -107,7 +107,7 @@ proc t_keccak256_abclong =
107
107
const SmallSizeIters = 64
108
108
const LargeSizeIters = 1
109
109
110
- when not defined (windows):
110
+ when not defined (windows) and not defined (macosx) :
111
111
proc innerTest (rng: var RngState , sizeRange: Slice [int ]) =
112
112
let size = rng.random_unsafe (sizeRange)
113
113
let msg = rng.random_byte_seq (size)
@@ -172,7 +172,7 @@ proc main() =
172
172
var rng: RngState
173
173
rng.seed (0x FACADE )
174
174
175
- when not defined (windows):
175
+ when not defined (windows) and not defined (macosx) :
176
176
echo " SHA3-256 - 0 <= size < 64 - exhaustive"
177
177
for i in 0 ..< 64 :
178
178
rng.innerTest (i .. i)
@@ -183,7 +183,7 @@ proc main() =
183
183
for i in 0 ..< 64 :
184
184
rng.chunkTest (i .. i)
185
185
186
- when not defined (windows):
186
+ when not defined (windows)and not defined (macosx) :
187
187
echo " SHA3-256 - 135 <= size < 138 - exhaustive (sponge rate = 136)"
188
188
for i in 135 ..< 138 :
189
189
rng.innerTest (i .. i)
@@ -194,7 +194,7 @@ proc main() =
194
194
for i in 135 ..< 138 :
195
195
rng.chunkTest (i .. i)
196
196
197
- when not defined (windows):
197
+ when not defined (windows) and not defined (macosx) :
198
198
echo " SHA3-256 - 64 <= size < 1024B"
199
199
for _ in 0 ..< SmallSizeIters :
200
200
rng.innerTest (0 ..< 1024 )
@@ -203,7 +203,7 @@ proc main() =
203
203
for _ in 0 ..< SmallSizeIters :
204
204
rng.chunkTest (0 ..< 1024 )
205
205
206
- when not defined (windows):
206
+ when not defined (windows) and not defined (macosx) :
207
207
echo " SHA3-256 - 1MB <= size < 50MB"
208
208
for _ in 0 ..< LargeSizeIters :
209
209
rng.innerTest (1_000_000 ..< 50_000_000 )
0 commit comments