From d3a8ee0d7b6035f8604fffb8731d633ba6f4628f Mon Sep 17 00:00:00 2001 From: Henry de Valence Date: Mon, 29 Jan 2018 12:01:25 -0800 Subject: [PATCH] Remove BASEPOINT_ORDER_MINUS_* constants These were originally added in 32da4c7d5044381dd468dcd2c40a6c7ebd4232c6 to implement Scalar negation in terms of multiply-add. But we have a full implementation of scalar arithmetic now, so it's not necessary to keep the constants around. --- src/constants.rs | 20 -------------------- src/scalar.rs | 6 ------ 2 files changed, 26 deletions(-) diff --git a/src/constants.rs b/src/constants.rs index 6ab40a5..955bb8d 100644 --- a/src/constants.rs +++ b/src/constants.rs @@ -71,26 +71,6 @@ pub const BASEPOINT_ORDER: Scalar = Scalar{ ], }; -/// `BASEPOINT_ORDER_MINUS_1` is the order of base point minus one, i.e. `l-1`, in little-endian bytes. -pub const BASEPOINT_ORDER_MINUS_1: Scalar = Scalar{ - bytes: [ - 0xec, 0xd3, 0xf5, 0x5c, 0x1a, 0x63, 0x12, 0x58, - 0xd6, 0x9c, 0xf7, 0xa2, 0xde, 0xf9, 0xde, 0x14, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, - ], -}; - -/// `BASEPOINT_ORDER_MINUS_2` is the order of base point minus two, i.e. `l-2`, in little-endian bytes. -pub const BASEPOINT_ORDER_MINUS_2: Scalar = Scalar{ - bytes: [ - 0xeb, 0xd3, 0xf5, 0x5c, 0x1a, 0x63, 0x12, 0x58, - 0xd6, 0x9c, 0xf7, 0xa2, 0xde, 0xf9, 0xde, 0x14, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, - ], -}; - // Precomputed basepoint table is generated into a file by build.rs #[cfg(feature="precomputed_tables")] diff --git a/src/scalar.rs b/src/scalar.rs index 64a59bc..72b2b01 100644 --- a/src/scalar.rs +++ b/src/scalar.rs @@ -790,12 +790,6 @@ mod test { assert_eq!(should_be_two, two); } - #[test] - fn impl_sub() { - let should_be_one = &constants::BASEPOINT_ORDER - &constants::BASEPOINT_ORDER_MINUS_1; - assert_eq!(should_be_one, Scalar::one()); - } - #[allow(non_snake_case)] #[test] fn impl_mul() {