ChainSafe / go-schnorrkel

🍵 Schnorr Signatures over Ristretto255 in pure Go

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

MiniSecretKey.Decode should do something useful

Yawning opened this issue · comments

// NewMiniSecretKeyFromRaw derives a mini secret key from little-endian encoded raw bytes.
func NewMiniSecretKeyFromRaw(b [32]byte) (*MiniSecretKey, error) {
	s := b
	return &MiniSecretKey{key: s}, nil
}

[snip]

func (s *MiniSecretKey) Decode(in [32]byte) (e error) {
	_, err := NewMiniSecretKeyFromRaw(in)
	return err
}

Unless the intended behavior is to implement a moderately expensive way to obtain a nil error, this should probably be fixed to set the receiver to the decoded mini secret key.