Skip to content

Commit

Permalink
add deprecated notices
Browse files Browse the repository at this point in the history
  • Loading branch information
gdams committed Dec 18, 2024
1 parent 4a51bc2 commit a4fea14
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions ed25519.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,13 +108,23 @@ func GenerateKeyEd25519() (*PrivateKeyEd25519, error) {
return priv, nil
}

// Deprecated: NewPrivateKeyEd25119 has been deprecated in favor of NewPrivateKeyEd25519.
func NewPrivateKeyEd25119(priv []byte) (*PrivateKeyEd25519, error) {
return NewPrivateKeyEd25519(priv)
}

func NewPrivateKeyEd25519(priv []byte) (*PrivateKeyEd25519, error) {
if len(priv) != privateKeySizeEd25519 {
panic("ed25519: bad private key length: " + strconv.Itoa(len(priv)))
}
return NewPrivateKeyEd25519FromSeed(priv[:seedSizeEd25519])
}

// Deprecated: NewPublicKeyEd25119 has been deprecated in favor of NewPublicKeyEd25519.
func NewPublicKeyEd25119(pub []byte) (*PublicKeyEd25519, error) {
return NewPublicKeyEd25519(pub)
}

func NewPublicKeyEd25519(pub []byte) (*PublicKeyEd25519, error) {
if len(pub) != publicKeySizeEd25519 {
panic("ed25519: bad public key length: " + strconv.Itoa(len(pub)))
Expand Down

0 comments on commit a4fea14

Please sign in to comment.