From 1d9d0d1f54800b4801df4c8f5af7e82dc88fcdbc Mon Sep 17 00:00:00 2001 From: Mark Spanbroek Date: Tue, 24 Oct 2023 14:21:37 +0200 Subject: [PATCH] Perform string to array conversion at compiletime --- poseidon2.nim | 4 ++-- poseidon2/roundconst.nim | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/poseidon2.nim b/poseidon2.nim index b07a854..3bef275 100644 --- a/poseidon2.nim +++ b/poseidon2.nim @@ -13,8 +13,8 @@ import poseidon2/roundconst let zero : F = getZero() -let externalRoundConst : array[24, F] = arrayFromHex( externalRoundConstStr ) -let internalRoundConst : array[56, F] = arrayFromHex( internalRoundConstStr ) +const externalRoundConst : array[24, F] = arrayFromHex( externalRoundConstStr ) +const internalRoundConst : array[56, F] = arrayFromHex( internalRoundConstStr ) #------------------------------------------------------------------------------- diff --git a/poseidon2/roundconst.nim b/poseidon2/roundconst.nim index 0571a71..15e43ec 100644 --- a/poseidon2/roundconst.nim +++ b/poseidon2/roundconst.nim @@ -2,7 +2,7 @@ #------------------------------------------------------------------------------- -let externalRoundConstStr* : array[24, string] = +const externalRoundConstStr* : array[24, string] = [ "0x2c4c51fd1bb9567c27e99f5712b49e0574178b41b6f0a476cddc41d242cf2b43" , "0x1c5f8d18acb9c61ec6fcbfcda5356f1b3fdee7dc22c99a5b73a2750e5b054104" , "0x2d3c1988b4541e4c045595b8d574e98a7c2820314a82e67a4e380f1c4541ba90" , @@ -38,7 +38,7 @@ let externalRoundConstStr* : array[24, string] = #------------------------------------------------------------------------------- -let internalRoundConstStr* : array[56, string] = +const internalRoundConstStr* : array[56, string] = [ "0x15ce7e5ae220e8623a40b3a3b22d441eff0c9be1ae1d32f1b777af84eea7e38c" , "0x1bf60ac8bfff0f631983c93e218ca0d4a4059c254b4299b1d9984a07edccfaf0" , "0x0fab0c9387cb2bec9dc11b2951088b9e1e1d2978542fc131f74a8f8fdac95b40" ,