From 198f47898149e16c9cfe36919b751280e70bb1ae Mon Sep 17 00:00:00 2001 From: Frederick Jansen Date: Mon, 6 May 2024 18:06:48 -0400 Subject: [PATCH] Add modulo for sne --- src/oblivious/ristretto.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/oblivious/ristretto.py b/src/oblivious/ristretto.py index 010eee9d..81fa0052 100644 --- a/src/oblivious/ristretto.py +++ b/src/oblivious/ristretto.py @@ -431,7 +431,7 @@ def sne(s: bytes) -> bytes: 'e9d3f55c1a631258d69cf7a2def9de1400000000000000000000000000000010' """ return ( - (pow(2, 252) + 27742317777372353535851937790883648493 - int.from_bytes(s, 'little')) + (-int.from_bytes(s, 'little') % pow(2, 252) + 27742317777372353535851937790883648493) ).to_bytes(32, 'little') #