diff --git a/libs/aarch64-apple-darwin/librln.a b/libs/aarch64-apple-darwin/librln.a index 68cab63..c64d78c 100644 Binary files a/libs/aarch64-apple-darwin/librln.a and b/libs/aarch64-apple-darwin/librln.a differ diff --git a/rln/librln.h b/rln/librln.h index b88d169..eed8e44 100644 --- a/rln/librln.h +++ b/rln/librln.h @@ -71,6 +71,10 @@ bool generate_rln_proof(struct RLN *ctx, const struct Buffer *input_buffer, struct Buffer *output_buffer); +bool generate_rln_proof_with_witness(struct RLN *ctx, + const struct Buffer *input_buffer, + struct Buffer *output_buffer); + bool verify_rln_proof(const struct RLN *ctx, const struct Buffer *proof_buffer, bool *proof_is_valid_ptr); diff --git a/rln/wrapper.go b/rln/wrapper.go index 99111c7..a9d99ae 100644 --- a/rln/wrapper.go +++ b/rln/wrapper.go @@ -159,6 +159,20 @@ func (r *RLN) GenerateRLNProof(input []byte) ([]byte, error) { return C.GoBytes(unsafe.Pointer(out.ptr), C.int(out.len)), nil } +func (r *RLN) GenerateRLNProofWithWitness(input []byte, witness []byte) ([]byte, error) { + inputBuffer := toCBufferPtr(input) + witnessBuffer := toCBufferPtr(witness) + + var output []byte + out := toBuffer(output) + + if !bool(C.generate_rln_proof_with_witness(r.ptr, inputBuffer, witnessBuffer, &out)) { + return nil, errors.New("could not generate the proof with witness") + } + + return C.GoBytes(unsafe.Pointer(out.ptr), C.int(out.len)), nil +} + func (r *RLN) VerifyWithRoots(input []byte, roots []byte) (bool, error) { proofBuf := toCBufferPtr(input) rootBuf := toCBufferPtr(roots) diff --git a/zerokit b/zerokit index b903d8d..b50f814 160000 --- a/zerokit +++ b/zerokit @@ -1 +1 @@ -Subproject commit b903d8d740e0b8b82057bcc5377ddce05ae5676b +Subproject commit b50f814e8ddeb3c99abd42dae95753c2e0caaae1