Closed Andrew-Bekhiet closed 3 years ago
The suffix and prefix should not be visible publicly and should be private properties. Unfortunately they cannot be due to the dart's constraints.
Anyway, the SigningKey class did not use suffix for publicKey
but used prefix for keyBytes
, which can cause issue as
the prefixLength
was not implicitly declared.
So, best practice is: do not use prefix
and suffix
as they should be used internally and
use keyBytes
if you're interested for the seed or the newly created seed
or verifyKey/publicKey
for the publicKey part of the private key.
Thanks, for pointing this out to me. I have fixed the signingkey by adding the proper suffix and prefix and created a new getter for seed part of the key.
Fixed in the latest master
I know it didn't use suffix
but when I looked at the code I realized that prefix
and suffix
use the same prefixLength
variable so the bug affects both of them
Anyway, I used the signingKey.keyBytes.take(32)
as a temporary workaround
BTW you can use @protected
annotation to point out that these variable are intended only for internal use
Anyway thanks for fixing this
BTW you can use
@protected
annotation to point out that these variable are intended only for internal use
I do not use meta
package, though in the future I could introduce it for static analyzing.
Hi, I've found a bug here and I think this is a simple one Happens after constructing new
ed25519.SigningKey
usinggenerate()
constructor and then retriving the private or the public key bytes usingprefix
orsuffix