19 Commits

Author SHA1 Message Date
David Fifield
d803f5c4b0 Add SetNonce to CipherState. 2022-02-14 11:49:34 -05:00
Jonathan Rudenberg
927fa1b4bb Add ErrMaxNonce before n overflows 2021-04-22 17:10:02 -04:00
Jonathan Rudenberg
0d4f803fc7 Return error from CipherSuite.Encrypt 2021-04-22 17:10:02 -04:00
Jonathan Rudenberg
8554521d17 Fix lint complaints 2021-04-20 16:56:08 -04:00
Nate Brown
5a73e02a33 Roll back static key in the face of failure 2021-03-30 16:50:25 -04:00
Jonathan Rudenberg
01638cb52d
Revert "added GetNonce and SetNonce following Noise revision 33 (aimed at UDP-based protocols) (#25)" (#26)
This reverts commit 0530451f2f3cf213f6e237b9b056876e3edc4e97.
2018-01-24 15:22:32 -05:00
David Wong
0530451f2f added GetNonce and SetNonce following Noise revision 33 (aimed at UDP-based protocols) (#25)
* added GetNonce and SetNonce following Noise revision 33 (aimed at UDP-based protocols)

* removing CipherState.invalid and Cipher() functions now that SetNonce and GetNonce are here
2018-01-24 13:44:44 -05:00
Ryan Huber
7e398aa738 Replace panics with errors (#24)
* remove panics per PanicAndRecover guidance from go authors

* revert constructors to panic()

* fix vectorgen

* fix Write call too
2018-01-09 21:48:36 -05:00
David Stainton
39e9953cb9 Add the Rekey feature as described in spec
Signed-off-by: David Stainton <dstainton415@gmail.com>
2017-07-11 17:07:19 +00:00
Jason A. Donenfeld
167d176148 noise_test: update psk tests
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-05-15 13:27:28 +02:00
Jason A. Donenfeld
1dc278ed6c noise_test: use 32-byte psk
The noise spec mandates 256-bit preshared keys.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-05-15 13:24:16 +02:00
Sergey Matveev
c01f33c418 Nicely formatted long structs, for reading easiness
Signed-off-by: Sergey Matveev <stargrave@stargrave.org>
2017-01-03 10:35:34 -05:00
Jonathan Rudenberg
7e06e15681 Ensure that the handshake state doesn’t get lost if decryption fails
This allows decoding potentially malicious messages under certain
circumstances.

Signed-off-by: Jonathan Rudenberg <jonathan@titanous.com>
2016-07-14 21:27:05 -04:00
Jonathan Rudenberg
3512ab15d1 Purge _E handshake patterns 2016-04-03 11:27:42 -04:00
Jonathan Rudenberg
4db302538c Update vectors from screech 2015-11-16 16:40:09 -05:00
Jonathan Rudenberg
b11a33c4ae Add handshake Config struct
Signed-off-by: Jonathan Rudenberg <jonathan@titanous.com>
2015-11-16 13:09:47 -05:00
Jonathan Rudenberg
d760bc3534 MixPresharedKey and new vectors 2015-11-16 11:37:33 -05:00
Jonathan Rudenberg
0e9c47ad19 Implement NoisePSK revision 2 2015-11-15 17:18:33 -05:00
Jonathan Rudenberg
14af5e1fc8 Initial implementation 2015-11-15 12:50:34 -05:00