Pete Bentley | 0c61efe | 2019-08-13 09:32:23 +0100 | [diff] [blame^] | 1 | /******************************************************************************************** |
| 2 | * SIDH: an efficient supersingular isogeny cryptography library |
| 3 | * |
| 4 | * Abstract: supersingular isogeny parameters and generation of functions for P434 |
| 5 | *********************************************************************************************/ |
| 6 | |
| 7 | #include "utils.h" |
| 8 | |
| 9 | // Parameters for isogeny system "SIKE" |
| 10 | const struct params_t sike_params = { |
| 11 | .prime = { |
| 12 | U64_TO_WORDS(0xFFFFFFFFFFFFFFFF), U64_TO_WORDS(0xFFFFFFFFFFFFFFFF), |
| 13 | U64_TO_WORDS(0xFFFFFFFFFFFFFFFF), U64_TO_WORDS(0xFDC1767AE2FFFFFF), |
| 14 | U64_TO_WORDS(0x7BC65C783158AEA3), U64_TO_WORDS(0x6CFC5FD681C52056), |
| 15 | U64_TO_WORDS(0x0002341F27177344) |
| 16 | }, |
| 17 | .prime_p1 = { |
| 18 | U64_TO_WORDS(0x0000000000000000), U64_TO_WORDS(0x0000000000000000), |
| 19 | U64_TO_WORDS(0x0000000000000000), U64_TO_WORDS(0xFDC1767AE3000000), |
| 20 | U64_TO_WORDS(0x7BC65C783158AEA3), U64_TO_WORDS(0x6CFC5FD681C52056), |
| 21 | U64_TO_WORDS(0x0002341F27177344) |
| 22 | }, |
| 23 | .prime_x2 = { |
| 24 | U64_TO_WORDS(0xFFFFFFFFFFFFFFFE), U64_TO_WORDS(0xFFFFFFFFFFFFFFFF), |
| 25 | U64_TO_WORDS(0xFFFFFFFFFFFFFFFF), U64_TO_WORDS(0xFB82ECF5C5FFFFFF), |
| 26 | U64_TO_WORDS(0xF78CB8F062B15D47), U64_TO_WORDS(0xD9F8BFAD038A40AC), |
| 27 | U64_TO_WORDS(0x0004683E4E2EE688) |
| 28 | }, |
| 29 | .A_gen = { |
| 30 | U64_TO_WORDS(0x05ADF455C5C345BF), U64_TO_WORDS(0x91935C5CC767AC2B), |
| 31 | U64_TO_WORDS(0xAFE4E879951F0257), U64_TO_WORDS(0x70E792DC89FA27B1), |
| 32 | U64_TO_WORDS(0xF797F526BB48C8CD), U64_TO_WORDS(0x2181DB6131AF621F), |
| 33 | U64_TO_WORDS(0x00000A1C08B1ECC4), // XPA0 |
| 34 | U64_TO_WORDS(0x74840EB87CDA7788), U64_TO_WORDS(0x2971AA0ECF9F9D0B), |
| 35 | U64_TO_WORDS(0xCB5732BDF41715D5), U64_TO_WORDS(0x8CD8E51F7AACFFAA), |
| 36 | U64_TO_WORDS(0xA7F424730D7E419F), U64_TO_WORDS(0xD671EB919A179E8C), |
| 37 | U64_TO_WORDS(0x0000FFA26C5A924A), // XPA1 |
| 38 | U64_TO_WORDS(0xFEC6E64588B7273B), U64_TO_WORDS(0xD2A626D74CBBF1C6), |
| 39 | U64_TO_WORDS(0xF8F58F07A78098C7), U64_TO_WORDS(0xE23941F470841B03), |
| 40 | U64_TO_WORDS(0x1B63EDA2045538DD), U64_TO_WORDS(0x735CFEB0FFD49215), |
| 41 | U64_TO_WORDS(0x0001C4CB77542876), // XQA0 |
| 42 | U64_TO_WORDS(0xADB0F733C17FFDD6), U64_TO_WORDS(0x6AFFBD037DA0A050), |
| 43 | U64_TO_WORDS(0x680EC43DB144E02F), U64_TO_WORDS(0x1E2E5D5FF524E374), |
| 44 | U64_TO_WORDS(0xE2DDA115260E2995), U64_TO_WORDS(0xA6E4B552E2EDE508), |
| 45 | U64_TO_WORDS(0x00018ECCDDF4B53E), // XQA1 |
| 46 | U64_TO_WORDS(0x01BA4DB518CD6C7D), U64_TO_WORDS(0x2CB0251FE3CC0611), |
| 47 | U64_TO_WORDS(0x259B0C6949A9121B), U64_TO_WORDS(0x60E17AC16D2F82AD), |
| 48 | U64_TO_WORDS(0x3AA41F1CE175D92D), U64_TO_WORDS(0x413FBE6A9B9BC4F3), |
| 49 | U64_TO_WORDS(0x00022A81D8D55643), // XRA0 |
| 50 | U64_TO_WORDS(0xB8ADBC70FC82E54A), U64_TO_WORDS(0xEF9CDDB0D5FADDED), |
| 51 | U64_TO_WORDS(0x5820C734C80096A0), U64_TO_WORDS(0x7799994BAA96E0E4), |
| 52 | U64_TO_WORDS(0x044961599E379AF8), U64_TO_WORDS(0xDB2B94FBF09F27E2), |
| 53 | U64_TO_WORDS(0x0000B87FC716C0C6) // XRA1 |
| 54 | }, |
| 55 | .B_gen = { |
| 56 | U64_TO_WORDS(0x6E5497556EDD48A3), U64_TO_WORDS(0x2A61B501546F1C05), |
| 57 | U64_TO_WORDS(0xEB919446D049887D), U64_TO_WORDS(0x5864A4A69D450C4F), |
| 58 | U64_TO_WORDS(0xB883F276A6490D2B), U64_TO_WORDS(0x22CC287022D5F5B9), |
| 59 | U64_TO_WORDS(0x0001BED4772E551F), // XPB0 |
| 60 | U64_TO_WORDS(0x0000000000000000), U64_TO_WORDS(0x0000000000000000), |
| 61 | U64_TO_WORDS(0x0000000000000000), U64_TO_WORDS(0x0000000000000000), |
| 62 | U64_TO_WORDS(0x0000000000000000), U64_TO_WORDS(0x0000000000000000), |
| 63 | U64_TO_WORDS(0x0000000000000000), // XPB1 |
| 64 | U64_TO_WORDS(0xFAE2A3F93D8B6B8E), U64_TO_WORDS(0x494871F51700FE1C), |
| 65 | U64_TO_WORDS(0xEF1A94228413C27C), U64_TO_WORDS(0x498FF4A4AF60BD62), |
| 66 | U64_TO_WORDS(0xB00AD2A708267E8A), U64_TO_WORDS(0xF4328294E017837F), |
| 67 | U64_TO_WORDS(0x000034080181D8AE), // XQB0 |
| 68 | U64_TO_WORDS(0x0000000000000000), U64_TO_WORDS(0x0000000000000000), |
| 69 | U64_TO_WORDS(0x0000000000000000), U64_TO_WORDS(0x0000000000000000), |
| 70 | U64_TO_WORDS(0x0000000000000000), U64_TO_WORDS(0x0000000000000000), |
| 71 | U64_TO_WORDS(0x0000000000000000), // XQB1 |
| 72 | U64_TO_WORDS(0x283B34FAFEFDC8E4), U64_TO_WORDS(0x9208F44977C3E647), |
| 73 | U64_TO_WORDS(0x7DEAE962816F4E9A), U64_TO_WORDS(0x68A2BA8AA262EC9D), |
| 74 | U64_TO_WORDS(0x8176F112EA43F45B), U64_TO_WORDS(0x02106D022634F504), |
| 75 | U64_TO_WORDS(0x00007E8A50F02E37), // XRB0 |
| 76 | U64_TO_WORDS(0xB378B7C1DA22CCB1), U64_TO_WORDS(0x6D089C99AD1D9230), |
| 77 | U64_TO_WORDS(0xEBE15711813E2369), U64_TO_WORDS(0x2B35A68239D48A53), |
| 78 | U64_TO_WORDS(0x445F6FD138407C93), U64_TO_WORDS(0xBEF93B29A3F6B54B), |
| 79 | U64_TO_WORDS(0x000173FA910377D3) // XRB1 |
| 80 | }, |
| 81 | .mont_R2 = { |
| 82 | U64_TO_WORDS(0x28E55B65DCD69B30), U64_TO_WORDS(0xACEC7367768798C2), |
| 83 | U64_TO_WORDS(0xAB27973F8311688D), U64_TO_WORDS(0x175CC6AF8D6C7C0B), |
| 84 | U64_TO_WORDS(0xABCD92BF2DDE347E), U64_TO_WORDS(0x69E16A61C7686D9A), |
| 85 | U64_TO_WORDS(0x000025A89BCDD12A) |
| 86 | }, |
| 87 | .mont_one = { |
| 88 | U64_TO_WORDS(0x000000000000742C), U64_TO_WORDS(0x0000000000000000), |
| 89 | U64_TO_WORDS(0x0000000000000000), U64_TO_WORDS(0xB90FF404FC000000), |
| 90 | U64_TO_WORDS(0xD801A4FB559FACD4), U64_TO_WORDS(0xE93254545F77410C), |
| 91 | U64_TO_WORDS(0x0000ECEEA7BD2EDA) |
| 92 | }, |
| 93 | .mont_six = { |
| 94 | U64_TO_WORDS(0x000000000002B90A), U64_TO_WORDS(0x0000000000000000), |
| 95 | U64_TO_WORDS(0x0000000000000000), U64_TO_WORDS(0x5ADCCB2822000000), |
| 96 | U64_TO_WORDS(0x187D24F39F0CAFB4), U64_TO_WORDS(0x9D353A4D394145A0), |
| 97 | U64_TO_WORDS(0x00012559A0403298) |
| 98 | }, |
| 99 | .A_strat = { |
| 100 | 0x30, 0x1C, 0x10, 0x08, 0x04, 0x02, 0x01, 0x01, 0x02, 0x01, |
| 101 | 0x01, 0x04, 0x02, 0x01, 0x01, 0x02, 0x01, 0x01, 0x08, 0x04, |
| 102 | 0x02, 0x01, 0x01, 0x02, 0x01, 0x01, 0x04, 0x02, 0x01, 0x01, |
| 103 | 0x02, 0x01, 0x01, 0x0D, 0x07, 0x04, 0x02, 0x01, 0x01, 0x02, |
| 104 | 0x01, 0x01, 0x03, 0x02, 0x01, 0x01, 0x01, 0x01, 0x05, 0x04, |
| 105 | 0x02, 0x01, 0x01, 0x02, 0x01, 0x01, 0x02, 0x01, 0x01, 0x01, |
| 106 | 0x15, 0x0C, 0x07, 0x04, 0x02, 0x01, 0x01, 0x02, 0x01, 0x01, |
| 107 | 0x03, 0x02, 0x01, 0x01, 0x01, 0x01, 0x05, 0x03, 0x02, 0x01, |
| 108 | 0x01, 0x01, 0x01, 0x02, 0x01, 0x01, 0x01, 0x09, 0x05, 0x03, |
| 109 | 0x02, 0x01, 0x01, 0x01, 0x01, 0x02, 0x01, 0x01, 0x01, 0x04, |
| 110 | 0x02, 0x01, 0x01, 0x01, 0x02, 0x01, 0x01 |
| 111 | }, |
| 112 | .B_strat = { |
| 113 | 0x42, 0x21, 0x11, 0x09, 0x05, 0x03, 0x02, 0x01, 0x01, 0x01, |
| 114 | 0x01, 0x02, 0x01, 0x01, 0x01, 0x04, 0x02, 0x01, 0x01, 0x01, |
| 115 | 0x02, 0x01, 0x01, 0x08, 0x04, 0x02, 0x01, 0x01, 0x01, 0x02, |
| 116 | 0x01, 0x01, 0x04, 0x02, 0x01, 0x01, 0x02, 0x01, 0x01, 0x10, |
| 117 | 0x08, 0x04, 0x02, 0x01, 0x01, 0x01, 0x02, 0x01, 0x01, 0x04, |
| 118 | 0x02, 0x01, 0x01, 0x02, 0x01, 0x01, 0x08, 0x04, 0x02, 0x01, |
| 119 | 0x01, 0x02, 0x01, 0x01, 0x04, 0x02, 0x01, 0x01, 0x02, 0x01, |
| 120 | 0x01, 0x20, 0x10, 0x08, 0x04, 0x03, 0x01, 0x01, 0x01, 0x01, |
| 121 | 0x02, 0x01, 0x01, 0x04, 0x02, 0x01, 0x01, 0x02, 0x01, 0x01, |
| 122 | 0x08, 0x04, 0x02, 0x01, 0x01, 0x02, 0x01, 0x01, 0x04, 0x02, |
| 123 | 0x01, 0x01, 0x02, 0x01, 0x01, 0x10, 0x08, 0x04, 0x02, 0x01, |
| 124 | 0x01, 0x02, 0x01, 0x01, 0x04, 0x02, 0x01, 0x01, 0x02, 0x01, |
| 125 | 0x01, 0x08, 0x04, 0x02, 0x01, 0x01, 0x02, 0x01, 0x01, 0x04, |
| 126 | 0x02, 0x01, 0x01, 0x02, 0x01, 0x01 |
| 127 | } |
| 128 | }; |