You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
publicKeyPair(byte[] privateKey){if(privateKey.Length!=SK_SIZE)thrownewArgumentException("Incorrect private key length");ClearTextPrivateKey=privateKey;ed25519PrivateKey=newEd25519PrivateKeyParameters(ClearTextPrivateKey,0);ed25519PublicKey=ed25519PrivateKey.GeneratePublicKey();Pair=newAsymmetricCipherKeyPair(ed25519PrivateKey,ed25519PublicKey);// BUG - parameters are specified in the wrong order - public key comes first}
The above unit test fails with the following exception thrown:
System.ArgumentException: Expected a public key (Parameter 'publicParameter')
System.ArgumentException
Expected a public key (Parameter 'publicParameter')
at Org.BouncyCastle.Crypto.AsymmetricCipherKeyPair..ctor(AsymmetricKeyParameter publicParameter, AsymmetricKeyParameter privateParameter)
at Algorand.Crypto.KeyPair..ctor(Byte[] privateKey)
The text was updated successfully, but these errors were encountered:
oysterpack
changed the title
Algorand.Crypto.KeyPair(byte[] privateKey) constructor
Algorand.Crypto.KeyPair(byte[] privateKey) constructor bug
Feb 18, 2024
The fix is a 1-line code change:
Simple unit test to reproduce the issue:
The above unit test fails with the following exception thrown:
The text was updated successfully, but these errors were encountered: