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

[Ed25519] Use BouncyCastle instead of Chaos.NaCl #1448

Merged
merged 4 commits into from
Jul 24, 2024

Conversation

scott-xu
Copy link
Collaborator

No description provided.

@WojciechNagorski
Copy link
Collaborator

@scott-xu
Copy link
Collaborator Author

Was going to remove the whole Chaos.NaCl folder once several other PRs get merged. Do you want me to remove it piece by piece?

@@ -91,8 +92,7 @@ public ED25519Key(SshKeyData publicKeyData)
throw new ArgumentException($"Invalid Ed25519 public key data ({publicKeyData.Name}, {publicKeyData.Keys.Length}).", nameof(publicKeyData));
}

PublicKey = publicKeyData.Keys[0].ToByteArray().Reverse().TrimLeadingZeros().Pad(Ed25519.PublicKeySizeInBytes);
PrivateKey = new byte[Ed25519.ExpandedPrivateKeySizeInBytes];
PublicKey = publicKeyData.Keys[0].ToByteArray().Reverse().TrimLeadingZeros().Pad(Ed25519.PublicKeySize);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd just keep the PrivateKey not-null unless we enable nullability here

Suggested change
PublicKey = publicKeyData.Keys[0].ToByteArray().Reverse().TrimLeadingZeros().Pad(Ed25519.PublicKeySize);
PublicKey = publicKeyData.Keys[0].ToByteArray().Reverse().TrimLeadingZeros().Pad(Ed25519.PublicKeySize);
PrivateKey = new byte[Ed25519.SecretKeySize];

@Rob-Hague
Copy link
Collaborator

Was going to remove the whole Chaos.NaCl folder once several other PRs get merged. Do you want me to remove it piece by piece?

I think either way is fine

@WojciechNagorski WojciechNagorski merged commit 28301ab into sshnet:develop Jul 24, 2024
1 check passed
@scott-xu scott-xu deleted the bc_ed25519 branch July 24, 2024 12:21
@scott-xu scott-xu changed the title Ed25519 is now based on BouncyCastle instead of Chaos.NaCl [Ed25519] Use BouncyCastle instead of Chaos.NaCl Aug 24, 2024
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.

3 participants