-
-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: NaCl with ECDH encryption #529
Conversation
} | ||
|
||
data, err = bytesDecode(data) | ||
sharedSecret, err := d.keyExchange.SharedSecret(d.privateKey, pubKey) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
assignments should only be cuddled with other assignments (from wsl
)
default: | ||
err = errors.New("unsupported public key") | ||
} | ||
return |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return statements should not be cuddled if block has more than two lines (from wsl
)
if err != nil { | ||
return nil, err | ||
} | ||
pkLen := len(pkBytes) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
assignments should only be cuddled with other assignments (from wsl
)
crypto/cipher/nacl/encoding.go
Outdated
} | ||
|
||
return raw[1:], nil | ||
if len(raw) < 35 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if statements should only be cuddled with assignments (from wsl
)
if len(raw) < 35 { | ||
return nil, nil, errors.Errorf("cipher is too short") | ||
} | ||
switch raw[1] { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
only one cuddle assignment allowed before switch statement (from wsl
)
default: | ||
return nil, nil, errors.New("unrecognized pubKeyID") | ||
} | ||
return cph, pubKey, err |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return statements should not be cuddled if block has more than two lines (from wsl
)
closes #482