Skip to content
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

Merged
merged 3 commits into from
Feb 1, 2020
Merged

feat: NaCl with ECDH encryption #529

merged 3 commits into from
Feb 1, 2020

Conversation

robdefeo
Copy link
Member

@robdefeo robdefeo commented Feb 1, 2020

closes #482

}

data, err = bytesDecode(data)
sharedSecret, err := d.keyExchange.SharedSecret(d.privateKey, pubKey)
Copy link
Contributor

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
Copy link
Contributor

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)
Copy link
Contributor

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)

}

return raw[1:], nil
if len(raw) < 35 {
Copy link
Contributor

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] {
Copy link
Contributor

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
Copy link
Contributor

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)

@robdefeo robdefeo merged commit b4d8e9c into master Feb 1, 2020
@robdefeo robdefeo deleted the issue/497 branch February 6, 2020 22:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

nacl encrypter does not encrypt messages correctly
2 participants