Conversation
786f9aa to
3e72010
Compare
| } | ||
|
|
||
| // VerifyKnowledgeProof checks if the proof of knowledge is valid | ||
| func (k *Key) VerifyKnowledgeProof(commitment bn254.G1Affine, knowledgeProof bn254.G1Affine) error { |
There was a problem hiding this comment.
You could ask @gbotrel for that but I think it's better not to use a pointer receiver when it can be avoided (in general not use pointers when it's not necessary)
There was a problem hiding this comment.
oh no, pointer receiver is fine --> having pointer receiver does not impact where your object is allocated.
sometime passing pointers versus values can force the compiler escape analysis to allocate an object on the heap, but here, in this context, I don't think that's an issue 👍
ecc/bn254/fr/pedersen/pedersen.go
Outdated
| return slice | ||
| } | ||
|
|
||
| func (k *Key) Commit(values []*fr.Element) (commitment bn254.G1Affine, knowledgeProof bn254.G1Affine, err error) { |
There was a problem hiding this comment.
why are the entries in values pointers ?
There was a problem hiding this comment.
Same as the other two 😁
ecc/bn254/fr/pedersen/pedersen.go
Outdated
| return bn254.HashToG2(gBytes, []byte("random on g2")) | ||
| } | ||
|
|
||
| func Setup(basis []*bn254.G1Affine) (Key, error) { |
There was a problem hiding this comment.
Why do you use pointers here ?
There was a problem hiding this comment.
It is non-pointer now 👍
ecc/bn254/fr/pedersen/pedersen.go
Outdated
| type Key struct { | ||
| g bn254.G2Affine // TODO @tabaie: does this really have to be randomized? | ||
| gRootSigmaNeg bn254.G2Affine //gRootSigmaNeg = g^{-1/σ} | ||
| basis []*bn254.G1Affine |
There was a problem hiding this comment.
why is basis a slice of pointers ?
Efficiently verifiable Pedersen commitments as described in https://eprint.iacr.org/2022/1072.pdf subsection 6.1