Skip to content

Commit 60f55a6

Browse files
authored
keccak: OpenSSL skip MacOS test (#508)
1 parent dca3a85 commit 60f55a6

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

tests/t_hash_keccak_sha3_vs_openssl.nim

+7-7
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ else:
2727

2828
# OpenSSL wrapper
2929
# --------------------------------------------------------------------
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):
3232
proc EVP_Q_digest[T: byte|char](
3333
ossl_libctx: pointer,
3434
algoName: cstring,
@@ -107,7 +107,7 @@ proc t_keccak256_abclong =
107107
const SmallSizeIters = 64
108108
const LargeSizeIters = 1
109109

110-
when not defined(windows):
110+
when not defined(windows) and not defined(macosx):
111111
proc innerTest(rng: var RngState, sizeRange: Slice[int]) =
112112
let size = rng.random_unsafe(sizeRange)
113113
let msg = rng.random_byte_seq(size)
@@ -172,7 +172,7 @@ proc main() =
172172
var rng: RngState
173173
rng.seed(0xFACADE)
174174

175-
when not defined(windows):
175+
when not defined(windows) and not defined(macosx):
176176
echo "SHA3-256 - 0 <= size < 64 - exhaustive"
177177
for i in 0 ..< 64:
178178
rng.innerTest(i .. i)
@@ -183,7 +183,7 @@ proc main() =
183183
for i in 0 ..< 64:
184184
rng.chunkTest(i .. i)
185185

186-
when not defined(windows):
186+
when not defined(windows)and not defined(macosx):
187187
echo "SHA3-256 - 135 <= size < 138 - exhaustive (sponge rate = 136)"
188188
for i in 135 ..< 138:
189189
rng.innerTest(i .. i)
@@ -194,7 +194,7 @@ proc main() =
194194
for i in 135 ..< 138:
195195
rng.chunkTest(i .. i)
196196

197-
when not defined(windows):
197+
when not defined(windows) and not defined(macosx):
198198
echo "SHA3-256 - 64 <= size < 1024B"
199199
for _ in 0 ..< SmallSizeIters:
200200
rng.innerTest(0 ..< 1024)
@@ -203,7 +203,7 @@ proc main() =
203203
for _ in 0 ..< SmallSizeIters:
204204
rng.chunkTest(0 ..< 1024)
205205

206-
when not defined(windows):
206+
when not defined(windows) and not defined(macosx):
207207
echo "SHA3-256 - 1MB <= size < 50MB"
208208
for _ in 0 ..< LargeSizeIters:
209209
rng.innerTest(1_000_000 ..< 50_000_000)

0 commit comments

Comments
 (0)