Skip to content

Commit 8b51f15

Browse files
committed
rename
1 parent 7bbfb1e commit 8b51f15

2 files changed

Lines changed: 12 additions & 4 deletions

File tree

keys.go

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,14 @@ func ValidatePrivateKey(b []byte) (bool, error) {
7272
if len(b) != voied25519.PrivateKeySize {
7373
return false, fmt.Errorf("invalid private key size, expected %v, got %d", voied25519.PrivateKeySize, len(b))
7474
}
75+
<<<<<<< HEAD
7576
// check if the public key is on the ed25519 curve
77+
=======
78+
// check if the public key is on the voied25519 curve
79+
>>>>>>> f4f19e0 (rename)
7680
pub := voied25519.PrivateKey(b).Public().(voied25519.PublicKey)
7781
if !IsOnCurve(pub) {
78-
return false, errors.New("the corresponding public key is NOT on the ed25519 curve")
82+
return false, errors.New("the corresponding public key is NOT on the voied25519 curve")
7983
}
8084
return true, nil
8185
}
@@ -152,7 +156,11 @@ func (k PrivateKey) PublicKey() PublicKey {
152156
// PK is a convenience alias for PublicKey
153157
type PK = PublicKey
154158

159+
<<<<<<< HEAD
155160
// done to keep verify the same as stdlib crypto/ed25519
161+
=======
162+
// done to keep verify the same as stdlib crypto/voied25519
163+
>>>>>>> f4f19e0 (rename)
156164
var verifyOptsStdLib = &voied25519.Options{
157165
Verify: voied25519.VerifyOptionsStdLib,
158166
}
@@ -300,7 +308,7 @@ func (p PublicKey) Bytes() []byte {
300308
return []byte(p[:])
301309
}
302310

303-
// Check if a `Pubkey` is on the ed25519 curve.
311+
// Check if a `Pubkey` is on the voied25519 curve.
304312
func (p PublicKey) IsOnCurve() bool {
305313
return IsOnCurve(p[:])
306314
}

nativetypes.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import (
2222
"fmt"
2323
"io"
2424

25-
"github.com/oasisprotocol/curve25519-voi/primitives/ed25519"
25+
voied25519 "github.com/oasisprotocol/curve25519-voi/primitives/ed25519"
2626

2727
bin "github.com/gagliardetto/binary"
2828
"github.com/gagliardetto/solana-go/base58"
@@ -187,7 +187,7 @@ func (p *Signature) UnmarshalJSON(data []byte) (err error) {
187187

188188
// Verify checks that the signature is valid for the given public key and message.
189189
func (s Signature) Verify(pubkey PublicKey, msg []byte) bool {
190-
return ed25519.VerifyWithOptions(pubkey[:], msg, s[:], verifyOptsStdLib)
190+
return voied25519.VerifyWithOptions(pubkey[:], msg, s[:], verifyOptsStdLib)
191191
}
192192

193193
func (p Signature) String() string {

0 commit comments

Comments
 (0)