
* Remove get_stacktrace (deprecated since OTP-24) * Add DH448 support and switch to crypto:generate_key for DH25519 * Switch to crypto:hash/2 for Blake2b and support Blake2s * Switch last enacl calls to crypto - no more enacl * Eqwalizer fixes Ewqalizer fix Eqwalizer fix Eqwalizer fix Eqwalizer fix Eqwalizer support Eqwalizer fix Fix tests to follow types (remote keys) * More error handling on setup * Dialyzer fix * Write CHANGELOG * Note about type-checking in README
25 lines
846 B
Erlang
25 lines
846 B
Erlang
%%%-------------------------------------------------------------------
|
|
%%% @copyright (C) 2018, Aeternity Anstalt
|
|
%%%-------------------------------------------------------------------
|
|
|
|
-module(enoise_protocol_tests).
|
|
|
|
-include_lib("eunit/include/eunit.hrl").
|
|
|
|
name_test() ->
|
|
roundtrip("Noise_XK_25519_ChaChaPoly_SHA512"),
|
|
roundtrip("Noise_NN_25519_AESGCM_BLAKE2b").
|
|
|
|
name2_test() ->
|
|
Name = "Noise_NXpsk2_25519_AESGCM_SHA512",
|
|
?assertError({name_not_recognized, Name}, enoise_protocol:from_name(Name)).
|
|
|
|
name_pattern_test() ->
|
|
Pat = "XKfallback+psk0",
|
|
RoundPat = enoise_protocol:to_name_pattern(enoise_protocol:from_name_pattern(Pat)),
|
|
?assertEqual(Pat, RoundPat).
|
|
|
|
roundtrip(Name) ->
|
|
ExpectedName = iolist_to_binary(Name),
|
|
?assertMatch(ExpectedName, enoise_protocol:to_name(enoise_protocol:from_name(Name))).
|