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

small rename #47

Merged
merged 1 commit into from
Nov 15, 2024
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
8 changes: 4 additions & 4 deletions cryptoffi/cryptoffi.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,16 +69,16 @@ func VrfGenerateKey() (*VrfPublicKey, *VrfPrivateKey) {
// TODO: check that Google CT's VRF satisfies all the properties we need.
// maybe re-write to use sha256 and the more robust [internal ed25519].
// [internal ed25519]: https://pkg.go.dev/filippo.io/edwards25519
func (priv *VrfPrivateKey) Hash(data []byte) ([]byte, []byte) {
h, proof := priv.sk.Evaluate(data)
func (sk *VrfPrivateKey) Hash(data []byte) ([]byte, []byte) {
h, proof := sk.sk.Evaluate(data)
// TODO: check that proof doesn't have h inside it.
// that'd be a waste of space.
return h[:], proof
}

// Verify rets okay if proof verifies.
func (pub *VrfPublicKey) Verify(data, hash, proof []byte) bool {
h, err := pub.pk.ProofToHash(data, proof)
func (pk *VrfPublicKey) Verify(data, hash, proof []byte) bool {
h, err := pk.pk.ProofToHash(data, proof)
if err != nil {
return false
}
Expand Down