From 82041c2c67f7181dfb4be49cecc9429fd83f8c1a Mon Sep 17 00:00:00 2001 From: Henry de Valence Date: Sun, 19 Feb 2017 19:50:36 -0500 Subject: [PATCH] Add constant for bytes of (p-1)/2. --- src/constants.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/constants.rs b/src/constants.rs index 7c0e664..a5a2740 100644 --- a/src/constants.rs +++ b/src/constants.rs @@ -36,6 +36,13 @@ pub const a_minus_d: FieldElement = FieldElement([ 10913609, -13857413, 15372611, -6949391, -114729, 8787816, 6275908, 3247719, 18696448, 12055116, ]); +/// (p-1)/2, in little-endian bytes. +pub const HALF_P_MINUS_1_BYTES: [u8; 32] = + [0xf6, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f]; + /// Precomputed value of one of the square roots of -1 (mod p) pub const SQRT_M1: FieldElement = FieldElement([ -32595792, -7943725, 9377950, 3500415, 12389472,