-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: David Crawshaw <[email protected]>
- Loading branch information
Showing
1 changed file
with
1 addition
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -229,8 +229,7 @@ func ParseSymmetricHexKey(s string) (SymmetricKey, error) { | |
return key, nil | ||
} | ||
|
||
// SymmetricKey is a chacha20poly1305 key. | ||
// It is used by WireGuard to represent pre-shared symmetric keys. | ||
// SymmetricKey is a 32-byte value used as a pre-shared key. | ||
type SymmetricKey [chacha20poly1305.KeySize]byte | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
zx2c4
Member
|
||
|
||
func (k SymmetricKey) Base64() string { return base64.StdEncoding.EncodeToString(k[:]) } | ||
|
chacha20poly1305.KeySize is still the wrong constant to be using here. The right constant is just "32", as it's specified in section 9 of the noise spec: http://noiseprotocol.org/noise.html#pre-shared-symmetric-keys