From eef2603c11eeb5069eaed6c0296f3a1c5d23aad1 Mon Sep 17 00:00:00 2001 From: benbierens Date: Mon, 8 Jan 2024 11:29:30 +0100 Subject: [PATCH] Adds equality compare for field elements --- poseidon2/types.nim | 3 +++ 1 file changed, 3 insertions(+) diff --git a/poseidon2/types.nim b/poseidon2/types.nim index 5cc931c..2c9fa52 100644 --- a/poseidon2/types.nim +++ b/poseidon2/types.nim @@ -38,3 +38,6 @@ func arrayFromHex*[N]( for i in low(inp)..high(inp): tmp[i] = hexToF(inp[i], endian) return tmp + +func `==`*(a, b: F): bool = + bool(arithmetic.`==`(a, b))