Skip to content
This repository has been archived by the owner on Nov 9, 2023. It is now read-only.

Commit

Permalink
Add SQRT_MINUS_ONE to constants.rs
Browse files Browse the repository at this point in the history
This value is needed to turn non QR values into
QR ones by multiplying them by it.

This is done on Sqrt_ratio_i implementation mentioned
in the Ristretto docs:

https://ristretto.group/formulas/invsqrt.html
  • Loading branch information
CPerezz committed Aug 31, 2019
1 parent a9c6a58 commit 788cf6b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ pub static EDWARDS_D: FieldElement = FieldElement([939392471225133, 587442007554
/// Ristretto `d = -121665/121666 (mod l) = 3939827596983564740704173820156434201364153519171569545177282234949263247860`.
pub const RISTRETTO_D: FieldElement = FieldElement([671914833248628, 3916664325105025, 1367801, 0, 17592186044416]);

/// Holds the value of one of both `sqrt(-1 (mod p)) values.
/// `SQRT_MINUS_ONE = 3034649101460298094273452163494570791663566989388331537498831373842135895065`.
pub const SQRT_MINUS_ONE: FieldElement = FieldElement([3075585030474777, 2451921961843096, 1194333869305507, 2218299809671669, 7376823328646]);

/// `1/SQRT(a) (mod l)` equals: ``.
pub static INV_SQRT_A: FieldElement = FieldElement([3075585030474777, 2451921961843096, 1194333869305507, 2218299809671669, 7376823328646]);

Expand Down

0 comments on commit 788cf6b

Please sign in to comment.