Switch to OTP23 (#3)

* Switch to OTP23
* Update enacl test dependency

Co-authored-by: Hans Svensson <hanssv@gmail.com>
This commit is contained in:
Dincho Todorov 2022-08-29 15:59:29 +03:00 committed by GitHub
parent 527a7f077f
commit 60a079f00d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 5 deletions

View File

@ -3,7 +3,7 @@ version: 2.1
executors:
aebuilder:
docker:
- image: aeternity/builder
- image: aeternity/builder:bionic-otp23
user: builder
working_directory: ~/src

View File

@ -5,7 +5,7 @@
{plugins, [rebar3_hex]}.
{profiles, [{test, [{deps, [{jsx, {git, "https://github.com/talentdeficit/jsx.git", {tag, "2.8.0"}}},
{enacl, "0.17.2"}]}]}
{enacl, {git, "https://github.com/aeternity/enacl.git", {ref, "a3d010b"}}}]}]}
]}.
{xref_checks, [undefined_function_calls, undefined_functions,

View File

@ -28,14 +28,14 @@ benchmark_test() ->
%% Benchmark Blake2b against enacl.
#{in := In, key := <<>>, out := Exp} = hd(filter_test_vectors(<<"blake2b">>)),
HashLen = byte_size(Exp),
{T1, _} = timer:tc(fun() -> [ {ok, Exp} = enacl:generichash(HashLen, In) || _ <- lists:seq(1, 500) ] end),
{T1, _} = timer:tc(fun() -> [ Exp = enacl:generichash(HashLen, In) || _ <- lists:seq(1, 500) ] end),
{T2, _} = timer:tc(fun() -> [ {ok, Exp} = eblake2:blake2b(HashLen, In) || _ <- lists:seq(1, 500) ] end),
?debugFmt("~.2f ms compared to ~.2f ms\n", [T1 / 1000, T2 / 1000]),
BigData = <<0:(1024*10)>>,
{T3, _} = timer:tc(fun() -> [ {ok, _} = enacl:generichash(HashLen, BigData) || _ <- lists:seq(1, 50) ] end),
{T3, _} = timer:tc(fun() -> [ enacl:generichash(HashLen, BigData) || _ <- lists:seq(1, 50) ] end),
{T4, _} = timer:tc(fun() -> [ {ok, _} = eblake2:blake2b(HashLen, BigData) || _ <- lists:seq(1, 50) ] end),
?debugFmt("~.2f ms compared to ~.2f ms\n", [T3 / 1000, T4 / 1000]),
@ -49,7 +49,7 @@ random_test_() ->
random_test(I) ->
Data = crypto:strong_rand_bytes(I * 50),
{ok, Enacl} = enacl:generichash(64, Data),
Enacl = enacl:generichash(64, Data),
{ok, Eblake} = eblake2:blake2b(64, Data),
?assertEqual(Eblake, Enacl).