Skip to content

Commit c2f630a

Browse files
committed
Fixing sha3 import paths.
1 parent a05f4a8 commit c2f630a

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

sign/ed448/ed448.go

+6-7
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,8 @@ import (
2828
"crypto"
2929
cryptoRand "crypto/rand"
3030
"crypto/subtle"
31-
"errors"
3231
"fmt"
3332
"io"
34-
"strconv"
3533

3634
"github.com/cloudflare/circl/ecc/goldilocks"
3735
"github.com/cloudflare/circl/internal/sha3"
@@ -66,7 +64,8 @@ type SignerOptions struct {
6664
// Its length must be less or equal than 255 bytes.
6765
Context string
6866

69-
// Scheme is an identifier for choosing a signature scheme.
67+
// Scheme is an identifier for choosing a signature scheme. The zero value
68+
// is ED448.
7069
Scheme SchemeID
7170
}
7271

@@ -154,7 +153,7 @@ func (priv PrivateKey) Sign(
154153
case scheme == ED448Ph && opts.HashFunc() == crypto.Hash(0):
155154
return SignPh(priv, message, ctx), nil
156155
default:
157-
return nil, errors.New("ed448: bad hash algorithm")
156+
return nil, fmt.Errorf("ed448: bad hash algorithm")
158157
}
159158
}
160159

@@ -187,9 +186,9 @@ func NewKeyFromSeed(seed []byte) PrivateKey {
187186
return privateKey
188187
}
189188

190-
func newKeyFromSeed(privateKey, seed []byte) {
189+
func newKeyFromSeed(privateKey PrivateKey, seed []byte) {
191190
if l := len(seed); l != SeedSize {
192-
panic("ed448: bad seed length: " + strconv.Itoa(l))
191+
panic(fmt.Errorf("ed448: bad seed length: %v", l))
193192
}
194193

195194
var h [hashSize]byte
@@ -212,7 +211,7 @@ func newKeyFromSeed(privateKey, seed []byte) {
212211

213212
func signAll(signature []byte, privateKey PrivateKey, message, ctx []byte, preHash bool) {
214213
if len(ctx) > ContextMaxSize {
215-
panic(fmt.Errorf("ed448: bad context length: " + strconv.Itoa(len(ctx))))
214+
panic(fmt.Errorf("ed448: bad context length: %v", len(ctx)))
216215
}
217216

218217
H := sha3.NewShake256()

0 commit comments

Comments
 (0)