1 /**************************************************************************/ 2 /* */ 3 /* Copyright (c) Microsoft Corporation. All rights reserved. */ 4 /* */ 5 /* This software is licensed under the Microsoft Software License */ 6 /* Terms for Microsoft Azure RTOS. Full text of the license can be */ 7 /* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ 8 /* and in the root directory of this software. */ 9 /* */ 10 /**************************************************************************/ 11 12 13 /**************************************************************************/ 14 /**************************************************************************/ 15 /** */ 16 /** NetX Crypto Component */ 17 /** */ 18 /** Elliptical Curve Cryptography */ 19 /** */ 20 /**************************************************************************/ 21 /**************************************************************************/ 22 23 24 #include "nx_crypto_ec.h" 25 static NX_CRYPTO_CONST HN_UBASE secp224r1_fixed_points_data[][28 >> HN_SIZE_SHIFT] = 26 { 27 28 /* 2G.x */ 29 { 30 HN_ULONG_TO_UBASE(0x666EBBE9), HN_ULONG_TO_UBASE(0x5EFD9675), 31 HN_ULONG_TO_UBASE(0x664D40CE), HN_ULONG_TO_UBASE(0x2A43BCA7), 32 HN_ULONG_TO_UBASE(0x42DF8D8A), HN_ULONG_TO_UBASE(0xF99BC522), 33 HN_ULONG_TO_UBASE(0x1F49BBB0) 34 }, 35 36 /* 2G.y */ 37 { 38 HN_ULONG_TO_UBASE(0x92DC9C43), HN_ULONG_TO_UBASE(0x6229E0B8), 39 HN_ULONG_TO_UBASE(0x608436E6), HN_ULONG_TO_UBASE(0x10D0ECE8), 40 HN_ULONG_TO_UBASE(0x858F1853), HN_ULONG_TO_UBASE(0xB8D321DC), 41 HN_ULONG_TO_UBASE(0x9812DD4E) 42 }, 43 44 /* 3G.x */ 45 { 46 HN_ULONG_TO_UBASE(0x8D5D8EB8), HN_ULONG_TO_UBASE(0xF16D3E67), 47 HN_ULONG_TO_UBASE(0xED1CB362), HN_ULONG_TO_UBASE(0x8A3F559E), 48 HN_ULONG_TO_UBASE(0xE9A3BBCE), HN_ULONG_TO_UBASE(0xC2A74816), 49 HN_ULONG_TO_UBASE(0xEEDCCCD8) 50 }, 51 52 /* 3G.y */ 53 { 54 HN_ULONG_TO_UBASE(0xED50266D), HN_ULONG_TO_UBASE(0xDFF19F90), 55 HN_ULONG_TO_UBASE(0xB4BF65F9), HN_ULONG_TO_UBASE(0xAFECABF2), 56 HN_ULONG_TO_UBASE(0x3865468F), HN_ULONG_TO_UBASE(0x910A1731), 57 HN_ULONG_TO_UBASE(0x5CB379BA) 58 }, 59 60 /* 4G.x */ 61 { 62 HN_ULONG_TO_UBASE(0x6CAB26E3), HN_ULONG_TO_UBASE(0xA0064196), 63 HN_ULONG_TO_UBASE(0x2991FAB0), HN_ULONG_TO_UBASE(0x3A0B91FB), 64 HN_ULONG_TO_UBASE(0xEC27A4E1), HN_ULONG_TO_UBASE(0x5F8EBEEF), 65 HN_ULONG_TO_UBASE(0x0499AA8A) 66 }, 67 68 /* 4G.y */ 69 { 70 HN_ULONG_TO_UBASE(0x7766AF5D), HN_ULONG_TO_UBASE(0x50751040), 71 HN_ULONG_TO_UBASE(0x29610D54), HN_ULONG_TO_UBASE(0xF70684D9), 72 HN_ULONG_TO_UBASE(0xD77AAE82), HN_ULONG_TO_UBASE(0x338C5B81), 73 HN_ULONG_TO_UBASE(0x6916F6D4) 74 }, 75 76 /* 5G.x */ 77 { 78 HN_ULONG_TO_UBASE(0x3B1F15C6), HN_ULONG_TO_UBASE(0xD4EA95AC), 79 HN_ULONG_TO_UBASE(0x00905E82), HN_ULONG_TO_UBASE(0xC8B10860), 80 HN_ULONG_TO_UBASE(0x323AE4D1), HN_ULONG_TO_UBASE(0x7685A3DD), 81 HN_ULONG_TO_UBASE(0x932B56BE) 82 }, 83 84 /* 5G.y */ 85 { 86 HN_ULONG_TO_UBASE(0xEA25DBBF), HN_ULONG_TO_UBASE(0xF09EF93D), 87 HN_ULONG_TO_UBASE(0x5960F390), HN_ULONG_TO_UBASE(0xA8A74166), 88 HN_ULONG_TO_UBASE(0xEC76DBE2), HN_ULONG_TO_UBASE(0x19062AFD), 89 HN_ULONG_TO_UBASE(0x523E80F0) 90 }, 91 92 /* 6G.x */ 93 { 94 HN_ULONG_TO_UBASE(0x26732C73), HN_ULONG_TO_UBASE(0x0F822FDD), 95 HN_ULONG_TO_UBASE(0x83531B5D), HN_ULONG_TO_UBASE(0x1BA4A01C), 96 HN_ULONG_TO_UBASE(0x3F37347C), HN_ULONG_TO_UBASE(0x84725C36), 97 HN_ULONG_TO_UBASE(0xC391B45C) 98 }, 99 100 /* 6G.y */ 101 { 102 HN_ULONG_TO_UBASE(0xB2D6AD24), HN_ULONG_TO_UBASE(0xECBBD5E1), 103 HN_ULONG_TO_UBASE(0xCDE19DFA), HN_ULONG_TO_UBASE(0x2A7FDDFB), 104 HN_ULONG_TO_UBASE(0x93DA7E22), HN_ULONG_TO_UBASE(0xEDE244C3), 105 HN_ULONG_TO_UBASE(0x1EFB7890) 106 }, 107 108 /* 7G.x */ 109 { 110 HN_ULONG_TO_UBASE(0xCA217DA1), HN_ULONG_TO_UBASE(0xBB4C9E90), 111 HN_ULONG_TO_UBASE(0xECA79159), HN_ULONG_TO_UBASE(0x8B7CD11B), 112 HN_ULONG_TO_UBASE(0x8D33C2C9), HN_ULONG_TO_UBASE(0x09F849FF), 113 HN_ULONG_TO_UBASE(0x2610B394) 114 }, 115 116 /* 7G.y */ 117 { 118 HN_ULONG_TO_UBASE(0x2AC64DA0), HN_ULONG_TO_UBASE(0xFB44D135), 119 HN_ULONG_TO_UBASE(0x7B2C46B4), HN_ULONG_TO_UBASE(0x3C89CDBB), 120 HN_ULONG_TO_UBASE(0x6C079B75), HN_ULONG_TO_UBASE(0x20B11296), 121 HN_ULONG_TO_UBASE(0xFE67E4E8) 122 }, 123 124 /* 8G.x */ 125 { 126 HN_ULONG_TO_UBASE(0x2DF5312D), HN_ULONG_TO_UBASE(0x6EE28CAE), 127 HN_ULONG_TO_UBASE(0x61D16F5C), HN_ULONG_TO_UBASE(0x7C4CC71B), 128 HN_ULONG_TO_UBASE(0xB7619A3E), HN_ULONG_TO_UBASE(0x899B4779), 129 HN_ULONG_TO_UBASE(0x05C73240) 130 }, 131 132 /* 8G.y */ 133 { 134 HN_ULONG_TO_UBASE(0x82C73E3A), HN_ULONG_TO_UBASE(0xDA9F7F63), 135 HN_ULONG_TO_UBASE(0x5165C56B), HN_ULONG_TO_UBASE(0xFD561861), 136 HN_ULONG_TO_UBASE(0x1FAB2116), HN_ULONG_TO_UBASE(0xB0839464), 137 HN_ULONG_TO_UBASE(0x72855882) 138 }, 139 140 /* 9G.x */ 141 { 142 HN_ULONG_TO_UBASE(0x2F161C09), HN_ULONG_TO_UBASE(0xB5046918), 143 HN_ULONG_TO_UBASE(0x8CA8D00F), HN_ULONG_TO_UBASE(0xA3E074A9), 144 HN_ULONG_TO_UBASE(0x9DA93489), HN_ULONG_TO_UBASE(0xFB0C1DB8), 145 HN_ULONG_TO_UBASE(0x41C98768) 146 }, 147 148 /* 9G.y */ 149 { 150 HN_ULONG_TO_UBASE(0xFB32DA81), HN_ULONG_TO_UBASE(0x55E5EA05), 151 HN_ULONG_TO_UBASE(0x9FFBCA68), HN_ULONG_TO_UBASE(0x59E63DCE), 152 HN_ULONG_TO_UBASE(0xFE2D3FBF), HN_ULONG_TO_UBASE(0x8738A71C), 153 HN_ULONG_TO_UBASE(0x0E5E0340) 154 }, 155 156 /* 10G.x */ 157 { 158 HN_ULONG_TO_UBASE(0x2333E87F), HN_ULONG_TO_UBASE(0xF6DAB22B), 159 HN_ULONG_TO_UBASE(0x137A5DD2), HN_ULONG_TO_UBASE(0xBEB84430), 160 HN_ULONG_TO_UBASE(0x3AB9F738), HN_ULONG_TO_UBASE(0xC34F24E0), 161 HN_ULONG_TO_UBASE(0xCB0C5D0D) 162 }, 163 164 /* 10G.y */ 165 { 166 HN_ULONG_TO_UBASE(0xF0C8FDA5), HN_ULONG_TO_UBASE(0x44764A7D), 167 HN_ULONG_TO_UBASE(0xA5C3FA20), HN_ULONG_TO_UBASE(0xBE50185B), 168 HN_ULONG_TO_UBASE(0x81D688BC), HN_ULONG_TO_UBASE(0x89388192), 169 HN_ULONG_TO_UBASE(0xC40331DF) 170 }, 171 172 /* 11G.x */ 173 { 174 HN_ULONG_TO_UBASE(0x796F0F60), HN_ULONG_TO_UBASE(0xA3B89530), 175 HN_ULONG_TO_UBASE(0x2BD26909), HN_ULONG_TO_UBASE(0x84DAADE9), 176 HN_ULONG_TO_UBASE(0x0C83FB48), HN_ULONG_TO_UBASE(0xA5A9841A), 177 HN_ULONG_TO_UBASE(0x1765BF22) 178 }, 179 180 /* 11G.y */ 181 { 182 HN_ULONG_TO_UBASE(0xE75DB09E), HN_ULONG_TO_UBASE(0x6F772A9E), 183 HN_ULONG_TO_UBASE(0x6C67CEC1), HN_ULONG_TO_UBASE(0x4E2F23BC), 184 HN_ULONG_TO_UBASE(0x1EDBA8B1), HN_ULONG_TO_UBASE(0x6113694C), 185 HN_ULONG_TO_UBASE(0xE2A215D9) 186 }, 187 188 /* 12G.x */ 189 { 190 HN_ULONG_TO_UBASE(0x9FB5EFB3), HN_ULONG_TO_UBASE(0x52571E50), 191 HN_ULONG_TO_UBASE(0x86964105), HN_ULONG_TO_UBASE(0x74FEADE8), 192 HN_ULONG_TO_UBASE(0xAE85FADA), HN_ULONG_TO_UBASE(0x3BBDE3C8), 193 HN_ULONG_TO_UBASE(0x6C7E4BE8) 194 }, 195 196 /* 12G.y */ 197 { 198 HN_ULONG_TO_UBASE(0x160F4652), HN_ULONG_TO_UBASE(0x39FF9F51), 199 HN_ULONG_TO_UBASE(0xE2495A65), HN_ULONG_TO_UBASE(0x82F4B47C), 200 HN_ULONG_TO_UBASE(0x946C53B5), HN_ULONG_TO_UBASE(0xEE9A60A2), 201 HN_ULONG_TO_UBASE(0x286D2DB3) 202 }, 203 204 /* 13G.x */ 205 { 206 HN_ULONG_TO_UBASE(0x081A44AF), HN_ULONG_TO_UBASE(0x6C40BBD5), 207 HN_ULONG_TO_UBASE(0x183B1392), HN_ULONG_TO_UBASE(0xF6D00995), 208 HN_ULONG_TO_UBASE(0xEFBA6F47), HN_ULONG_TO_UBASE(0xCC0057BC), 209 HN_ULONG_TO_UBASE(0x215619E9) 210 }, 211 212 /* 13G.y */ 213 { 214 HN_ULONG_TO_UBASE(0x3B0DF45E), HN_ULONG_TO_UBASE(0x6F8BC94D), 215 HN_ULONG_TO_UBASE(0x54A3694F), HN_ULONG_TO_UBASE(0xE8B5F11C), 216 HN_ULONG_TO_UBASE(0x31B93CDF), HN_ULONG_TO_UBASE(0x982DB986), 217 HN_ULONG_TO_UBASE(0xE7E3F4B0) 218 }, 219 220 /* 14G.x */ 221 { 222 HN_ULONG_TO_UBASE(0xAB3E1C7B), HN_ULONG_TO_UBASE(0xD8B17048), 223 HN_ULONG_TO_UBASE(0xF36FF8A1), HN_ULONG_TO_UBASE(0xD2C6AC38), 224 HN_ULONG_TO_UBASE(0x29819435), HN_ULONG_TO_UBASE(0x4C07E91C), 225 HN_ULONG_TO_UBASE(0xC813132F) 226 }, 227 228 /* 14G.y */ 229 { 230 HN_ULONG_TO_UBASE(0x5503B11F), HN_ULONG_TO_UBASE(0xEA289142), 231 HN_ULONG_TO_UBASE(0x1030579F), HN_ULONG_TO_UBASE(0x96740878), 232 HN_ULONG_TO_UBASE(0x426BA5CC), HN_ULONG_TO_UBASE(0x8562BCF5), 233 HN_ULONG_TO_UBASE(0x1E28EBF1) 234 }, 235 236 /* 15G.x */ 237 { 238 HN_ULONG_TO_UBASE(0x7CC864EB), HN_ULONG_TO_UBASE(0x4C9F3199), 239 HN_ULONG_TO_UBASE(0x91D28B5E), HN_ULONG_TO_UBASE(0xA97306CD), 240 HN_ULONG_TO_UBASE(0x17036691), HN_ULONG_TO_UBASE(0x497C58FF), 241 HN_ULONG_TO_UBASE(0xF1AEF351) 242 }, 243 244 /* 15G.y */ 245 { 246 HN_ULONG_TO_UBASE(0x600564FF), HN_ULONG_TO_UBASE(0xDBDD1F2D), 247 HN_ULONG_TO_UBASE(0x073B1402), HN_ULONG_TO_UBASE(0xD693DEAD), 248 HN_ULONG_TO_UBASE(0xA684435B), HN_ULONG_TO_UBASE(0x96255874), 249 HN_ULONG_TO_UBASE(0xEEA7471F) 250 } 251 }; 252 static NX_CRYPTO_CONST HN_UBASE secp224r1_fixed_points_2e_data[][28 >> HN_SIZE_SHIFT] = 253 { 254 255 /* 2^e * 1G.x */ 256 { 257 HN_ULONG_TO_UBASE(0x6DDDF554), HN_ULONG_TO_UBASE(0x2D966526), 258 HN_ULONG_TO_UBASE(0xD78B60EF), HN_ULONG_TO_UBASE(0xA4179613), 259 HN_ULONG_TO_UBASE(0x27A34CDB), HN_ULONG_TO_UBASE(0x6AFC31CE), 260 HN_ULONG_TO_UBASE(0xD35AB74D) 261 }, 262 263 /* 2^e * 1G.y */ 264 { 265 HN_ULONG_TO_UBASE(0x22DEB15E), HN_ULONG_TO_UBASE(0xAB85CCDD), 266 HN_ULONG_TO_UBASE(0xE5783A6A), HN_ULONG_TO_UBASE(0x93C62137), 267 HN_ULONG_TO_UBASE(0x41CFFD8C), HN_ULONG_TO_UBASE(0xE90F2DA1), 268 HN_ULONG_TO_UBASE(0x355A1830) 269 }, 270 271 /* 2^e * 2G.x */ 272 { 273 HN_ULONG_TO_UBASE(0xADAADE65), HN_ULONG_TO_UBASE(0x3C1A494E), 274 HN_ULONG_TO_UBASE(0x4DA77FE5), HN_ULONG_TO_UBASE(0xEC86D6DA), 275 HN_ULONG_TO_UBASE(0x992996AB), HN_ULONG_TO_UBASE(0x6090E3E7), 276 HN_ULONG_TO_UBASE(0x65C3553C) 277 }, 278 279 /* 2^e * 2G.y */ 280 { 281 HN_ULONG_TO_UBASE(0x1FB09346), HN_ULONG_TO_UBASE(0xAFFA610B), 282 HN_ULONG_TO_UBASE(0x540B8A4A), HN_ULONG_TO_UBASE(0xCBABF1C6), 283 HN_ULONG_TO_UBASE(0x1A13CCD3), HN_ULONG_TO_UBASE(0x18C28AC5), 284 HN_ULONG_TO_UBASE(0x02995B1B) 285 }, 286 287 /* 2^e * 3G.x */ 288 { 289 HN_ULONG_TO_UBASE(0x8E7295EF), HN_ULONG_TO_UBASE(0x04787456), 290 HN_ULONG_TO_UBASE(0x19FBE38D), HN_ULONG_TO_UBASE(0x0D9A86B4), 291 HN_ULONG_TO_UBASE(0x0690A755), HN_ULONG_TO_UBASE(0xBEAC33DC), 292 HN_ULONG_TO_UBASE(0xD3966A44) 293 }, 294 295 /* 2^e * 3G.y */ 296 { 297 HN_ULONG_TO_UBASE(0xEC29132F), HN_ULONG_TO_UBASE(0xF32B7280), 298 HN_ULONG_TO_UBASE(0x3B6A032D), HN_ULONG_TO_UBASE(0x1200BEAA), 299 HN_ULONG_TO_UBASE(0x7DD88AE4), HN_ULONG_TO_UBASE(0xE3A100DC), 300 HN_ULONG_TO_UBASE(0xD25E2513) 301 }, 302 303 /* 2^e * 4G.x */ 304 { 305 HN_ULONG_TO_UBASE(0xEB2EFAFD), HN_ULONG_TO_UBASE(0x90924857), 306 HN_ULONG_TO_UBASE(0xCE412231), HN_ULONG_TO_UBASE(0x53FCAC2B), 307 HN_ULONG_TO_UBASE(0xDAA14455), HN_ULONG_TO_UBASE(0x3562D58E), 308 HN_ULONG_TO_UBASE(0x825800FD) 309 }, 310 311 /* 2^e * 4G.y */ 312 { 313 HN_ULONG_TO_UBASE(0x8EA96621), HN_ULONG_TO_UBASE(0x8D8D7914), 314 HN_ULONG_TO_UBASE(0x1C3DD9ED), HN_ULONG_TO_UBASE(0x16B523A0), 315 HN_ULONG_TO_UBASE(0x8B219F94), HN_ULONG_TO_UBASE(0x77DAEAAF), 316 HN_ULONG_TO_UBASE(0xD8DB0CC2) 317 }, 318 319 /* 2^e * 5G.x */ 320 { 321 HN_ULONG_TO_UBASE(0xB1A700F0), HN_ULONG_TO_UBASE(0x9176A9C3), 322 HN_ULONG_TO_UBASE(0xD29BC7E6), HN_ULONG_TO_UBASE(0x0327E9AC), 323 HN_ULONG_TO_UBASE(0x212D1A6B), HN_ULONG_TO_UBASE(0xE154BE69), 324 HN_ULONG_TO_UBASE(0x6322E97F) 325 }, 326 327 /* 2^e * 5G.y */ 328 { 329 HN_ULONG_TO_UBASE(0x465D62AA), HN_ULONG_TO_UBASE(0x05469FC5), 330 HN_ULONG_TO_UBASE(0xED18883B), HN_ULONG_TO_UBASE(0x2B888D41), 331 HN_ULONG_TO_UBASE(0x8EAE66C5), HN_ULONG_TO_UBASE(0x25BE511F), 332 HN_ULONG_TO_UBASE(0xE4FCBE93) 333 }, 334 335 /* 2^e * 6G.x */ 336 { 337 HN_ULONG_TO_UBASE(0x583CAC16), HN_ULONG_TO_UBASE(0x3A825FDF), 338 HN_ULONG_TO_UBASE(0x857C7B02), HN_ULONG_TO_UBASE(0x0165020B), 339 HN_ULONG_TO_UBASE(0x3C17744B), HN_ULONG_TO_UBASE(0xDAF2F168), 340 HN_ULONG_TO_UBASE(0x14FFD0A2) 341 }, 342 343 /* 2^e * 6G.y */ 344 { 345 HN_ULONG_TO_UBASE(0x184218F9), HN_ULONG_TO_UBASE(0xD4323B36), 346 HN_ULONG_TO_UBASE(0xEC4E3B47), HN_ULONG_TO_UBASE(0x1ACF4944), 347 HN_ULONG_TO_UBASE(0x5B308084), HN_ULONG_TO_UBASE(0x1A28BBC1), 348 HN_ULONG_TO_UBASE(0x0BCED4B0) 349 }, 350 351 /* 2^e * 7G.x */ 352 { 353 HN_ULONG_TO_UBASE(0x230DF5C4), HN_ULONG_TO_UBASE(0xA892AC22), 354 HN_ULONG_TO_UBASE(0x3B4063ED), HN_ULONG_TO_UBASE(0x0C9352F3), 355 HN_ULONG_TO_UBASE(0x3F19870C), HN_ULONG_TO_UBASE(0xA65233CB), 356 HN_ULONG_TO_UBASE(0x40064F2B) 357 }, 358 359 /* 2^e * 7G.y */ 360 { 361 HN_ULONG_TO_UBASE(0x924F8992), HN_ULONG_TO_UBASE(0x17FE16F0), 362 HN_ULONG_TO_UBASE(0xA25AF5B5), HN_ULONG_TO_UBASE(0x23A6012D), 363 HN_ULONG_TO_UBASE(0x57BB24F7), HN_ULONG_TO_UBASE(0x760DEF1A), 364 HN_ULONG_TO_UBASE(0x06F8BC76) 365 }, 366 367 /* 2^e * 8G.x */ 368 { 369 HN_ULONG_TO_UBASE(0xF7817CB9), HN_ULONG_TO_UBASE(0x784A7084), 370 HN_ULONG_TO_UBASE(0x0738EE9A), HN_ULONG_TO_UBASE(0xC326BCAB), 371 HN_ULONG_TO_UBASE(0xC11E11D9), HN_ULONG_TO_UBASE(0x0F1AAE3E), 372 HN_ULONG_TO_UBASE(0xDC0FE90E) 373 }, 374 375 /* 2^e * 8G.y */ 376 { 377 HN_ULONG_TO_UBASE(0xA5F98390), HN_ULONG_TO_UBASE(0x74CF639E), 378 HN_ULONG_TO_UBASE(0x0AA22FFB), HN_ULONG_TO_UBASE(0x47B75C35), 379 HN_ULONG_TO_UBASE(0xFAE98A40), HN_ULONG_TO_UBASE(0x17FC459A), 380 HN_ULONG_TO_UBASE(0x956EC2D6) 381 }, 382 383 /* 2^e * 9G.x */ 384 { 385 HN_ULONG_TO_UBASE(0x48C1BE6A), HN_ULONG_TO_UBASE(0x624306D6), 386 HN_ULONG_TO_UBASE(0xCD8BC9A4), HN_ULONG_TO_UBASE(0x2F2E9247), 387 HN_ULONG_TO_UBASE(0x595E377D), HN_ULONG_TO_UBASE(0xF1A52EF5), 388 HN_ULONG_TO_UBASE(0xBD1C3CAF) 389 }, 390 391 /* 2^e * 9G.y */ 392 { 393 HN_ULONG_TO_UBASE(0x472409D0), HN_ULONG_TO_UBASE(0x73045E14), 394 HN_ULONG_TO_UBASE(0xE17078F7), HN_ULONG_TO_UBASE(0x4F7D29F3), 395 HN_ULONG_TO_UBASE(0x5A602B2D), HN_ULONG_TO_UBASE(0x5CDFBB74), 396 HN_ULONG_TO_UBASE(0x19183768) 397 }, 398 399 /* 2^e * 10G.x */ 400 { 401 HN_ULONG_TO_UBASE(0x54A8CB79), HN_ULONG_TO_UBASE(0x265B6EE2), 402 HN_ULONG_TO_UBASE(0x433F5E70), HN_ULONG_TO_UBASE(0xDEF44953), 403 HN_ULONG_TO_UBASE(0x1FAEB1D1), HN_ULONG_TO_UBASE(0x5C09DEE2), 404 HN_ULONG_TO_UBASE(0xC4C22578) 405 }, 406 407 /* 2^e * 10G.y */ 408 { 409 HN_ULONG_TO_UBASE(0xBBA1E518), HN_ULONG_TO_UBASE(0xB8307CE7), 410 HN_ULONG_TO_UBASE(0x25B1036D), HN_ULONG_TO_UBASE(0x9E8F31B1), 411 HN_ULONG_TO_UBASE(0xE9186883), HN_ULONG_TO_UBASE(0x33B9F347), 412 HN_ULONG_TO_UBASE(0xC765866E) 413 }, 414 415 /* 2^e * 11G.x */ 416 { 417 HN_ULONG_TO_UBASE(0x24F96906), HN_ULONG_TO_UBASE(0x933BFECE), 418 HN_ULONG_TO_UBASE(0xDA641E50), HN_ULONG_TO_UBASE(0xDB264794), 419 HN_ULONG_TO_UBASE(0x5DF64F95), HN_ULONG_TO_UBASE(0x714B05DE), 420 HN_ULONG_TO_UBASE(0x297ECD89) 421 }, 422 423 /* 2^e * 11G.y */ 424 { 425 HN_ULONG_TO_UBASE(0xEBB2C3AA), HN_ULONG_TO_UBASE(0xD5701BD3), 426 HN_ULONG_TO_UBASE(0xB4F53CB1), HN_ULONG_TO_UBASE(0xAF167073), 427 HN_ULONG_TO_UBASE(0xC5665658), HN_ULONG_TO_UBASE(0x66FE5813), 428 HN_ULONG_TO_UBASE(0x9895089D) 429 }, 430 431 /* 2^e * 12G.x */ 432 { 433 HN_ULONG_TO_UBASE(0xF78C4790), HN_ULONG_TO_UBASE(0x2E0FEF05), 434 HN_ULONG_TO_UBASE(0x3633B05D), HN_ULONG_TO_UBASE(0x1C942D77), 435 HN_ULONG_TO_UBASE(0x229C3A95), HN_ULONG_TO_UBASE(0x4911BB94), 436 HN_ULONG_TO_UBASE(0xBBBD70DF) 437 }, 438 439 /* 2^e * 12G.y */ 440 { 441 HN_ULONG_TO_UBASE(0x3D2C1168), HN_ULONG_TO_UBASE(0x73B2C696), 442 HN_ULONG_TO_UBASE(0x47A72B0D), HN_ULONG_TO_UBASE(0x4080105F), 443 HN_ULONG_TO_UBASE(0xDF611161), HN_ULONG_TO_UBASE(0x9E67B09F), 444 HN_ULONG_TO_UBASE(0x7B7E94B3) 445 }, 446 447 /* 2^e * 13G.x */ 448 { 449 HN_ULONG_TO_UBASE(0x6EFBE2B3), HN_ULONG_TO_UBASE(0x9DAD1A7D), 450 HN_ULONG_TO_UBASE(0x482C0DA6), HN_ULONG_TO_UBASE(0x8345F012), 451 HN_ULONG_TO_UBASE(0x3BDF1243), HN_ULONG_TO_UBASE(0x7AA4D96B), 452 HN_ULONG_TO_UBASE(0x40D7558D) 453 }, 454 455 /* 2^e * 13G.y */ 456 { 457 HN_ULONG_TO_UBASE(0xFB5C6D3D), HN_ULONG_TO_UBASE(0x388A09FF), 458 HN_ULONG_TO_UBASE(0x6E5D9FFD), HN_ULONG_TO_UBASE(0x9B1C9A35), 459 HN_ULONG_TO_UBASE(0x73F15F4F), HN_ULONG_TO_UBASE(0x63C3EA59), 460 HN_ULONG_TO_UBASE(0xDCD5F59F) 461 }, 462 463 /* 2^e * 14G.x */ 464 { 465 HN_ULONG_TO_UBASE(0x4C5CA7AB), HN_ULONG_TO_UBASE(0x37ACF39F), 466 HN_ULONG_TO_UBASE(0x71CC5FD7), HN_ULONG_TO_UBASE(0x11844C80), 467 HN_ULONG_TO_UBASE(0x4E3602CD), HN_ULONG_TO_UBASE(0xC9ABBAC6), 468 HN_ULONG_TO_UBASE(0x0ACD4644) 469 }, 470 471 /* 2^e * 14G.y */ 472 { 473 HN_ULONG_TO_UBASE(0x36D8BF6E), HN_ULONG_TO_UBASE(0x2A6C011A), 474 HN_ULONG_TO_UBASE(0x87BA24E3), HN_ULONG_TO_UBASE(0xFAD8FECD), 475 HN_ULONG_TO_UBASE(0xF6F56574), HN_ULONG_TO_UBASE(0xED940519), 476 HN_ULONG_TO_UBASE(0x050B204C) 477 }, 478 479 /* 2^e * 15G.x */ 480 { 481 HN_ULONG_TO_UBASE(0xAE7D9A96), HN_ULONG_TO_UBASE(0x0AED4F1C), 482 HN_ULONG_TO_UBASE(0xF7AD94C4), HN_ULONG_TO_UBASE(0xEF9B5CEE), 483 HN_ULONG_TO_UBASE(0x8E4A3BF3), HN_ULONG_TO_UBASE(0xC3B55E77), 484 HN_ULONG_TO_UBASE(0x7405783D) 485 }, 486 487 /* 2^e * 15G.y */ 488 { 489 HN_ULONG_TO_UBASE(0x61B6E8C6), HN_ULONG_TO_UBASE(0x8B32477C), 490 HN_ULONG_TO_UBASE(0x97570F01), HN_ULONG_TO_UBASE(0x95D1B46A), 491 HN_ULONG_TO_UBASE(0x176D0A7E), HN_ULONG_TO_UBASE(0x4C7D0E91), 492 HN_ULONG_TO_UBASE(0x3DF90FBC) 493 } 494 }; 495 static NX_CRYPTO_CONST NX_CRYPTO_EC_POINT secp224r1_fixed_points_array[] = 496 { 497 498 /* 2G */ 499 { 500 NX_CRYPTO_EC_POINT_AFFINE, 501 { 502 (HN_UBASE *)&secp224r1_fixed_points_data[0], 503 28 >> HN_SIZE_SHIFT, 28, (UINT)NX_CRYPTO_FALSE 504 }, 505 { 506 (HN_UBASE *)&secp224r1_fixed_points_data[1], 507 28 >> HN_SIZE_SHIFT, 28, (UINT)NX_CRYPTO_FALSE 508 }, 509 {(HN_UBASE *)NX_CRYPTO_NULL, 0u, 0u, 0u} 510 }, 511 512 /* 3G */ 513 { 514 NX_CRYPTO_EC_POINT_AFFINE, 515 { 516 (HN_UBASE *)&secp224r1_fixed_points_data[2], 517 28 >> HN_SIZE_SHIFT, 28, (UINT)NX_CRYPTO_FALSE 518 }, 519 { 520 (HN_UBASE *)&secp224r1_fixed_points_data[3], 521 28 >> HN_SIZE_SHIFT, 28, (UINT)NX_CRYPTO_FALSE 522 }, 523 {(HN_UBASE *)NX_CRYPTO_NULL, 0u, 0u, 0u} 524 }, 525 526 /* 4G */ 527 { 528 NX_CRYPTO_EC_POINT_AFFINE, 529 { 530 (HN_UBASE *)&secp224r1_fixed_points_data[4], 531 28 >> HN_SIZE_SHIFT, 28, (UINT)NX_CRYPTO_FALSE 532 }, 533 { 534 (HN_UBASE *)&secp224r1_fixed_points_data[5], 535 28 >> HN_SIZE_SHIFT, 28, (UINT)NX_CRYPTO_FALSE 536 }, 537 {(HN_UBASE *)NX_CRYPTO_NULL, 0u, 0u, 0u} 538 }, 539 540 /* 5G */ 541 { 542 NX_CRYPTO_EC_POINT_AFFINE, 543 { 544 (HN_UBASE *)&secp224r1_fixed_points_data[6], 545 28 >> HN_SIZE_SHIFT, 28, (UINT)NX_CRYPTO_FALSE 546 }, 547 { 548 (HN_UBASE *)&secp224r1_fixed_points_data[7], 549 28 >> HN_SIZE_SHIFT, 28, (UINT)NX_CRYPTO_FALSE 550 }, 551 {(HN_UBASE *)NX_CRYPTO_NULL, 0u, 0u, 0u} 552 }, 553 554 /* 6G */ 555 { 556 NX_CRYPTO_EC_POINT_AFFINE, 557 { 558 (HN_UBASE *)&secp224r1_fixed_points_data[8], 559 28 >> HN_SIZE_SHIFT, 28, (UINT)NX_CRYPTO_FALSE 560 }, 561 { 562 (HN_UBASE *)&secp224r1_fixed_points_data[9], 563 28 >> HN_SIZE_SHIFT, 28, (UINT)NX_CRYPTO_FALSE 564 }, 565 {(HN_UBASE *)NX_CRYPTO_NULL, 0u, 0u, 0u} 566 }, 567 568 /* 7G */ 569 { 570 NX_CRYPTO_EC_POINT_AFFINE, 571 { 572 (HN_UBASE *)&secp224r1_fixed_points_data[10], 573 28 >> HN_SIZE_SHIFT, 28, (UINT)NX_CRYPTO_FALSE 574 }, 575 { 576 (HN_UBASE *)&secp224r1_fixed_points_data[11], 577 28 >> HN_SIZE_SHIFT, 28, (UINT)NX_CRYPTO_FALSE 578 }, 579 {(HN_UBASE *)NX_CRYPTO_NULL, 0u, 0u, 0u} 580 }, 581 582 /* 8G */ 583 { 584 NX_CRYPTO_EC_POINT_AFFINE, 585 { 586 (HN_UBASE *)&secp224r1_fixed_points_data[12], 587 28 >> HN_SIZE_SHIFT, 28, (UINT)NX_CRYPTO_FALSE 588 }, 589 { 590 (HN_UBASE *)&secp224r1_fixed_points_data[13], 591 28 >> HN_SIZE_SHIFT, 28, (UINT)NX_CRYPTO_FALSE 592 }, 593 {(HN_UBASE *)NX_CRYPTO_NULL, 0u, 0u, 0u} 594 }, 595 596 /* 9G */ 597 { 598 NX_CRYPTO_EC_POINT_AFFINE, 599 { 600 (HN_UBASE *)&secp224r1_fixed_points_data[14], 601 28 >> HN_SIZE_SHIFT, 28, (UINT)NX_CRYPTO_FALSE 602 }, 603 { 604 (HN_UBASE *)&secp224r1_fixed_points_data[15], 605 28 >> HN_SIZE_SHIFT, 28, (UINT)NX_CRYPTO_FALSE 606 }, 607 {(HN_UBASE *)NX_CRYPTO_NULL, 0u, 0u, 0u} 608 }, 609 610 /* 10G */ 611 { 612 NX_CRYPTO_EC_POINT_AFFINE, 613 { 614 (HN_UBASE *)&secp224r1_fixed_points_data[16], 615 28 >> HN_SIZE_SHIFT, 28, (UINT)NX_CRYPTO_FALSE 616 }, 617 { 618 (HN_UBASE *)&secp224r1_fixed_points_data[17], 619 28 >> HN_SIZE_SHIFT, 28, (UINT)NX_CRYPTO_FALSE 620 }, 621 {(HN_UBASE *)NX_CRYPTO_NULL, 0u, 0u, 0u} 622 }, 623 624 /* 11G */ 625 { 626 NX_CRYPTO_EC_POINT_AFFINE, 627 { 628 (HN_UBASE *)&secp224r1_fixed_points_data[18], 629 28 >> HN_SIZE_SHIFT, 28, (UINT)NX_CRYPTO_FALSE 630 }, 631 { 632 (HN_UBASE *)&secp224r1_fixed_points_data[19], 633 28 >> HN_SIZE_SHIFT, 28, (UINT)NX_CRYPTO_FALSE 634 }, 635 {(HN_UBASE *)NX_CRYPTO_NULL, 0u, 0u, 0u} 636 }, 637 638 /* 12G */ 639 { 640 NX_CRYPTO_EC_POINT_AFFINE, 641 { 642 (HN_UBASE *)&secp224r1_fixed_points_data[20], 643 28 >> HN_SIZE_SHIFT, 28, (UINT)NX_CRYPTO_FALSE 644 }, 645 { 646 (HN_UBASE *)&secp224r1_fixed_points_data[21], 647 28 >> HN_SIZE_SHIFT, 28, (UINT)NX_CRYPTO_FALSE 648 }, 649 {(HN_UBASE *)NX_CRYPTO_NULL, 0u, 0u, 0u} 650 }, 651 652 /* 13G */ 653 { 654 NX_CRYPTO_EC_POINT_AFFINE, 655 { 656 (HN_UBASE *)&secp224r1_fixed_points_data[22], 657 28 >> HN_SIZE_SHIFT, 28, (UINT)NX_CRYPTO_FALSE 658 }, 659 { 660 (HN_UBASE *)&secp224r1_fixed_points_data[23], 661 28 >> HN_SIZE_SHIFT, 28, (UINT)NX_CRYPTO_FALSE 662 }, 663 {(HN_UBASE *)NX_CRYPTO_NULL, 0u, 0u, 0u} 664 }, 665 666 /* 14G */ 667 { 668 NX_CRYPTO_EC_POINT_AFFINE, 669 { 670 (HN_UBASE *)&secp224r1_fixed_points_data[24], 671 28 >> HN_SIZE_SHIFT, 28, (UINT)NX_CRYPTO_FALSE 672 }, 673 { 674 (HN_UBASE *)&secp224r1_fixed_points_data[25], 675 28 >> HN_SIZE_SHIFT, 28, (UINT)NX_CRYPTO_FALSE 676 }, 677 {(HN_UBASE *)NX_CRYPTO_NULL, 0u, 0u, 0u} 678 }, 679 680 /* 15G */ 681 { 682 NX_CRYPTO_EC_POINT_AFFINE, 683 { 684 (HN_UBASE *)&secp224r1_fixed_points_data[26], 685 28 >> HN_SIZE_SHIFT, 28, (UINT)NX_CRYPTO_FALSE 686 }, 687 { 688 (HN_UBASE *)&secp224r1_fixed_points_data[27], 689 28 >> HN_SIZE_SHIFT, 28, (UINT)NX_CRYPTO_FALSE 690 }, 691 {(HN_UBASE *)NX_CRYPTO_NULL, 0u, 0u, 0u} 692 } 693 }; 694 static NX_CRYPTO_CONST NX_CRYPTO_EC_POINT secp224r1_fixed_points_2e_array[] = 695 { 696 697 /* 2^e * 1G */ 698 { 699 NX_CRYPTO_EC_POINT_AFFINE, 700 { 701 (HN_UBASE *)&secp224r1_fixed_points_2e_data[0], 702 28 >> HN_SIZE_SHIFT, 28, (UINT)NX_CRYPTO_FALSE 703 }, 704 { 705 (HN_UBASE *)&secp224r1_fixed_points_2e_data[1], 706 28 >> HN_SIZE_SHIFT, 28, (UINT)NX_CRYPTO_FALSE 707 }, 708 {(HN_UBASE *)NX_CRYPTO_NULL, 0u, 0u, 0u} 709 }, 710 711 /* 2^e * 2G */ 712 { 713 NX_CRYPTO_EC_POINT_AFFINE, 714 { 715 (HN_UBASE *)&secp224r1_fixed_points_2e_data[2], 716 28 >> HN_SIZE_SHIFT, 28, (UINT)NX_CRYPTO_FALSE 717 }, 718 { 719 (HN_UBASE *)&secp224r1_fixed_points_2e_data[3], 720 28 >> HN_SIZE_SHIFT, 28, (UINT)NX_CRYPTO_FALSE 721 }, 722 {(HN_UBASE *)NX_CRYPTO_NULL, 0u, 0u, 0u} 723 }, 724 725 /* 2^e * 3G */ 726 { 727 NX_CRYPTO_EC_POINT_AFFINE, 728 { 729 (HN_UBASE *)&secp224r1_fixed_points_2e_data[4], 730 28 >> HN_SIZE_SHIFT, 28, (UINT)NX_CRYPTO_FALSE 731 }, 732 { 733 (HN_UBASE *)&secp224r1_fixed_points_2e_data[5], 734 28 >> HN_SIZE_SHIFT, 28, (UINT)NX_CRYPTO_FALSE 735 }, 736 {(HN_UBASE *)NX_CRYPTO_NULL, 0u, 0u, 0u} 737 }, 738 739 /* 2^e * 4G */ 740 { 741 NX_CRYPTO_EC_POINT_AFFINE, 742 { 743 (HN_UBASE *)&secp224r1_fixed_points_2e_data[6], 744 28 >> HN_SIZE_SHIFT, 28, (UINT)NX_CRYPTO_FALSE 745 }, 746 { 747 (HN_UBASE *)&secp224r1_fixed_points_2e_data[7], 748 28 >> HN_SIZE_SHIFT, 28, (UINT)NX_CRYPTO_FALSE 749 }, 750 {(HN_UBASE *)NX_CRYPTO_NULL, 0u, 0u, 0u} 751 }, 752 753 /* 2^e * 5G */ 754 { 755 NX_CRYPTO_EC_POINT_AFFINE, 756 { 757 (HN_UBASE *)&secp224r1_fixed_points_2e_data[8], 758 28 >> HN_SIZE_SHIFT, 28, (UINT)NX_CRYPTO_FALSE 759 }, 760 { 761 (HN_UBASE *)&secp224r1_fixed_points_2e_data[9], 762 28 >> HN_SIZE_SHIFT, 28, (UINT)NX_CRYPTO_FALSE 763 }, 764 {(HN_UBASE *)NX_CRYPTO_NULL, 0u, 0u, 0u} 765 }, 766 767 /* 2^e * 6G */ 768 { 769 NX_CRYPTO_EC_POINT_AFFINE, 770 { 771 (HN_UBASE *)&secp224r1_fixed_points_2e_data[10], 772 28 >> HN_SIZE_SHIFT, 28, (UINT)NX_CRYPTO_FALSE 773 }, 774 { 775 (HN_UBASE *)&secp224r1_fixed_points_2e_data[11], 776 28 >> HN_SIZE_SHIFT, 28, (UINT)NX_CRYPTO_FALSE 777 }, 778 {(HN_UBASE *)NX_CRYPTO_NULL, 0u, 0u, 0u} 779 }, 780 781 /* 2^e * 7G */ 782 { 783 NX_CRYPTO_EC_POINT_AFFINE, 784 { 785 (HN_UBASE *)&secp224r1_fixed_points_2e_data[12], 786 28 >> HN_SIZE_SHIFT, 28, (UINT)NX_CRYPTO_FALSE 787 }, 788 { 789 (HN_UBASE *)&secp224r1_fixed_points_2e_data[13], 790 28 >> HN_SIZE_SHIFT, 28, (UINT)NX_CRYPTO_FALSE 791 }, 792 {(HN_UBASE *)NX_CRYPTO_NULL, 0u, 0u, 0u} 793 }, 794 795 /* 2^e * 8G */ 796 { 797 NX_CRYPTO_EC_POINT_AFFINE, 798 { 799 (HN_UBASE *)&secp224r1_fixed_points_2e_data[14], 800 28 >> HN_SIZE_SHIFT, 28, (UINT)NX_CRYPTO_FALSE 801 }, 802 { 803 (HN_UBASE *)&secp224r1_fixed_points_2e_data[15], 804 28 >> HN_SIZE_SHIFT, 28, (UINT)NX_CRYPTO_FALSE 805 }, 806 {(HN_UBASE *)NX_CRYPTO_NULL, 0u, 0u, 0u} 807 }, 808 809 /* 2^e * 9G */ 810 { 811 NX_CRYPTO_EC_POINT_AFFINE, 812 { 813 (HN_UBASE *)&secp224r1_fixed_points_2e_data[16], 814 28 >> HN_SIZE_SHIFT, 28, (UINT)NX_CRYPTO_FALSE 815 }, 816 { 817 (HN_UBASE *)&secp224r1_fixed_points_2e_data[17], 818 28 >> HN_SIZE_SHIFT, 28, (UINT)NX_CRYPTO_FALSE 819 }, 820 {(HN_UBASE *)NX_CRYPTO_NULL, 0u, 0u, 0u} 821 }, 822 823 /* 2^e * 10G */ 824 { 825 NX_CRYPTO_EC_POINT_AFFINE, 826 { 827 (HN_UBASE *)&secp224r1_fixed_points_2e_data[18], 828 28 >> HN_SIZE_SHIFT, 28, (UINT)NX_CRYPTO_FALSE 829 }, 830 { 831 (HN_UBASE *)&secp224r1_fixed_points_2e_data[19], 832 28 >> HN_SIZE_SHIFT, 28, (UINT)NX_CRYPTO_FALSE 833 }, 834 {(HN_UBASE *)NX_CRYPTO_NULL, 0u, 0u, 0u} 835 }, 836 837 /* 2^e * 11G */ 838 { 839 NX_CRYPTO_EC_POINT_AFFINE, 840 { 841 (HN_UBASE *)&secp224r1_fixed_points_2e_data[20], 842 28 >> HN_SIZE_SHIFT, 28, (UINT)NX_CRYPTO_FALSE 843 }, 844 { 845 (HN_UBASE *)&secp224r1_fixed_points_2e_data[21], 846 28 >> HN_SIZE_SHIFT, 28, (UINT)NX_CRYPTO_FALSE 847 }, 848 {(HN_UBASE *)NX_CRYPTO_NULL, 0u, 0u, 0u} 849 }, 850 851 /* 2^e * 12G */ 852 { 853 NX_CRYPTO_EC_POINT_AFFINE, 854 { 855 (HN_UBASE *)&secp224r1_fixed_points_2e_data[22], 856 28 >> HN_SIZE_SHIFT, 28, (UINT)NX_CRYPTO_FALSE 857 }, 858 { 859 (HN_UBASE *)&secp224r1_fixed_points_2e_data[23], 860 28 >> HN_SIZE_SHIFT, 28, (UINT)NX_CRYPTO_FALSE 861 }, 862 {(HN_UBASE *)NX_CRYPTO_NULL, 0u, 0u, 0u} 863 }, 864 865 /* 2^e * 13G */ 866 { 867 NX_CRYPTO_EC_POINT_AFFINE, 868 { 869 (HN_UBASE *)&secp224r1_fixed_points_2e_data[24], 870 28 >> HN_SIZE_SHIFT, 28, (UINT)NX_CRYPTO_FALSE 871 }, 872 { 873 (HN_UBASE *)&secp224r1_fixed_points_2e_data[25], 874 28 >> HN_SIZE_SHIFT, 28, (UINT)NX_CRYPTO_FALSE 875 }, 876 {(HN_UBASE *)NX_CRYPTO_NULL, 0u, 0u, 0u} 877 }, 878 879 /* 2^e * 14G */ 880 { 881 NX_CRYPTO_EC_POINT_AFFINE, 882 { 883 (HN_UBASE *)&secp224r1_fixed_points_2e_data[26], 884 28 >> HN_SIZE_SHIFT, 28, (UINT)NX_CRYPTO_FALSE 885 }, 886 { 887 (HN_UBASE *)&secp224r1_fixed_points_2e_data[27], 888 28 >> HN_SIZE_SHIFT, 28, (UINT)NX_CRYPTO_FALSE 889 }, 890 {(HN_UBASE *)NX_CRYPTO_NULL, 0u, 0u, 0u} 891 }, 892 893 /* 2^e * 15G */ 894 { 895 NX_CRYPTO_EC_POINT_AFFINE, 896 { 897 (HN_UBASE *)&secp224r1_fixed_points_2e_data[28], 898 28 >> HN_SIZE_SHIFT, 28, (UINT)NX_CRYPTO_FALSE 899 }, 900 { 901 (HN_UBASE *)&secp224r1_fixed_points_2e_data[29], 902 28 >> HN_SIZE_SHIFT, 28, (UINT)NX_CRYPTO_FALSE 903 }, 904 {(HN_UBASE *)NX_CRYPTO_NULL, 0u, 0u, 0u} 905 } 906 }; 907 908 909 NX_CRYPTO_CONST NX_CRYPTO_EC_FIXED_POINTS _nx_crypto_ec_secp224r1_fixed_points = 910 { 911 4u, 224u, 56u, 28u, 912 (NX_CRYPTO_EC_POINT *)secp224r1_fixed_points_array, 913 (NX_CRYPTO_EC_POINT *)secp224r1_fixed_points_2e_array 914 }; 915 916