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
-15
View File
@@ -1,20 +1,5 @@
-define(MAX_NONCE, 16#FFFFFFFFFFFFFFFF).
-define(AD_LEN, 16).
-record(noise_protocol,
{ hs_pattern = noiseNN %:: noise_hs_pattern()
, dh = dh25519 %:: noise_dh()
, cipher = 'ChaChaPoly' %:: noise_cipher()
, hash = blake2b %:: noise_hash()
}).
-record(key_pair, { puk, pik }).
-record(noise_hs, { ss :: enoise_sym_state: state()
, s :: #key_pair{} | undefined
, e :: #key_pair{} | undefined
, rs :: binary() | undefined
, re :: binary() | undefined
, role = initiatior :: initiator | responder
, dh
, msgs = [] }).