| /* |
| Licensed to the Apache Software Foundation (ASF) under one |
| or more contributor license agreements. See the NOTICE file |
| distributed with this work for additional information |
| regarding copyright ownership. The ASF licenses this file |
| to you under the Apache License, Version 2.0 (the |
| "License"); you may not use this file except in compliance |
| with the License. You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, |
| software distributed under the License is distributed on an |
| "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| KIND, either express or implied. See the License for the |
| specific language governing permissions and limitations |
| under the License. |
| */ |
| |
| pub type Chunk=i32; |
| pub type DChunk=i64; |
| pub const CHUNK:usize=32; |
| |
| pub const NOT_SPECIAL:usize =0; |
| pub const PSEUDO_MERSENNE:usize=1; |
| pub const MONTGOMERY_FRIENDLY:usize=2; |
| pub const GENERALISED_MERSENNE:usize=3; |
| pub const WEIERSTRASS:usize=0; |
| pub const EDWARDS:usize=1; |
| pub const MONTGOMERY:usize=2; |
| pub const BN_CURVE: usize=0; |
| pub const BLS_CURVE: usize=1; |
| |
| |
| // Curve 25519 |
| #[cfg(feature = "Ed25519")] |
| pub const MODBITS: usize = 255; |
| #[cfg(feature = "Ed25519")] |
| pub const MOD8: usize = 5; |
| #[cfg(feature = "Ed25519")] |
| pub const BASEBITS: usize = 29; |
| #[cfg(feature = "Ed25519")] |
| pub const AES_S: usize=0; |
| |
| // GOLDILOCKS |
| #[cfg(feature = "GOLDILOCKS")] |
| pub const MODBITS: usize=448; |
| #[cfg(feature = "GOLDILOCKS")] |
| pub const MOD8: usize=7; |
| #[cfg(feature = "GOLDILOCKS")] |
| pub const BASEBITS: usize=29; |
| #[cfg(feature = "GOLDILOCKS")] |
| pub const AES_S: usize= 0; |
| |
| |
| // BN254 Curve |
| #[cfg(feature = "BN254")] |
| pub const MODBITS:usize = 254; /* Number of bits in Modulus */ |
| #[cfg(feature = "BN254")] |
| pub const MOD8:usize = 3; /* Modulus mod 8 */ |
| #[cfg(feature = "BN254")] |
| pub const BASEBITS:usize = 29; |
| #[cfg(feature = "BN254")] |
| pub const AES_S:usize=0; |
| |
| // BLS383 Curve |
| #[cfg(feature = "BLS383")] |
| pub const MODBITS:usize = 383; /* Number of bits in Modulus */ |
| #[cfg(feature = "BLS383")] |
| pub const MOD8: usize = 3; /* Modulus mod 8 */ |
| #[cfg(feature = "BLS383")] |
| pub const BASEBITS:usize = 28; |
| #[cfg(feature = "BLS383")] |
| pub const AES_S: usize= 0; |
| |
| // BLS455 Curve |
| #[cfg(feature = "BLS455")] |
| pub const MODBITS:usize = 455; /* Number of bits in Modulus */ |
| #[cfg(feature = "BLS455")] |
| pub const MOD8: usize = 3; /* Modulus mod 8 */ |
| #[cfg(feature = "BLS455")] |
| pub const BASEBITS:usize = 29; |
| #[cfg(feature = "BLS455")] |
| pub const AES_S: usize= 128; |
| |
| //--------------- |
| |
| /* RSA/DH modulus length as multiple of BIGBITS */ |
| pub const FFLEN:usize=4; |
| |
| pub const NLEN: usize = (1+((MODBITS-1)/BASEBITS)); |
| pub const BIG_HEX_STRING_LEN:usize = NLEN * 16 + NLEN - 1; |
| pub const DNLEN: usize = 2*NLEN; |
| pub const BMASK: Chunk= ((1<<BASEBITS)-1); |
| pub const MODBYTES: usize = 1+(MODBITS-1)/8; |
| pub const NEXCESS:isize = (1<<((CHUNK)-BASEBITS-1)); |
| pub const FEXCESS:Chunk = ((1 as Chunk)<<(BASEBITS*(NLEN)-MODBITS)); |
| pub const OMASK:Chunk = (-1)<<(MODBITS%BASEBITS); |
| pub const TBITS:usize=MODBITS%BASEBITS; // Number of active bits in top word |
| pub const TMASK:Chunk=(1<<TBITS)-1; |
| pub const BIGBITS:usize = (MODBYTES*8); |
| pub const HBITS: usize=(BASEBITS/2); |
| pub const HMASK: Chunk= ((1<<HBITS)-1); |
| |
| /* Finite field support - for RSA, DH etc. */ |
| pub const FF_BITS:usize=(BIGBITS*FFLEN); /* Finite Field Size in bits - must be 256.2^n */ |
| pub const HFLEN:usize=(FFLEN/2); /* Useful for half-size RSA private key operations */ |
| |
| pub const P_MBITS:usize=(MODBYTES as usize)*8; |
| pub const P_MB: usize=(P_MBITS%BASEBITS); |
| pub const P_OMASK:Chunk=((-1)<<(P_MBITS%BASEBITS)); |
| pub const P_FEXCESS: Chunk=(1<<(BASEBITS*NLEN-P_MBITS)); |
| pub const P_TBITS: usize=(P_MBITS%BASEBITS); |
| |
| |
| // Curve25519 Modulus |
| #[cfg(feature = "Ed25519")] |
| pub const MODTYPE:usize=PSEUDO_MERSENNE; |
| #[cfg(feature = "Ed25519")] |
| pub const MODULUS:[Chunk;NLEN]=[0x1FFFFFED,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x7FFFFF]; |
| #[cfg(feature = "Ed25519")] |
| pub const MCONST:Chunk=19; |
| |
| //GOLDILOCKS |
| #[cfg(feature = "GOLDILOCKS")] |
| pub const MODTYPE: usize=GENERALISED_MERSENNE; |
| #[cfg(feature = "GOLDILOCKS")] |
| pub const MODULUS:[Chunk;NLEN]=[0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FDFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFF]; |
| #[cfg(feature = "GOLDILOCKS")] |
| pub const MCONST: Chunk=0x1; |
| |
| |
| // BN254 Curve Modulus |
| #[cfg(feature = "BN254")] |
| pub const MODTYPE:usize = NOT_SPECIAL; |
| #[cfg(feature = "BN254")] |
| pub const MODULUS:[Chunk;NLEN] = [0x13,0x18000000,0x4E9,0x2000000,0x8612,0x6C00000,0x6E8D1,0x10480000,0x252364]; |
| #[cfg(feature = "BN254")] |
| pub const MCONST:Chunk=0x179435E5; |
| |
| // BLS383 Curve |
| #[cfg(feature = "BLS383")] |
| pub const MODTYPE:usize = NOT_SPECIAL; |
| #[cfg(feature = "BLS383")] |
| pub const MODULUS:[Chunk;NLEN] = [0xAAD556B,0xACAAB52,0x5F75D7A,0x1BB0147,0xD5D7520,0xCF73083,0xF99EB16,0x531820,0xA68EA32,0x2C01355,0x552A785,0x5C6105C,0x80A9F7,0x7AC52]; |
| #[cfg(feature = "BLS383")] |
| pub const MCONST:Chunk=0x123D0BD; |
| |
| // BLS455 Curve |
| #[cfg(feature = "BLS455")] |
| pub const MODTYPE:usize = NOT_SPECIAL; |
| #[cfg(feature = "BLS455")] |
| pub const MODULUS:[Chunk;NLEN] = [0x2AB,0x1500000C,0xAAA55AA,0xB12AAD6,0x6D1BA6C,0xCCA5674,0x12E2CF6E,0xA9F9662,0x34BD939,0x12D8EAB1,0xFD9978E,0x9240600,0xE0F95B,0xAAB9550,0x55555E5,0xAAAAB]; |
| #[cfg(feature = "BLS455")] |
| pub const MCONST:Chunk=0x1F4017FD; |
| |
| |
| // Ed25519 Curve |
| #[cfg(feature = "Ed25519")] |
| pub const CURVETYPE:usize=EDWARDS; |
| #[cfg(feature = "Ed25519")] |
| pub const CURVE_A:isize = -1; |
| #[cfg(feature = "Ed25519")] |
| pub const CURVE_B:[Chunk;NLEN]=[0x135978A3,0xF5A6E50,0x10762ADD,0x149A82,0x1E898007,0x3CBBBC,0x19CE331D,0x1DC56DFF,0x52036C]; |
| #[cfg(feature = "Ed25519")] |
| pub const CURVE_ORDER:[Chunk;NLEN]=[0x1CF5D3ED,0x9318D2,0x1DE73596,0x1DF3BD45,0x14D,0x0,0x0,0x0,0x100000]; |
| #[cfg(feature = "Ed25519")] |
| pub const CURVE_GX:[Chunk;NLEN]=[0xF25D51A,0xAB16B04,0x969ECB2,0x198EC12A,0xDC5C692,0x1118FEEB,0xFFB0293,0x1A79ADCA,0x216936]; |
| #[cfg(feature = "Ed25519")] |
| pub const CURVE_GY:[Chunk;NLEN]=[0x6666658,0x13333333,0x19999999,0xCCCCCCC,0x6666666,0x13333333,0x19999999,0xCCCCCCC,0x666666]; |
| |
| // GOLDILOCKS |
| #[cfg(feature = "GOLDILOCKS")] |
| pub const CURVETYPE: usize=EDWARDS; |
| #[cfg(feature = "GOLDILOCKS")] |
| pub const CURVE_A: isize=1; |
| #[cfg(feature = "GOLDILOCKS")] |
| pub const CURVE_ORDER:[Chunk;NLEN]=[0xB5844F3,0x1BC61495,0x1163D548,0x1984E51B,0x3690216,0xDA4D76B,0xFA7113B,0x1FEF9944,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x7FF]; |
| #[cfg(feature = "GOLDILOCKS")] |
| pub const CURVE_B:[Chunk;NLEN]=[0x1FFF6756,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FDFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFF]; |
| #[cfg(feature = "GOLDILOCKS")] |
| pub const CURVE_GX:[Chunk;NLEN]=[0x15555555,0xAAAAAAA,0x15555555,0xAAAAAAA,0x15555555,0xAAAAAAA,0x15555555,0x152AAAAA,0xAAAAAAA,0x15555555,0xAAAAAAA,0x15555555,0xAAAAAAA,0x15555555,0xAAAAAAA,0x1555]; |
| #[cfg(feature = "GOLDILOCKS")] |
| pub const CURVE_GY:[Chunk;NLEN]=[0xA9386ED,0x1757DE6F,0x13681AF6,0x19657DA3,0x3098BBB,0x12C19D15,0x12E03595,0xE515B18,0x17B7E36D,0x1AC426E,0xDBB5E8,0x10D8560,0x159D6205,0xB8246D9,0x17A58D2B,0x15C0]; |
| |
| // BN254 Curve |
| #[cfg(feature = "BN254")] |
| pub const CURVETYPE:usize = WEIERSTRASS; |
| #[cfg(feature = "BN254")] |
| pub const CURVE_PAIRING_TYPE:usize = BN_CURVE; |
| #[cfg(feature = "BN254")] |
| pub const CURVE_A:isize = 0; |
| #[cfg(feature = "BN254")] |
| pub const CURVE_B:[Chunk;NLEN]=[0x2,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0]; |
| #[cfg(feature = "BN254")] |
| pub const CURVE_ORDER:[Chunk;NLEN]=[0xD,0x8000000,0x428,0x1F000000,0x7FF9,0x6C00000,0x6E8D1,0x10480000,0x252364]; |
| #[cfg(feature = "BN254")] |
| pub const CURVE_GX:[Chunk;NLEN]=[0x12,0x18000000,0x4E9,0x2000000,0x8612,0x6C00000,0x6E8D1,0x10480000,0x252364]; |
| #[cfg(feature = "BN254")] |
| pub const CURVE_GY:[Chunk;NLEN]=[0x1,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0]; |
| |
| #[cfg(feature = "BN254")] |
| pub const CURVE_FRA:[Chunk;NLEN]=[0xF2A6DE9,0xBEF3603,0xFDDF0B8,0x12E9249A,0x953F850,0xDA85423,0x1232D926,0x32425CF,0x1B3776]; |
| #[cfg(feature = "BN254")] |
| pub const CURVE_FRB:[Chunk;NLEN]=[0x10D5922A,0xC10C9FC,0x10221431,0xF16DB65,0x16AC8DC1,0x1917ABDC,0xDD40FAA,0xD23DA30,0x9EBEE]; |
| #[cfg(feature = "BN254")] |
| pub const CURVE_PXA:[Chunk;NLEN]=[0x803FB2B,0xF721126,0x62FC364,0x9177691,0x1EDB6A46,0x63F4630,0x18BFAE36,0x176A33D6,0x61A10]; |
| #[cfg(feature = "BN254")] |
| pub const CURVE_PXB:[Chunk;NLEN]=[0x7D54CF3,0xC61A60F,0xDE12DC3,0x1AE8D75C,0xAA5B1F4,0x13C62CC1,0xCCC42A,0x1F374E6F,0x516AA]; |
| #[cfg(feature = "BN254")] |
| pub const CURVE_PYA:[Chunk;NLEN]=[0x11CD2B9A,0xF8703C4,0xF826F46,0x1A15CD7B,0x822329B,0x104B34C6,0xD0E6A43,0x140D75F2,0x21897]; |
| #[cfg(feature = "BN254")] |
| pub const CURVE_PYB:[Chunk;NLEN]=[0xB3ACE9B,0x1168D763,0xE7255E2,0xDFFAE,0x18D37B09,0x22B7AF9,0x149A3DB5,0x1CF9162,0xEBB2B]; |
| #[cfg(feature = "BN254")] |
| pub const CURVE_BNX:[Chunk;NLEN]=[0x1,0x4000000,0x10,0x0,0x0,0x0,0x0,0x0,0x0]; |
| #[cfg(feature = "BN254")] |
| pub const CURVE_COF:[Chunk;NLEN]=[0x1,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0]; |
| #[cfg(feature = "BN254")] |
| pub const CURVE_CRU:[Chunk;NLEN]=[0x7,0xC000000,0x1B3,0x12000000,0x2490,0x11200000,0x126CD,0x0,0x0]; |
| #[cfg(feature = "BN254")] |
| pub const CURVE_W:[[Chunk;NLEN];2]=[[0x3,0x0,0x81,0x3000000,0x618,0x0,0x0,0x0,0x0],[0x1,0x8000000,0x20,0x0,0x0,0x0,0x0,0x0,0x0]]; |
| #[cfg(feature = "BN254")] |
| pub const CURVE_SB:[[[Chunk;NLEN];2];2]=[[[0x4,0x8000000,0xA1,0x3000000,0x618,0x0,0x0,0x0,0x0],[0x1,0x8000000,0x20,0x0,0x0,0x0,0x0,0x0,0x0]],[[0x1,0x8000000,0x20,0x0,0x0,0x0,0x0,0x0,0x0],[0xA,0x8000000,0x3A7,0x1C000000,0x79E1,0x6C00000,0x6E8D1,0x10480000,0x252364]]]; |
| #[cfg(feature = "BN254")] |
| pub const CURVE_WB:[[Chunk;NLEN];4]=[[0x0,0x4000000,0x10,0x1000000,0x208,0x0,0x0,0x0,0x0],[0x5,0x14000000,0x152,0xE000000,0x1C70,0xC00000,0xC489,0x0,0x0],[0x3,0xC000000,0xB1,0x7000000,0xE38,0x10600000,0x6244,0x0,0x0],[0x1,0xC000000,0x30,0x1000000,0x208,0x0,0x0,0x0,0x0]]; |
| #[cfg(feature = "BN254")] |
| pub const CURVE_BB:[[[Chunk;NLEN];4];4]=[[[0xD,0x4000000,0x418,0x1F000000,0x7FF9,0x6C00000,0x6E8D1,0x10480000,0x252364],[0xC,0x4000000,0x418,0x1F000000,0x7FF9,0x6C00000,0x6E8D1,0x10480000,0x252364],[0xC,0x4000000,0x418,0x1F000000,0x7FF9,0x6C00000,0x6E8D1,0x10480000,0x252364],[0x2,0x8000000,0x20,0x0,0x0,0x0,0x0,0x0,0x0]],[[0x1,0x8000000,0x20,0x0,0x0,0x0,0x0,0x0,0x0],[0xC,0x4000000,0x418,0x1F000000,0x7FF9,0x6C00000,0x6E8D1,0x10480000,0x252364],[0xD,0x4000000,0x418,0x1F000000,0x7FF9,0x6C00000,0x6E8D1,0x10480000,0x252364],[0xC,0x4000000,0x418,0x1F000000,0x7FF9,0x6C00000,0x6E8D1,0x10480000,0x252364]],[[0x2,0x8000000,0x20,0x0,0x0,0x0,0x0,0x0,0x0],[0x1,0x8000000,0x20,0x0,0x0,0x0,0x0,0x0,0x0],[0x1,0x8000000,0x20,0x0,0x0,0x0,0x0,0x0,0x0],[0x1,0x8000000,0x20,0x0,0x0,0x0,0x0,0x0,0x0]],[[0x2,0x4000000,0x10,0x0,0x0,0x0,0x0,0x0,0x0],[0x2,0x10000000,0x40,0x0,0x0,0x0,0x0,0x0,0x0],[0xA,0x0,0x408,0x1F000000,0x7FF9,0x6C00000,0x6E8D1,0x10480000,0x252364],[0x2,0x4000000,0x10,0x0,0x0,0x0,0x0,0x0,0x0]]]; |
| |
| #[cfg(feature = "BN254")] |
| pub const USE_GLV:bool = true; |
| #[cfg(feature = "BN254")] |
| pub const USE_GS_G2:bool = true; |
| #[cfg(feature = "BN254")] |
| pub const USE_GS_GT:bool = true; |
| #[cfg(feature = "BN254")] |
| pub const GT_STRONG:bool = false; |
| |
| |
| |
| // BLS383 Curve |
| #[cfg(feature = "BLS383")] |
| pub const CURVETYPE:usize = WEIERSTRASS; |
| #[cfg(feature = "BLS383")] |
| pub const CURVE_PAIRING_TYPE:usize = BLS_CURVE; |
| #[cfg(feature = "BLS383")] |
| pub const CURVE_A:isize = 0; |
| |
| #[cfg(feature = "BLS383")] |
| pub const CURVE_ORDER:[Chunk;NLEN]=[0xFFF001,0xFFF8000,0xFE7800,0xBFDE007,0xC5EDF1C,0x3000049,0x910007A,0xC40007F,0x641004C,0x14,0x0,0x0,0x0,0x0]; |
| #[cfg(feature = "BLS383")] |
| pub const CURVE_B:[Chunk;NLEN]=[0x9,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0]; |
| #[cfg(feature = "BLS383")] |
| pub const CURVE_COF:[Chunk;NLEN]=[0x52B,0x2A00,0xAAB2CA0,0x5560AAA,0x6055,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0]; |
| #[cfg(feature = "BLS383")] |
| pub const CURVE_GX:[Chunk;NLEN]=[0xD10786B,0xD59B348,0x3F54AD0,0x3477C0E,0x4578B9B,0xBF25B73,0x7BB6F65,0x4F6AC00,0xFF57E9C,0xEFD5830,0xFB6EC02,0xADB9F88,0xEE4BC98,0xB08C]; |
| #[cfg(feature = "BLS383")] |
| pub const CURVE_GY:[Chunk;NLEN]=[0xD145DDB,0x5DA023,0x5FEF7CC,0x13F518C,0x2B2A66F,0x56EC346,0xC7A925F,0x96F3019,0x981223E,0x9061047,0x8F5BE59,0x4810AD,0x9337671,0x1F390]; |
| |
| #[cfg(feature = "BLS383")] |
| pub const CURVE_BNX:[Chunk;NLEN]=[0x40,0x100,0x110,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0]; |
| #[cfg(feature = "BLS383")] |
| pub const CURVE_CRU:[Chunk;NLEN]=[0xDA155A9,0xA3AAC4E,0x61E5E3D,0xDF2FE87,0xE632625,0xBCDFAAD,0xD3035A6,0x5123128,0xBEAD683,0xDBF3A2B,0x424190,0x5C5FAB2,0x80A9F7,0x7AC52]; |
| #[cfg(feature = "BLS383")] |
| pub const CURVE_FRA:[Chunk;NLEN]=[0x2B4508B,0x2BA59A9,0x6EEF343,0x63DB7A0,0x1DFBC74,0x40341CB,0x32D55D3,0x1639E9D,0x5CC36D4,0xB19B3F0,0xD86AB98,0xF323EE4,0xB198672,0x5A5F]; |
| #[cfg(feature = "BLS383")] |
| pub const CURVE_FRB:[Chunk;NLEN]=[0x7F904E0,0x81051A9,0xF086A37,0xB7D49A6,0xB7DB8AB,0x8F3EEB8,0xC6C9543,0xEEF7983,0x49CB35D,0x7A65F65,0x7CBFBEC,0x693D177,0x5672384,0x751F2]; |
| #[cfg(feature = "BLS383")] |
| pub const CURVE_PXA:[Chunk;NLEN]=[0xBAC9472,0x6059885,0xE2DC36D,0x7C4D31D,0x8C88A7,0xBDC90C3,0x1C688FC,0x29F0197,0xC43F167,0x3693539,0x61EB8BF,0xD81E5A5,0x22B56BF,0x4D507]; |
| #[cfg(feature = "BLS383")] |
| pub const CURVE_PXB:[Chunk;NLEN]=[0x272AB23,0x9B4BD7A,0xF44DCE8,0x7AF19D4,0x3206A34,0x3F6F7B9,0x2A819FB,0x571DD3E,0x635D7EE,0x3A2BA3B,0xC1A126,0xAC28C78,0x17C3E5B,0xEE36]; |
| #[cfg(feature = "BLS383")] |
| pub const CURVE_PYA:[Chunk;NLEN]=[0x77BD4FD,0x81D2309,0xDFDFC6,0xB66072,0xC89A0C,0x41FC959,0x878287A,0x2E1FBCF,0x14EEE65,0x11C230,0x6BB325E,0x2887881,0x859A05C,0x8F40]; |
| #[cfg(feature = "BLS383")] |
| pub const CURVE_PYB:[Chunk;NLEN]=[0x52C4CE6,0xA5E20A2,0xAFF40C8,0x5907A74,0x2448EF3,0x41760A4,0xFDA199,0xFFEF82B,0x8D4EA49,0xA0F29A1,0x6E4997B,0xAC7F7B8,0xBA88C12,0x1DCAB]; |
| |
| #[cfg(feature = "BLS383")] |
| pub const CURVE_W:[[Chunk;0];2]=[[],[]]; |
| #[cfg(feature = "BLS383")] |
| pub const CURVE_SB:[[[Chunk;0];2];2]=[[[],[]],[[],[]]]; |
| #[cfg(feature = "BLS383")] |
| pub const CURVE_WB:[[Chunk;0];4]=[[],[],[],[]]; |
| #[cfg(feature = "BLS383")] |
| pub const CURVE_BB:[[[Chunk;0];4];4]=[[[],[],[],[]],[[],[],[],[]],[[],[],[],[]],[[],[],[],[]]]; |
| |
| |
| #[cfg(feature = "BLS383")] |
| pub const USE_GLV:bool = true; |
| #[cfg(feature = "BLS383")] |
| pub const USE_GS_G2:bool = true; |
| #[cfg(feature = "BLS383")] |
| pub const USE_GS_GT:bool = true; |
| #[cfg(feature = "BLS383")] |
| pub const GT_STRONG:bool = false; |
| |
| // BLS455 Curve |
| #[cfg(feature = "BLS455")] |
| pub const CURVETYPE:usize = WEIERSTRASS; |
| #[cfg(feature = "BLS455")] |
| pub const CURVE_PAIRING_TYPE:usize = BLS_CURVE; |
| #[cfg(feature = "BLS455")] |
| pub const CURVE_A:isize = 0; |
| |
| #[cfg(feature = "BLS455")] |
| pub const CURVE_ORDER:[Chunk;NLEN]=[0x1FC00001,0x3FFF,0x10000070,0x1400000,0x1D100,0xF0003A8,0x13C0009,0x1E200,0x180002E0,0x400001,0x4000,0x0,0x0,0x0,0x0,0x0]; |
| #[cfg(feature = "BLS455")] |
| pub const CURVE_B:[Chunk;NLEN]=[0xA,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0]; |
| #[cfg(feature = "BLS455")] |
| pub const CURVE_COF:[Chunk;NLEN]=[0xABFFAAB,0x14AABFFD,0xD52AADA,0x1562AAAB,0x15556AAA,0x2A,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0]; |
| #[cfg(feature = "BLS455")] |
| pub const CURVE_GX:[Chunk;NLEN]=[0x1DFCEDD1,0x16A62EEF,0xE80D3ED,0xB8DE876,0x179C7253,0x182DAB52,0x46CC85F,0x1E571D9C,0x1E8392B1,0x1A155867,0x19E6527C,0x23DC64E,0xABEDA59,0xF20662B,0x17CECC01,0x310A]; |
| #[cfg(feature = "BLS455")] |
| pub const CURVE_GY:[Chunk;NLEN]=[0x6619B9B,0x27EBCD,0x1BE80A19,0x13B014BA,0x191A4936,0x13911916,0x107A5A3B,0x1DCB0863,0x1F5FB1,0xDE44A9C,0x18E23B2A,0x1FA81FD3,0xB0D6DFA,0xC2FE1EF,0xDDFA7E2,0x3351B]; |
| |
| #[cfg(feature = "BLS455")] |
| pub const CURVE_BNX:[Chunk;NLEN]=[0x800,0x1000004,0x40000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0]; |
| #[cfg(feature = "BLS455")] |
| pub const CURVE_CRU:[Chunk;NLEN]=[0xAA9,0x9017FE0,0x128DD8AA,0x1F4A321E,0x148FEC90,0x195CDEEA,0xE961AA2,0x168D3B66,0xAFD99D7,0xB989AA6,0x1F9A5724,0x91A05FF,0xE0EF5B,0xAAB9548,0x55555E5,0xAAAAB]; |
| #[cfg(feature = "BLS455")] |
| pub const CURVE_FRA:[Chunk;NLEN]=[0xA2EBF21,0x4E67DEE,0xCDE6590,0xE5EA94E,0x15454985,0x140CFC43,0x7E14D1C,0x1778395A,0x1944F022,0x166BEA1A,0xC3DEEA0,0x9F031A0,0x16A7459,0x1F1D6E00,0x125CFB72,0x72FD4]; |
| #[cfg(feature = "BLS455")] |
| pub const CURVE_FRB:[Chunk;NLEN]=[0x15D1438A,0x1019821D,0x1DCBF01A,0x1CB40187,0x118C70E6,0x18BD5A30,0xB018251,0x13275D08,0xA06E916,0x1C6D0096,0x39BA8ED,0x1F33D460,0x1F768501,0xB8E274F,0x12F85A72,0x37AD6]; |
| #[cfg(feature = "BLS455")] |
| pub const CURVE_PXA:[Chunk;NLEN]=[0x10C1F542,0x23AF907,0x159F840,0xBAC0E1F,0x133D7766,0x1C034C5D,0x14C5C875,0x1ED0BDA2,0x16A49C71,0x1E9FF62D,0x14F3ACC0,0x1E0C9FEA,0xC4638DE,0x74D18DA,0xBEA0030,0x5D962]; |
| #[cfg(feature = "BLS455")] |
| pub const CURVE_PXB:[Chunk;NLEN]=[0x749F03D,0xC843773,0xB17BCBA,0x1134AB4B,0x8EA016E,0x1A0D766C,0x58F819E,0x48A1FCC,0xE296F62,0x83370E4,0xC9BA1D5,0x1E43290E,0xEE59A80,0x1FDD85F5,0x1F3819B6,0x1D9F]; |
| #[cfg(feature = "BLS455")] |
| pub const CURVE_PYA:[Chunk;NLEN]=[0x181A77F4,0x191AD22,0x1E9F842A,0x1E1E6CF6,0xD55B9D9,0x1D062533,0x15BB1323,0x7ECBC1,0x1A9EC2EF,0x1EE14CE0,0x1E96B271,0xA794439,0x1C544324,0xE6AD5DC,0x16429B0F,0x448E3]; |
| #[cfg(feature = "BLS455")] |
| pub const CURVE_PYB:[Chunk;NLEN]=[0x1E1FDBA2,0x1A09DB6C,0xF680D5B,0xFCC6122,0xC488E2A,0x1E489ECD,0x1005617E,0x1CF9EC36,0x1C89ED72,0x16C00D90,0x1563E595,0x1243DDC0,0x8698F9E,0x1BD81E7E,0xF2A0F4A,0x66A0]; |
| |
| #[cfg(feature = "BLS455")] |
| pub const CURVE_W:[[Chunk;0];2]=[[],[]]; |
| #[cfg(feature = "BLS455")] |
| pub const CURVE_SB:[[[Chunk;0];2];2]=[[[],[]],[[],[]]]; |
| #[cfg(feature = "BLS455")] |
| pub const CURVE_WB:[[Chunk;0];4]=[[],[],[],[]]; |
| #[cfg(feature = "BLS455")] |
| pub const CURVE_BB:[[[Chunk;0];4];4]=[[[],[],[],[]],[[],[],[],[]],[[],[],[],[]],[[],[],[],[]]]; |
| |
| |
| #[cfg(feature = "BLS455")] |
| pub const USE_GLV:bool = true; |
| #[cfg(feature = "BLS455")] |
| pub const USE_GS_G2:bool = true; |
| #[cfg(feature = "BLS455")] |
| pub const USE_GS_GT:bool = true; |
| #[cfg(feature = "BLS455")] |
| pub const GT_STRONG:bool = false; |
| |