From 18c00f504298894bd5b6f0d3bc0bf0aa3d7365b9 Mon Sep 17 00:00:00 2001 From: Andy Polyakov Date: Wed, 30 Oct 2024 18:40:26 +0100 Subject: [PATCH] ff/mont_t.cuh: make compiler reject unsupported moduli bit length. --- ff/mont_t.cuh | 1 + 1 file changed, 1 insertion(+) diff --git a/ff/mont_t.cuh b/ff/mont_t.cuh index 02864f7..9c115a3 100644 --- a/ff/mont_t.cuh +++ b/ff/mont_t.cuh @@ -41,6 +41,7 @@ public: using mem_t = mont_t; protected: static const size_t n = (N+31)/32; + static_assert((n%2) == 0 && n >= 4, "unsupported bit length"); private: uint32_t even[n];