From e13b23d7207aff8ed7097634497044f5730c39f3 Mon Sep 17 00:00:00 2001 From: Andrew Poelstra Date: Wed, 27 Aug 2014 22:49:22 -0700 Subject: [PATCH] Add curve order and generator coordinates to constants --- src/constants.rs | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/src/constants.rs b/src/constants.rs index 7711446..d10517b 100644 --- a/src/constants.rs +++ b/src/constants.rs @@ -33,3 +33,28 @@ pub static MAX_SIGNATURE_SIZE: uint = 72; /// The maximum size of a compact signature pub static MAX_COMPACT_SIGNATURE_SIZE: uint = 64; +/// The order of the secp256k1 curve +pub static CURVE_ORDER: [u8, ..32] = [ + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, + 0xba, 0xae, 0xdc, 0xe6, 0xaf, 0x48, 0xa0, 0x3b, + 0xbf, 0xd2, 0x5e, 0x8c, 0xd0, 0x36, 0x41, 0x41 +]; + +/// The X coordinate of the generator +pub static GENERATOR_X: [u8, ..32] = [ + 0x79, 0xbe, 0x66, 0x7e, 0xf9, 0xdc, 0xbb, 0xac, + 0x55, 0xa0, 0x62, 0x95, 0xce, 0x87, 0x0b, 0x07, + 0x02, 0x9b, 0xfc, 0xdb, 0x2d, 0xce, 0x28, 0xd9, + 0x59, 0xf2, 0x81, 0x5b, 0x16, 0xf8, 0x17, 0x98 +]; + +/// The Y coordinate of the generator +pub static GENERATOR_Y: [u8, ..32] = [ + 0x48, 0x3a, 0xda, 0x77, 0x26, 0xa3, 0xc4, 0x65, + 0x5d, 0xa4, 0xfb, 0xfc, 0x0e, 0x11, 0x08, 0xa8, + 0xfd, 0x17, 0xb4, 0x48, 0xa6, 0x85, 0x54, 0x19, + 0x9c, 0x47, 0xd0, 0x8f, 0xfb, 0x10, 0xd4, 0xb8 +]; + +