/actually/ mask highest bit ^^

This commit is contained in:
Robert Hambrock
2021-10-24 09:15:04 +02:00
parent 1ac9146455
commit 68c306a09a

View File

@@ -357,7 +357,10 @@ func GenerateKeysTruncated() (*PrivateKeyPair, error) {
fmt.Println("sBytes pre-zeroization: ", sBytes)
sBytes[31] &= 0x0f
fmt.Println("sBytes post-zeroization: ", sBytes)
ed25519.NewScalar().SetCanonicalBytes(sBytes)
s, err = ed25519.NewScalar().SetCanonicalBytes(sBytes)
if err != nil {
return nil, fmt.Errorf("failed to set bytes: %w", err)
}
sk := &PrivateSpendKey{
key: s,