Skip to content

Commit

Permalink
Add modulo for sne
Browse files Browse the repository at this point in the history
  • Loading branch information
frederickjansen committed May 6, 2024
1 parent 4f56e58 commit 198f478
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/oblivious/ristretto.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')

#
Expand Down

0 comments on commit 198f478

Please sign in to comment.