/* * Copyright (c) 2012-2020 MIRACL UK Ltd. * * This file is part of MIRACL Core * (see https://github.com/miracl/core). * * Licensed 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. */ #include "arch.h" #include "fp_BLS48286.h" namespace BLS48286 { /* Curve BLS48286 - Pairing friendly BLS curve */ #if CHUNK==16 #error Not supported #endif #if CHUNK==32 using namespace B288_29; // Base Bits= 29 const BIG Modulus= {0x9C345B,0x13A815C9,0x38D4B67,0xC8388A5,0x4809AAF,0x63F0D60,0x516A1B2,0x16040390,0x11EC7BD7,0x14B9629}; const BIG R2modp= {0x8484275,0x16B4A09C,0x13973525,0x19DBD350,0x188DE1C0,0x111BD51D,0x113A0F92,0x6489CAD,0xF188E5E,0xCED0C0}; const BIG ROI= {0x9C345A,0x13A815C9,0x38D4B67,0xC8388A5,0x4809AAF,0x63F0D60,0x516A1B2,0x16040390,0x11EC7BD7,0x14B9629}; const BIG CRu= {0x3773F7B,0xD329CB0,0xC2BB8E5,0x99D4594,0x667A6F2,0x1945AD4C,0x159AC407,0x20C33EA,0x332B8D8,0x14B921E}; const chunk MConst= 0x16EA242D; const BIG Fra= {0x1FC90183,0x15434AF9,0xF4FA4DB,0xAAD7DA3,0x8F09A7C,0x81F7813,0x1F8010F6,0x9D15D85,0xC522C11,0x6CA0BF}; const BIG Frb= {0xD332D8,0x1E64CACF,0x143DA68B,0x1D60B01,0x1B900033,0x1E1F954C,0x59690BB,0xC32A60A,0x59A4FC6,0xDEF56A}; const BIG SQRTm3= {0x6524A9C,0x6BD2397,0x14CA2663,0x6B70283,0x84EB335,0xC4C4D38,0x61EE65D,0xE146445,0x1478F5D8,0x14B8E12}; const BIG TWK= {0x3D05DCC,0x13ECB9AE,0x10A9C2E6,0x132E0A8A,0x1AA2C6A1,0x65E8A65,0x19C887EF,0xA33E6E6,0xF448A33,0xE9076F}; #endif #if CHUNK==64 using namespace B288_60; // Base Bits= 60 const BIG Modulus= {0xE7502B9209C345BL,0xF641C4528E352D9L,0xC8C7E1AC04809AAL,0xD7B0201C8145A86L,0x2972C531EC7BL}; const BIG R2modp= {0x61F9539D245AF2CL,0xA1991A6E51410D8L,0x1603A99FC661885L,0xC8A2CE485CD7822L,0xD54A6F0B25EL}; const BIG ROI= {0xE7502B9209C345AL,0xF641C4528E352D9L,0xC8C7E1AC04809AAL,0xD7B0201C8145A86L,0x2972C531EC7BL}; const BIG CRu= {0x5A6539603773F7BL,0x24CEA2CA30AEE39L,0x1F28B5A98667A6FL,0xD810619F5566B10L,0x297243C332B8L}; const chunk MConst= 0x227E5D8F6EA242DL; const BIG Fra= {0xEA8695F3FC90183L,0xC556BED1BD3E936L,0xD903EF0268F09A7L,0x114E8AEC2FE0043L,0xD9417EC522CL}; const BIG Frb= {0xFCC9959E0D332D8L,0x30EB0580D0F69A2L,0xEFC3F2A99B90003L,0xC66195305165A42L,0x1BDEAD459A4FL}; const BIG SQRTm3= {0xCD7A472E6524A9CL,0x535B8141D328998L,0x758989A7084EB33L,0xD870A3222987B99L,0x2971C25478F5L}; const BIG TWK= {0xA7D9735C3D05DCCL,0x1997054542A70B9L,0xBCCBD14CBAA2C6AL,0x33519F37367221FL,0x1D20EDEF448AL}; #endif }