Switch to OTP23 (#3)
* Switch to OTP23 * Update enacl test dependency Co-authored-by: Hans Svensson <hanssv@gmail.com>
This commit is contained in:
parent
527a7f077f
commit
60a079f00d
@ -3,7 +3,7 @@ version: 2.1
|
|||||||
executors:
|
executors:
|
||||||
aebuilder:
|
aebuilder:
|
||||||
docker:
|
docker:
|
||||||
- image: aeternity/builder
|
- image: aeternity/builder:bionic-otp23
|
||||||
user: builder
|
user: builder
|
||||||
working_directory: ~/src
|
working_directory: ~/src
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
{plugins, [rebar3_hex]}.
|
{plugins, [rebar3_hex]}.
|
||||||
|
|
||||||
{profiles, [{test, [{deps, [{jsx, {git, "https://github.com/talentdeficit/jsx.git", {tag, "2.8.0"}}},
|
{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,
|
{xref_checks, [undefined_function_calls, undefined_functions,
|
||||||
|
@ -28,14 +28,14 @@ benchmark_test() ->
|
|||||||
%% Benchmark Blake2b against enacl.
|
%% Benchmark Blake2b against enacl.
|
||||||
#{in := In, key := <<>>, out := Exp} = hd(filter_test_vectors(<<"blake2b">>)),
|
#{in := In, key := <<>>, out := Exp} = hd(filter_test_vectors(<<"blake2b">>)),
|
||||||
HashLen = byte_size(Exp),
|
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),
|
{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]),
|
?debugFmt("~.2f ms compared to ~.2f ms\n", [T1 / 1000, T2 / 1000]),
|
||||||
|
|
||||||
BigData = <<0:(1024*10)>>,
|
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),
|
{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]),
|
?debugFmt("~.2f ms compared to ~.2f ms\n", [T3 / 1000, T4 / 1000]),
|
||||||
@ -49,7 +49,7 @@ random_test_() ->
|
|||||||
|
|
||||||
random_test(I) ->
|
random_test(I) ->
|
||||||
Data = crypto:strong_rand_bytes(I * 50),
|
Data = crypto:strong_rand_bytes(I * 50),
|
||||||
{ok, Enacl} = enacl:generichash(64, Data),
|
Enacl = enacl:generichash(64, Data),
|
||||||
{ok, Eblake} = eblake2:blake2b(64, Data),
|
{ok, Eblake} = eblake2:blake2b(64, Data),
|
||||||
|
|
||||||
?assertEqual(Eblake, Enacl).
|
?assertEqual(Eblake, Enacl).
|
||||||
|
Loading…
x
Reference in New Issue
Block a user