Skip to content

Commit

Permalink
fixed private key log output in case of error
Browse files Browse the repository at this point in the history
  • Loading branch information
torao committed Jan 6, 2020
1 parent 0295e0f commit 100ef8e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions crypto/vrf/internal/vrf/vrf.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,7 @@ func Prove(privateKey *[SECRETKEYBYTES]byte, message []byte) (*[PROOFBYTES]byte,
messagePtr := (*C.uchar)(unsafe.Pointer(&message))
messageLen := (C.ulonglong)(len(message))
if C.crypto_vrf_prove(proofPtr, privateKeyPtr, messagePtr, messageLen) != 0 {
return nil, errors.New(fmt.Sprintf("unable to decode the given privateKey: %s",
hex.EncodeToString(privateKey[:])))
return nil, errors.New(fmt.Sprintf("unable to decode the given privateKey"))
}
return &proof, nil
}
Expand Down
2 changes: 1 addition & 1 deletion crypto/vrf/vrf_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,6 @@ func TestProve(t *testing.T) {
if err3 != nil {
t.Errorf("failed to verify: %s", err3)
} else if ! bytes.Equal(hash1[:], hash2[:]) {
t.Errorf("output incompativle: %s != %s", enc(hash1[:]), enc(hash2[:]))
t.Errorf("incompatible output: %s != %s", enc(hash1[:]), enc(hash2[:]))
}
}

0 comments on commit 100ef8e

Please sign in to comment.