Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

secp256k1/ecdsa: Remove some unnecessary subslices. #3189

Merged
merged 1 commit into from
Sep 21, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions dcrec/secp256k1/ecdsa/signature_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -639,7 +639,7 @@ func TestSignAndVerifyRandom(t *testing.T) {
randByte = rng.Intn(len(badHash))
randBit = rng.Intn(7)
badHash[randByte] ^= 1 << randBit
if sig.Verify(badHash[:], pubKey) {
if sig.Verify(badHash, pubKey) {
t.Fatalf("verified signature for bad hash\nsig: %x\nhash: %x\n"+
"pubkey: %x", sig.Serialize(), badHash,
pubKey.SerializeCompressed())
Expand Down Expand Up @@ -676,7 +676,7 @@ func TestSignFailures(t *testing.T) {
nonce := hexToModNScalar(test.nonce)

// Ensure the signing is NOT successful.
sig, _, success := sign(privKey, nonce, hash[:])
sig, _, success := sign(privKey, nonce, hash)
if success {
t.Errorf("%s: unexpected success -- got sig %x", test.name,
sig.Serialize())
Expand Down Expand Up @@ -1061,7 +1061,7 @@ func TestSignAndRecoverCompactRandom(t *testing.T) {
randByte = rng.Intn(len(badHash))
randBit = rng.Intn(7)
badHash[randByte] ^= 1 << randBit
badPubKey, _, err = RecoverCompact(gotSig, badHash[:])
badPubKey, _, err = RecoverCompact(gotSig, badHash)
if err == nil && badPubKey.IsEqual(wantPubKey) {
t.Fatalf("recovered public key for bad hash: %x\nsig: %x\n"+
"private key: %x", badHash, gotSig, privKey.Serialize())
Expand Down