From 33aab2e6e4ad7592a90dd35b66299641fdc73c33 Mon Sep 17 00:00:00 2001 From: Richard Ramos Date: Mon, 10 Apr 2023 11:06:09 -0400 Subject: [PATCH] feat: compare identity credentials --- rln/types.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/rln/types.go b/rln/types.go index 99708cb..ca6e237 100644 --- a/rln/types.go +++ b/rln/types.go @@ -37,6 +37,10 @@ type IdentityCredential = struct { IDCommitment IDCommitment `json:"idCommitment"` } +func IdentityCredentialEquals(i IdentityCredential, i2 IdentityCredential) bool { + return bytes.Equal(i.IDTrapdoor[:], i2.IDTrapdoor[:]) && bytes.Equal(i.IDNullifier[:], i2.IDNullifier[:]) && bytes.Equal(i.IDSecretHash[:], i2.IDSecretHash[:]) && bytes.Equal(i.IDCommitment[:], i2.IDCommitment[:]) +} + type RateLimitProof struct { // RateLimitProof holds the public inputs to rln circuit as // defined in https://hackmd.io/tMTLMYmTR5eynw2lwK9n1w?view#Public-Inputs