Ditch enacl, support DH448 and Blake2s, and fix types (#14)
* 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
This commit is contained in:
@@ -7,5 +7,18 @@
|
||||
-include_lib("eunit/include/eunit.hrl").
|
||||
|
||||
name_test() ->
|
||||
?assertMatch(<<"Noise_XK_25519_ChaChaPoly_SHA512">>,
|
||||
enoise_protocol:to_name(enoise_protocol:from_name("Noise_XK_25519_ChaChaPoly_SHA512"))).
|
||||
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))).
|
||||
|
||||
Reference in New Issue
Block a user