crypto/benchmark - replace testing allocator
Recently in my latest tests there has been an error with "testing.allocator".
error: Cannot use testing allocator outside of test block
@compileError("Cannot use testing allocator outside of test block");
cc: @jedisct1
Why not use the GPA?
Why not use the GPA?
GPA does not affect performance?
Edit
I tried it with arena alloc but not comited.
The function benchmarks scrypt and argon2. Both intentionally require a lot of memory. With a fixed buffer, they are likely to immediately return with an error, and I doubt the benchmark result is relevant.
The function benchmarks
scryptandargon2. Both intentionally require a lot of memory. With a fixed buffer, they are likely to immediately return with an error, and I doubt the benchmark result is relevant.
changed to arena.
Found another error when trying to use stage2 during the build.
Returning this error:
benchmark.zig:186:39: error: cannot load runtime value in comptime block
try Signature.verifyBatch(batch.len, batch);
I tried to make comptime var batch, however a runtime problem occurs with error: weakPublicKey on stage1.
And returning this error on stage2:
~/.local/lib/zig/std/crypto/scrypt.zig:465:47: error: cannot load runtime value in comptime block
const salt = crypt_format.saltFromBin(salt_bin.len, salt_bin);
Looks like a regression. batch.len should be (and used to be) known at comptime.
#12240