1
0
forked from QPQ-AG/enoise

All crypto and top level in place

Limited support for protocols, virtually no error handling
This commit is contained in:
Hans Svensson
2018-03-02 14:24:59 +01:00
parent d0723eb247
commit 4d2af24250
6 changed files with 327 additions and 20 deletions
+5 -3
View File
@@ -29,9 +29,11 @@
-opaque state() :: #noise_ss{}.
-export_type([noise_hash/0, state/0]).
-spec init(Protocol :: #noise_protocol{}) -> state().
init(Protocol = #noise_protocol{ hash = Hash, cipher = Cipher }) ->
Name = enoise_protocol:to_name(Protocol),
-spec init(Protocol :: enoise_protocol:protocol()) -> state().
init(Protocol) ->
Hash = enoise_protocol:hash(Protocol),
Cipher = enoise_protocol:cipher(Protocol),
Name = enoise_protocol:to_name(Protocol),
HashLen = enoise_crypto:hashlen(Hash),
H1 =
case byte_size(Name) > HashLen of