Skip to content

Commit e5d15fd

Browse files
authored
btcec/ecdsa: remove error return value for SignCompact (#2211)
1 parent d881c68 commit e5d15fd

File tree

3 files changed

+4
-8
lines changed

3 files changed

+4
-8
lines changed

btcec/ecdsa/bench_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ func BenchmarkSignCompact(b *testing.B) {
170170
b.ReportAllocs()
171171
b.ResetTimer()
172172
for i := 0; i < b.N; i++ {
173-
_, _ = SignCompact(privKey, msgHash, true)
173+
_ = SignCompact(privKey, msgHash, true)
174174
}
175175
}
176176

btcec/ecdsa/signature.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,9 +233,9 @@ func ParseDERSignature(sigStr []byte) (*Signature, error) {
233233
// <(byte of 27+public key solution)+4 if compressed >< padded bytes for signature R><padded bytes for signature S>
234234
// where the R and S parameters are padde up to the bitlengh of the curve.
235235
func SignCompact(key *btcec.PrivateKey, hash []byte,
236-
isCompressedKey bool) ([]byte, error) {
236+
isCompressedKey bool) []byte {
237237

238-
return secp_ecdsa.SignCompact(key, hash, isCompressedKey), nil
238+
return secp_ecdsa.SignCompact(key, hash, isCompressedKey)
239239
}
240240

241241
// RecoverCompact verifies the compact signature "signature" of "hash" for the

btcec/ecdsa/signature_test.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -479,11 +479,7 @@ func testSignCompact(t *testing.T, tag string, curve *btcec.KoblitzCurve,
479479
priv, _ := btcec.NewPrivateKey()
480480

481481
hashed := []byte("testing")
482-
sig, err := SignCompact(priv, hashed, isCompressed)
483-
if err != nil {
484-
t.Errorf("%s: error signing: %s", tag, err)
485-
return
486-
}
482+
sig := SignCompact(priv, hashed, isCompressed)
487483

488484
pk, wasCompressed, err := RecoverCompact(sig, hashed)
489485
if err != nil {

0 commit comments

Comments
 (0)