Commit Graph

65 Commits

Author SHA1 Message Date
Richard Ramos b2cae9b389
Add generateKeyPairFromPrivateKey 2022-12-14 12:16:37 -04:00
Richard Ramos 815c0ed47c
Expose Hash, RS, H and add ad to Encrypt funcs 2022-12-14 12:16:29 -04:00
Richard Ramos b14b0d0806
Change project org 2022-12-14 12:16:20 -04:00
Richard Ramos 166d5e87be
Deduplicate WriteMessage content 2022-12-14 12:16:10 -04:00
Richard Ramos da2a9c978d
Upgrade to go 1.17 and rename module for easier integration 2022-12-14 12:16:01 -04:00
Richard Ramos 736a742127
Add WriteMessageAndGetPK with parameter to return list of handshake messages 2022-06-26 09:01:10 -04:00
David Fifield d803f5c4b0 Add SetNonce to CipherState. 2022-02-14 11:49:34 -05:00
Jonathan Rudenberg 2499bf1bad Fix potential DoS in Decrypt 2021-04-22 17:10:02 -04: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 fc2bb37e28
Use X25519 instead of ScalarMult for safety (#43) 2021-04-22 13:00:17 -04:00
Jonathan Rudenberg 8554521d17 Fix lint complaints 2021-04-20 16:56:08 -04:00
Jonathan Rudenberg 8aa584aaa2 Update README 2021-04-20 16:56:08 -04:00
Jonathan Rudenberg 59221ed642 Add GitHub Actions config 2021-04-20 16:56:08 -04:00
Nate Brown 4bdb43be31 Add go.mod 2021-03-31 11:38:38 -04:00
Nate Brown ecaaffdb65 go fmt pass 2021-03-30 16:51:14 -04:00
Nate Brown 5a73e02a33 Roll back static key in the face of failure 2021-03-30 16:50:25 -04:00
Gerardo Di Giacomo 2492fe189a fixing XXfallback (#29) 2018-03-26 23:05:43 -04:00
Gerardo Di Giacomo d1c47b3565 added XXfallback handshake, getters for local and peer ephemeral (#28) 2018-03-26 17:13:16 -04:00
Nathan Brown 953535c65f Add a getter for handshake msgIdx (#27) 2018-03-08 15:40:28 -05:00
Jonathan Rudenberg 01638cb52d
Revert "added GetNonce and SetNonce following Noise revision 33 (aimed at UDP-based protocols) (#25)" (#26)
This reverts commit 0530451f2f.
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
Jonathan Rudenberg f9b5bb75e2 Use HTTPS for Noise website
Signed-off-by: Jonathan Rudenberg <jonathan@titanous.com>
2017-12-28 18:14:00 -05:00
David Wong fc3a9f3b3c Removed the XR pattern and added the initiator check in WriteMessage and ReadMessage according to spec (#22)
* removed the XR pattern and added the initiator check in WriteMessage and ReadMessage according to spec

* removed extra space I shouldn't have added

* fixed vectors

* re-generated via vectorgen
2017-09-27 19:37:07 -04:00
Jonathan Rudenberg c49e9fa15d Merge pull request #20 from mimoo/mimoo-patch-1
added golang's blake2b implementation
2017-09-22 09:30:08 -04:00
David Wong a80962bd80 added golang's blake2b implementation 2017-09-22 14:18:33 +01:00
Jonathan Rudenberg 01cefa3e20 Merge pull request #15 from Katzenpost/add_rekey.1
Add Rekey as per latest specification
2017-07-11 13:14:38 -04: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
David Stainton b519438a73 gofmt
Signed-off-by: David Stainton <dstainton415@gmail.com>
2017-07-11 17:07:04 +00:00
Jonathan Rudenberg c90ff62230 Merge pull request #11 from zx2c4/psk-rework
psk mode: update for redesign
2017-05-15 09:59:50 -04:00
Jason A. Donenfeld bac779d5eb vectorgen: create even more vector combinations
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-05-15 13:31:05 +02: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
Jason A. Donenfeld 5d56e55c10 vector_test: update to new psk mode
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-05-15 13:24:16 +02:00
Jason A. Donenfeld 3bc46b50a9 vectorgen: generate psk test vectors
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-05-15 13:24:16 +02:00
Jason A. Donenfeld 1b34a57a83 vectorgen: use 32-byte psk
The noise specification mandates that preshared keys are 256-bits.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-05-15 13:21:07 +02:00
Jason A. Donenfeld 6a0d1cad82 psk mode: update for redesign
The PSK mode has been redesigned in the latest revision of Noise, which
WireGuard is using. This patch updates the library to use this new
construction. It adds a outputs parameter to HKDF, a
PresharedKeyPlacement config parameter, as well as a PSK token. This has
been tested against the latest WireGuard git master, and the two are
compatible.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-05-15 13:21:07 +02:00
Sergey Matveev 6902797927 Use faster ChaCha20-Poly1305 implementation from golang.org/x/crypto
This implementation contains SSE* related assembler code.

Signed-off-by: Sergey Matveev <stargrave@stargrave.org>
2017-01-09 11:35:45 -05:00
Sergey Matveev ab15322ad1 Use faster BLAKE2s implementation from golang.org/x/crypto
This implementation contains SSE* related assembler code.

Signed-off-by: Sergey Matveev <stargrave@stargrave.org>
2017-01-09 11:35:45 -05: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 bc8ae75ea2 Use optimized BLAKE2b implementation
Signed-off-by: Jonathan Rudenberg <jonathan@titanous.com>
2016-07-14 12:55:09 -04:00
Jonathan Rudenberg 9d48b3b0f8 Add PeerStatic method to HandshakeState
Signed-off-by: Jonathan Rudenberg <jonathan@titanous.com>
2016-07-13 19:53:24 -04:00
Jonathan Rudenberg b16acbb322 Add method to get channel binding
Signed-off-by: Jonathan Rudenberg <jonathan@titanous.com>
2016-07-13 15:28:03 -04:00
Jonathan Rudenberg ad132441f7 Update package import in vectorgen
Signed-off-by: Jonathan Rudenberg <jonathan@titanous.com>
2016-07-12 22:58:03 -04:00
Jonathan Rudenberg f63da97e27 Hide cipher functions from docs
Signed-off-by: Jonathan Rudenberg <jonathan@titanous.com>
2016-07-12 22:56:22 -04:00
Jonathan Rudenberg 9d237a2bfc Fix docs typos
Signed-off-by: Jonathan Rudenberg <jonathan@titanous.com>
2016-07-12 22:45:32 -04:00
Jonathan Rudenberg ca5f81ebf0 Improve Config docs
Signed-off-by: Jonathan Rudenberg <jonathan@titanous.com>
2016-07-12 22:44:26 -04:00
Jonathan Rudenberg 7f7abf1289 Add travis config
Signed-off-by: Jonathan Rudenberg <jonathan@titanous.com>
2016-07-12 22:23:58 -04:00