From 4b410fc202102272627c823a52b35e73ef144a40 Mon Sep 17 00:00:00 2001 From: Kohei Taniguchi Date: Thu, 27 Feb 2020 10:48:43 +0900 Subject: [PATCH] Add constant of the prime of the curve field. --- src/constants.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/constants.rs b/src/constants.rs index 0a4db49..cb185e4 100644 --- a/src/constants.rs +++ b/src/constants.rs @@ -34,6 +34,14 @@ pub const MAX_SIGNATURE_SIZE: usize = 72; /// The maximum size of a compact signature pub const COMPACT_SIGNATURE_SIZE: usize = 64; +/// The Prime for the secp256k1 field element. +pub const FIELD_SIZE: [u8; 32] = [ + 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, 0xfe, 0xff, 0xff, 0xfc, 0x2f +]; + /// The order of the secp256k1 curve pub const CURVE_ORDER: [u8; 32] = [ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,