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 #include "nx_crypto_ec.h" 24 static NX_CRYPTO_CONST HN_UBASE secp192r1_fixed_points_data[][24 >> HN_SIZE_SHIFT] = 25 { 26 27 /* 2G.x */ 28 { 29 HN_ULONG_TO_UBASE(0x57B5F01D), HN_ULONG_TO_UBASE(0xF7451A72), 30 HN_ULONG_TO_UBASE(0x1C31929A), HN_ULONG_TO_UBASE(0xB37D3FCE), 31 HN_ULONG_TO_UBASE(0xC600C45C), HN_ULONG_TO_UBASE(0x2B6CACB0) 32 }, 33 34 /* 2G.y */ 35 { 36 HN_ULONG_TO_UBASE(0x47A577B6), HN_ULONG_TO_UBASE(0x08242B45), 37 HN_ULONG_TO_UBASE(0x14505643), HN_ULONG_TO_UBASE(0x294C91BF), 38 HN_ULONG_TO_UBASE(0x4DF109DD), HN_ULONG_TO_UBASE(0xE065AFCC) 39 }, 40 41 /* 3G.x */ 42 { 43 HN_ULONG_TO_UBASE(0x7C24135D), HN_ULONG_TO_UBASE(0xECB18291), 44 HN_ULONG_TO_UBASE(0x2C6CFE0D), HN_ULONG_TO_UBASE(0x90281ACC), 45 HN_ULONG_TO_UBASE(0xC1D40CC7), HN_ULONG_TO_UBASE(0x7265D85B) 46 }, 47 48 /* 3G.y */ 49 { 50 HN_ULONG_TO_UBASE(0xBAD94BD4), HN_ULONG_TO_UBASE(0xD1CCC399), 51 HN_ULONG_TO_UBASE(0x3D4F4115), HN_ULONG_TO_UBASE(0xB5410ABE), 52 HN_ULONG_TO_UBASE(0xE7AD058E), HN_ULONG_TO_UBASE(0xA747B7BB) 53 }, 54 55 /* 4G.x */ 56 { 57 HN_ULONG_TO_UBASE(0xEB97690A), HN_ULONG_TO_UBASE(0xDCB416E0), 58 HN_ULONG_TO_UBASE(0xD31D3E88), HN_ULONG_TO_UBASE(0x7CD89B6E), 59 HN_ULONG_TO_UBASE(0xEAAF5750), HN_ULONG_TO_UBASE(0xF4D5251B) 60 }, 61 62 /* 4G.y */ 63 { 64 HN_ULONG_TO_UBASE(0xE685E484), HN_ULONG_TO_UBASE(0xAF4FE3DE), 65 HN_ULONG_TO_UBASE(0x2914DD60), HN_ULONG_TO_UBASE(0x7B0738A1), 66 HN_ULONG_TO_UBASE(0xF8D8086D), HN_ULONG_TO_UBASE(0x93A49E0A) 67 }, 68 69 /* 5G.x */ 70 { 71 HN_ULONG_TO_UBASE(0x63A15DF0), HN_ULONG_TO_UBASE(0x85F39A75), 72 HN_ULONG_TO_UBASE(0x7D59C96F), HN_ULONG_TO_UBASE(0xF56DAC48), 73 HN_ULONG_TO_UBASE(0xE743AB91), HN_ULONG_TO_UBASE(0xA05414DD) 74 }, 75 76 /* 5G.y */ 77 { 78 HN_ULONG_TO_UBASE(0x7D75E2FE), HN_ULONG_TO_UBASE(0xED11279C), 79 HN_ULONG_TO_UBASE(0xDD3780CE), HN_ULONG_TO_UBASE(0x52499912), 80 HN_ULONG_TO_UBASE(0x14EA5C3B), HN_ULONG_TO_UBASE(0x55D891C6) 81 }, 82 83 /* 6G.x */ 84 { 85 HN_ULONG_TO_UBASE(0xD322681C), HN_ULONG_TO_UBASE(0xDC75BF3F), 86 HN_ULONG_TO_UBASE(0x34CA0295), HN_ULONG_TO_UBASE(0x6F11267C), 87 HN_ULONG_TO_UBASE(0xA1FF18DC), HN_ULONG_TO_UBASE(0xD0415D7F) 88 }, 89 90 /* 6G.y */ 91 { 92 HN_ULONG_TO_UBASE(0xFB9C3DB7), HN_ULONG_TO_UBASE(0x3A2AF705), 93 HN_ULONG_TO_UBASE(0xDBB5197B), HN_ULONG_TO_UBASE(0x9597E09B), 94 HN_ULONG_TO_UBASE(0x560CBBA9), HN_ULONG_TO_UBASE(0x6E2162E5) 95 }, 96 97 /* 7G.x */ 98 { 99 HN_ULONG_TO_UBASE(0x77F3F88B), HN_ULONG_TO_UBASE(0xC9C6A9B3), 100 HN_ULONG_TO_UBASE(0x1E64859F), HN_ULONG_TO_UBASE(0x673FD86D), 101 HN_ULONG_TO_UBASE(0x6E9F6CF1), HN_ULONG_TO_UBASE(0x8EA2B9DB) 102 }, 103 104 /* 7G.y */ 105 { 106 HN_ULONG_TO_UBASE(0xE0A0052F), HN_ULONG_TO_UBASE(0xF48FE5DE), 107 HN_ULONG_TO_UBASE(0x2ABEDD5C), HN_ULONG_TO_UBASE(0x7E78EA0A), 108 HN_ULONG_TO_UBASE(0xAFCA5583), HN_ULONG_TO_UBASE(0x38F59B56) 109 }, 110 111 /* 8G.x */ 112 { 113 HN_ULONG_TO_UBASE(0xBFE7D0FE), HN_ULONG_TO_UBASE(0x94CCEE34), 114 HN_ULONG_TO_UBASE(0xEF999054), HN_ULONG_TO_UBASE(0x8AEB7640), 115 HN_ULONG_TO_UBASE(0xEC46F6C0), HN_ULONG_TO_UBASE(0xF357F34A) 116 }, 117 118 /* 8G.y */ 119 { 120 HN_ULONG_TO_UBASE(0x15141FCE), HN_ULONG_TO_UBASE(0x04CC78E2), 121 HN_ULONG_TO_UBASE(0xD0BDD150), HN_ULONG_TO_UBASE(0xDC220529), 122 HN_ULONG_TO_UBASE(0x967F9AC7), HN_ULONG_TO_UBASE(0x3DE0E1CE) 123 }, 124 125 /* 9G.x */ 126 { 127 HN_ULONG_TO_UBASE(0x04BA3AAE), HN_ULONG_TO_UBASE(0x68520373), 128 HN_ULONG_TO_UBASE(0xBDE031DB), HN_ULONG_TO_UBASE(0x49607803), 129 HN_ULONG_TO_UBASE(0x82DB9023), HN_ULONG_TO_UBASE(0x8911E847) 130 }, 131 132 /* 9G.y */ 133 { 134 HN_ULONG_TO_UBASE(0x5287EDCF), HN_ULONG_TO_UBASE(0xED56DC39), 135 HN_ULONG_TO_UBASE(0xE648DD09), HN_ULONG_TO_UBASE(0x95F640DC), 136 HN_ULONG_TO_UBASE(0xDB2DE02B), HN_ULONG_TO_UBASE(0x15BDD6CF) 137 }, 138 139 /* 10G.x */ 140 { 141 HN_ULONG_TO_UBASE(0xC93BC173), HN_ULONG_TO_UBASE(0xF921D37D), 142 HN_ULONG_TO_UBASE(0x68416D1F), HN_ULONG_TO_UBASE(0x5B478BA1), 143 HN_ULONG_TO_UBASE(0xAE09F12D), HN_ULONG_TO_UBASE(0x5D1AAE40) 144 }, 145 146 /* 10G.y */ 147 { 148 HN_ULONG_TO_UBASE(0x3AD110C0), HN_ULONG_TO_UBASE(0x6401E81B), 149 HN_ULONG_TO_UBASE(0x5ED83DC3), HN_ULONG_TO_UBASE(0x32788DB8), 150 HN_ULONG_TO_UBASE(0x808AE8F8), HN_ULONG_TO_UBASE(0x1E7C5765) 151 }, 152 153 /* 11G.x */ 154 { 155 HN_ULONG_TO_UBASE(0xCF233623), HN_ULONG_TO_UBASE(0xA8E49EDC), 156 HN_ULONG_TO_UBASE(0x54661A7B), HN_ULONG_TO_UBASE(0xB509F0FC), 157 HN_ULONG_TO_UBASE(0x1A67D2D4), HN_ULONG_TO_UBASE(0x9B379BCD) 158 }, 159 160 /* 11G.y */ 161 { 162 HN_ULONG_TO_UBASE(0x4741649E), HN_ULONG_TO_UBASE(0x8FFC4B9A), 163 HN_ULONG_TO_UBASE(0xE4F6B09E), HN_ULONG_TO_UBASE(0xEC28DBE4), 164 HN_ULONG_TO_UBASE(0xCFBDACBD), HN_ULONG_TO_UBASE(0xA8204FE0) 165 }, 166 167 /* 12G.x */ 168 { 169 HN_ULONG_TO_UBASE(0x250B8857), HN_ULONG_TO_UBASE(0xBCA5231C), 170 HN_ULONG_TO_UBASE(0x86F05B35), HN_ULONG_TO_UBASE(0x1623A88F), 171 HN_ULONG_TO_UBASE(0x6FE1D2AE), HN_ULONG_TO_UBASE(0xD2D6B452) 172 }, 173 174 /* 12G.y */ 175 { 176 HN_ULONG_TO_UBASE(0x806F27B2), HN_ULONG_TO_UBASE(0x277D3765), 177 HN_ULONG_TO_UBASE(0x453872D5), HN_ULONG_TO_UBASE(0xB03727EF), 178 HN_ULONG_TO_UBASE(0xCA59599C), HN_ULONG_TO_UBASE(0xC8F9F5DD) 179 }, 180 181 /* 13G.x */ 182 { 183 HN_ULONG_TO_UBASE(0x37AC02B2), HN_ULONG_TO_UBASE(0xBDBD95EE), 184 HN_ULONG_TO_UBASE(0x36CDF07B), HN_ULONG_TO_UBASE(0x0109B514), 185 HN_ULONG_TO_UBASE(0xFDCCFC0B), HN_ULONG_TO_UBASE(0x122A98EE) 186 }, 187 188 /* 13G.y */ 189 { 190 HN_ULONG_TO_UBASE(0xF68871F7), HN_ULONG_TO_UBASE(0xEAD7B061), 191 HN_ULONG_TO_UBASE(0xB0A86AA5), HN_ULONG_TO_UBASE(0xBC68F73B), 192 HN_ULONG_TO_UBASE(0xD19486A6), HN_ULONG_TO_UBASE(0x25FE3BF0) 193 }, 194 195 /* 14G.x */ 196 { 197 HN_ULONG_TO_UBASE(0x93487CAD), HN_ULONG_TO_UBASE(0x03FC9D91), 198 HN_ULONG_TO_UBASE(0xBE44BC3E), HN_ULONG_TO_UBASE(0x9A7A4878), 199 HN_ULONG_TO_UBASE(0x50A9133D), HN_ULONG_TO_UBASE(0x94EF90DB) 200 }, 201 202 /* 14G.y */ 203 { 204 HN_ULONG_TO_UBASE(0xB22E7227), HN_ULONG_TO_UBASE(0x9E4BE663), 205 HN_ULONG_TO_UBASE(0xF7B51234), HN_ULONG_TO_UBASE(0x712DB99C), 206 HN_ULONG_TO_UBASE(0x6722EA87), HN_ULONG_TO_UBASE(0xAEE4182A) 207 }, 208 209 /* 15G.x */ 210 { 211 HN_ULONG_TO_UBASE(0x4E246A62), HN_ULONG_TO_UBASE(0x466E24C1), 212 HN_ULONG_TO_UBASE(0x1A5DDDF7), HN_ULONG_TO_UBASE(0xBA5B47AA), 213 HN_ULONG_TO_UBASE(0xB76ECAC6), HN_ULONG_TO_UBASE(0xC70B48A3) 214 }, 215 216 /* 15G.y */ 217 { 218 HN_ULONG_TO_UBASE(0xAF11FCDE), HN_ULONG_TO_UBASE(0x32B355E1), 219 HN_ULONG_TO_UBASE(0x6E177D11), HN_ULONG_TO_UBASE(0x5D79D5D5), 220 HN_ULONG_TO_UBASE(0xB07ECDED), HN_ULONG_TO_UBASE(0x4494DDAB) 221 } 222 }; 223 static NX_CRYPTO_CONST HN_UBASE secp192r1_fixed_points_2e_data[][24 >> HN_SIZE_SHIFT] = 224 { 225 226 /* 2^e * 1G.x */ 227 { 228 HN_ULONG_TO_UBASE(0x44BB5883), HN_ULONG_TO_UBASE(0x43E29DEE), 229 HN_ULONG_TO_UBASE(0x60B4F224), HN_ULONG_TO_UBASE(0x99C69288), 230 HN_ULONG_TO_UBASE(0xA0AF9296), HN_ULONG_TO_UBASE(0xC657D599) 231 }, 232 233 /* 2^e * 1G.y */ 234 { 235 HN_ULONG_TO_UBASE(0xC1C7B573), HN_ULONG_TO_UBASE(0x983289F2), 236 HN_ULONG_TO_UBASE(0x9A4B323D), HN_ULONG_TO_UBASE(0x8BDB577B), 237 HN_ULONG_TO_UBASE(0x42F42E75), HN_ULONG_TO_UBASE(0x460DAB0F) 238 }, 239 240 /* 2^e * 2G.x */ 241 { 242 HN_ULONG_TO_UBASE(0x2D7E1827), HN_ULONG_TO_UBASE(0x4516CAE4), 243 HN_ULONG_TO_UBASE(0x590267C8), HN_ULONG_TO_UBASE(0xE9ACCF64), 244 HN_ULONG_TO_UBASE(0xB5AD4207), HN_ULONG_TO_UBASE(0xE7897F12) 245 }, 246 247 /* 2^e * 2G.y */ 248 { 249 HN_ULONG_TO_UBASE(0xBE19E9D6), HN_ULONG_TO_UBASE(0x1EF20C93), 250 HN_ULONG_TO_UBASE(0xD7F7C011), HN_ULONG_TO_UBASE(0x7C5D3FCB), 251 HN_ULONG_TO_UBASE(0x9BA0DF2B), HN_ULONG_TO_UBASE(0x68B64D8B) 252 }, 253 254 /* 2^e * 3G.x */ 255 { 256 HN_ULONG_TO_UBASE(0x930ED817), HN_ULONG_TO_UBASE(0x787C0783), 257 HN_ULONG_TO_UBASE(0xB42B708E), HN_ULONG_TO_UBASE(0xC3C56CFC), 258 HN_ULONG_TO_UBASE(0x1C56846C), HN_ULONG_TO_UBASE(0xD522ABD8) 259 }, 260 261 /* 2^e * 3G.y */ 262 { 263 HN_ULONG_TO_UBASE(0xE35398F7), HN_ULONG_TO_UBASE(0x064452EE), 264 HN_ULONG_TO_UBASE(0x29E400EC), HN_ULONG_TO_UBASE(0xEF936452), 265 HN_ULONG_TO_UBASE(0x6D70CBB0), HN_ULONG_TO_UBASE(0x8FF8A03F) 266 }, 267 268 /* 2^e * 4G.x */ 269 { 270 HN_ULONG_TO_UBASE(0x26984CEF), HN_ULONG_TO_UBASE(0x2C537FA4), 271 HN_ULONG_TO_UBASE(0x911E7D81), HN_ULONG_TO_UBASE(0xAAFA4F23), 272 HN_ULONG_TO_UBASE(0x75E3554B), HN_ULONG_TO_UBASE(0x028D15E2) 273 }, 274 275 /* 2^e * 4G.y */ 276 { 277 HN_ULONG_TO_UBASE(0x99913442), HN_ULONG_TO_UBASE(0x4A23A729), 278 HN_ULONG_TO_UBASE(0x6CF3E242), HN_ULONG_TO_UBASE(0x0EBA886E), 279 HN_ULONG_TO_UBASE(0x9C451670), HN_ULONG_TO_UBASE(0x6FC74BCF) 280 }, 281 282 /* 2^e * 5G.x */ 283 { 284 HN_ULONG_TO_UBASE(0xF2406FA6), HN_ULONG_TO_UBASE(0x508E7692), 285 HN_ULONG_TO_UBASE(0x027DD7D4), HN_ULONG_TO_UBASE(0xC52BF70D), 286 HN_ULONG_TO_UBASE(0x5F1EFC4E), HN_ULONG_TO_UBASE(0x6B4A073F) 287 }, 288 289 /* 2^e * 5G.y */ 290 { 291 HN_ULONG_TO_UBASE(0xFD894650), HN_ULONG_TO_UBASE(0xC910CC89), 292 HN_ULONG_TO_UBASE(0x2F982605), HN_ULONG_TO_UBASE(0x1CD5520D), 293 HN_ULONG_TO_UBASE(0x9926A466), HN_ULONG_TO_UBASE(0x0CDEADEB) 294 }, 295 296 /* 2^e * 6G.x */ 297 { 298 HN_ULONG_TO_UBASE(0x15DFAAA5), HN_ULONG_TO_UBASE(0x401102B6), 299 HN_ULONG_TO_UBASE(0xE3E453F3), HN_ULONG_TO_UBASE(0xEEA15E1C), 300 HN_ULONG_TO_UBASE(0xD15E69CC), HN_ULONG_TO_UBASE(0x8BF49642) 301 }, 302 303 /* 2^e * 6G.y */ 304 { 305 HN_ULONG_TO_UBASE(0x9B3EBEDD), HN_ULONG_TO_UBASE(0x955C2C62), 306 HN_ULONG_TO_UBASE(0xC7C9017E), HN_ULONG_TO_UBASE(0xABA0DED2), 307 HN_ULONG_TO_UBASE(0x6F999205), HN_ULONG_TO_UBASE(0x957C2689) 308 }, 309 310 /* 2^e * 7G.x */ 311 { 312 HN_ULONG_TO_UBASE(0xED0A68AB), HN_ULONG_TO_UBASE(0x3F394D59), 313 HN_ULONG_TO_UBASE(0x871DE2C7), HN_ULONG_TO_UBASE(0x921125DB), 314 HN_ULONG_TO_UBASE(0xA64524B1), HN_ULONG_TO_UBASE(0xBA68427E) 315 }, 316 317 /* 2^e * 7G.y */ 318 { 319 HN_ULONG_TO_UBASE(0xF1B72362), HN_ULONG_TO_UBASE(0x5FE500A8), 320 HN_ULONG_TO_UBASE(0x019F0084), HN_ULONG_TO_UBASE(0x47DB28B7), 321 HN_ULONG_TO_UBASE(0x6F936172), HN_ULONG_TO_UBASE(0x97A78F13) 322 }, 323 324 /* 2^e * 8G.x */ 325 { 326 HN_ULONG_TO_UBASE(0xCBDF060C), HN_ULONG_TO_UBASE(0x15B007FF), 327 HN_ULONG_TO_UBASE(0x6541F6F4), HN_ULONG_TO_UBASE(0x3B20E563), 328 HN_ULONG_TO_UBASE(0x0C56D3C6), HN_ULONG_TO_UBASE(0x920F9A3C) 329 }, 330 331 /* 2^e * 8G.y */ 332 { 333 HN_ULONG_TO_UBASE(0x0D0028D3), HN_ULONG_TO_UBASE(0xDD7B77D0), 334 HN_ULONG_TO_UBASE(0x5192D915), HN_ULONG_TO_UBASE(0xCEE00DDA), 335 HN_ULONG_TO_UBASE(0x81F6B3B6), HN_ULONG_TO_UBASE(0xCD7902F7) 336 }, 337 338 /* 2^e * 9G.x */ 339 { 340 HN_ULONG_TO_UBASE(0x360628CD), HN_ULONG_TO_UBASE(0x81C8FF32), 341 HN_ULONG_TO_UBASE(0x1A3704A7), HN_ULONG_TO_UBASE(0xCDF22E64), 342 HN_ULONG_TO_UBASE(0xB83BF30D), HN_ULONG_TO_UBASE(0xFF915D40) 343 }, 344 345 /* 2^e * 9G.y */ 346 { 347 HN_ULONG_TO_UBASE(0x55876906), HN_ULONG_TO_UBASE(0xCFA29C4A), 348 HN_ULONG_TO_UBASE(0x7E66ACA2), HN_ULONG_TO_UBASE(0xF8DC5DF3), 349 HN_ULONG_TO_UBASE(0x10846EA4), HN_ULONG_TO_UBASE(0xD489FC2D) 350 }, 351 352 /* 2^e * 10G.x */ 353 { 354 HN_ULONG_TO_UBASE(0x660237B3), HN_ULONG_TO_UBASE(0x9DAB3F5F), 355 HN_ULONG_TO_UBASE(0xA7C43E04), HN_ULONG_TO_UBASE(0xFFF8E01D), 356 HN_ULONG_TO_UBASE(0xB60C1C4D), HN_ULONG_TO_UBASE(0xC432F4F1) 357 }, 358 359 /* 2^e * 10G.y */ 360 { 361 HN_ULONG_TO_UBASE(0xF065C804), HN_ULONG_TO_UBASE(0x07288012), 362 HN_ULONG_TO_UBASE(0xBF214D87), HN_ULONG_TO_UBASE(0x0AABB920), 363 HN_ULONG_TO_UBASE(0xB3B811E0), HN_ULONG_TO_UBASE(0x27EB5A71) 364 }, 365 366 /* 2^e * 11G.x */ 367 { 368 HN_ULONG_TO_UBASE(0x0C0F37E2), HN_ULONG_TO_UBASE(0x355701B7), 369 HN_ULONG_TO_UBASE(0x23289564), HN_ULONG_TO_UBASE(0xBAEBE73F), 370 HN_ULONG_TO_UBASE(0xB1631987), HN_ULONG_TO_UBASE(0xBC898ABF) 371 }, 372 373 /* 2^e * 11G.y */ 374 { 375 HN_ULONG_TO_UBASE(0x73037073), HN_ULONG_TO_UBASE(0x57453BA7), 376 HN_ULONG_TO_UBASE(0x13E2013F), HN_ULONG_TO_UBASE(0x44DA9223), 377 HN_ULONG_TO_UBASE(0x85DDF1D4), HN_ULONG_TO_UBASE(0xADD1BC83) 378 }, 379 380 /* 2^e * 12G.x */ 381 { 382 HN_ULONG_TO_UBASE(0x73A5BC11), HN_ULONG_TO_UBASE(0x158A8A8B), 383 HN_ULONG_TO_UBASE(0xF78E7F80), HN_ULONG_TO_UBASE(0x8DCF5CFE), 384 HN_ULONG_TO_UBASE(0x45E1F467), HN_ULONG_TO_UBASE(0xCF523028) 385 }, 386 387 /* 2^e * 12G.y */ 388 { 389 HN_ULONG_TO_UBASE(0x10966C87), HN_ULONG_TO_UBASE(0xB3D06D8A), 390 HN_ULONG_TO_UBASE(0xC2569071), HN_ULONG_TO_UBASE(0x8D0FAFA5), 391 HN_ULONG_TO_UBASE(0x7D227D75), HN_ULONG_TO_UBASE(0x89521916) 392 }, 393 394 /* 2^e * 13G.x */ 395 { 396 HN_ULONG_TO_UBASE(0xFB55FB12), HN_ULONG_TO_UBASE(0x659091CD), 397 HN_ULONG_TO_UBASE(0x3E2EA468), HN_ULONG_TO_UBASE(0x50A85BEC), 398 HN_ULONG_TO_UBASE(0x5801DFF4), HN_ULONG_TO_UBASE(0xECF1469E) 399 }, 400 401 /* 2^e * 13G.y */ 402 { 403 HN_ULONG_TO_UBASE(0x6294C83B), HN_ULONG_TO_UBASE(0xAEE2EE4D), 404 HN_ULONG_TO_UBASE(0x910958E4), HN_ULONG_TO_UBASE(0x568D1C50), 405 HN_ULONG_TO_UBASE(0x565BA314), HN_ULONG_TO_UBASE(0x87FEF198) 406 }, 407 408 /* 2^e * 14G.x */ 409 { 410 HN_ULONG_TO_UBASE(0x29230F47), HN_ULONG_TO_UBASE(0x3B1DCF03), 411 HN_ULONG_TO_UBASE(0xD4971DEF), HN_ULONG_TO_UBASE(0x20E1E1AD), 412 HN_ULONG_TO_UBASE(0xA6069364), HN_ULONG_TO_UBASE(0xBF863D0F) 413 }, 414 415 /* 2^e * 14G.y */ 416 { 417 HN_ULONG_TO_UBASE(0x74CCAE45), HN_ULONG_TO_UBASE(0x4187A9DF), 418 HN_ULONG_TO_UBASE(0x62E227BE), HN_ULONG_TO_UBASE(0x60CD8E2B), 419 HN_ULONG_TO_UBASE(0x47C3405E), HN_ULONG_TO_UBASE(0xA6043F75) 420 }, 421 422 /* 2^e * 15G.x */ 423 { 424 HN_ULONG_TO_UBASE(0x6E761455), HN_ULONG_TO_UBASE(0x40423BC2), 425 HN_ULONG_TO_UBASE(0x023E182D), HN_ULONG_TO_UBASE(0x575E0245), 426 HN_ULONG_TO_UBASE(0x7ACABD8A), HN_ULONG_TO_UBASE(0xA346AB39) 427 }, 428 429 /* 2^e * 15G.y */ 430 { 431 HN_ULONG_TO_UBASE(0x1C5A3750), HN_ULONG_TO_UBASE(0x688A166C), 432 HN_ULONG_TO_UBASE(0x5780BE48), HN_ULONG_TO_UBASE(0xAB3E9AC3), 433 HN_ULONG_TO_UBASE(0xAC72B5F3), HN_ULONG_TO_UBASE(0x2A1FAD07) 434 } 435 }; 436 static NX_CRYPTO_CONST NX_CRYPTO_EC_POINT secp192r1_fixed_points_array[] = 437 { 438 439 /* 2G */ 440 { 441 NX_CRYPTO_EC_POINT_AFFINE, 442 { 443 (HN_UBASE *)&secp192r1_fixed_points_data[0], 444 24 >> HN_SIZE_SHIFT, 24, (UINT)NX_CRYPTO_FALSE 445 }, 446 { 447 (HN_UBASE *)&secp192r1_fixed_points_data[1], 448 24 >> HN_SIZE_SHIFT, 24, (UINT)NX_CRYPTO_FALSE 449 }, 450 {(HN_UBASE *)NX_CRYPTO_NULL, 0u, 0u, 0u} 451 }, 452 453 /* 3G */ 454 { 455 NX_CRYPTO_EC_POINT_AFFINE, 456 { 457 (HN_UBASE *)&secp192r1_fixed_points_data[2], 458 24 >> HN_SIZE_SHIFT, 24, (UINT)NX_CRYPTO_FALSE 459 }, 460 { 461 (HN_UBASE *)&secp192r1_fixed_points_data[3], 462 24 >> HN_SIZE_SHIFT, 24, (UINT)NX_CRYPTO_FALSE 463 }, 464 {(HN_UBASE *)NX_CRYPTO_NULL, 0u, 0u, 0u} 465 }, 466 467 /* 4G */ 468 { 469 NX_CRYPTO_EC_POINT_AFFINE, 470 { 471 (HN_UBASE *)&secp192r1_fixed_points_data[4], 472 24 >> HN_SIZE_SHIFT, 24, (UINT)NX_CRYPTO_FALSE 473 }, 474 { 475 (HN_UBASE *)&secp192r1_fixed_points_data[5], 476 24 >> HN_SIZE_SHIFT, 24, (UINT)NX_CRYPTO_FALSE 477 }, 478 {(HN_UBASE *)NX_CRYPTO_NULL, 0u, 0u, 0u} 479 }, 480 481 /* 5G */ 482 { 483 NX_CRYPTO_EC_POINT_AFFINE, 484 { 485 (HN_UBASE *)&secp192r1_fixed_points_data[6], 486 24 >> HN_SIZE_SHIFT, 24, (UINT)NX_CRYPTO_FALSE 487 }, 488 { 489 (HN_UBASE *)&secp192r1_fixed_points_data[7], 490 24 >> HN_SIZE_SHIFT, 24, (UINT)NX_CRYPTO_FALSE 491 }, 492 {(HN_UBASE *)NX_CRYPTO_NULL, 0u, 0u, 0u} 493 }, 494 495 /* 6G */ 496 { 497 NX_CRYPTO_EC_POINT_AFFINE, 498 { 499 (HN_UBASE *)&secp192r1_fixed_points_data[8], 500 24 >> HN_SIZE_SHIFT, 24, (UINT)NX_CRYPTO_FALSE 501 }, 502 { 503 (HN_UBASE *)&secp192r1_fixed_points_data[9], 504 24 >> HN_SIZE_SHIFT, 24, (UINT)NX_CRYPTO_FALSE 505 }, 506 {(HN_UBASE *)NX_CRYPTO_NULL, 0u, 0u, 0u} 507 }, 508 509 /* 7G */ 510 { 511 NX_CRYPTO_EC_POINT_AFFINE, 512 { 513 (HN_UBASE *)&secp192r1_fixed_points_data[10], 514 24 >> HN_SIZE_SHIFT, 24, (UINT)NX_CRYPTO_FALSE 515 }, 516 { 517 (HN_UBASE *)&secp192r1_fixed_points_data[11], 518 24 >> HN_SIZE_SHIFT, 24, (UINT)NX_CRYPTO_FALSE 519 }, 520 {(HN_UBASE *)NX_CRYPTO_NULL, 0u, 0u, 0u} 521 }, 522 523 /* 8G */ 524 { 525 NX_CRYPTO_EC_POINT_AFFINE, 526 { 527 (HN_UBASE *)&secp192r1_fixed_points_data[12], 528 24 >> HN_SIZE_SHIFT, 24, (UINT)NX_CRYPTO_FALSE 529 }, 530 { 531 (HN_UBASE *)&secp192r1_fixed_points_data[13], 532 24 >> HN_SIZE_SHIFT, 24, (UINT)NX_CRYPTO_FALSE 533 }, 534 {(HN_UBASE *)NX_CRYPTO_NULL, 0u, 0u, 0u} 535 }, 536 537 /* 9G */ 538 { 539 NX_CRYPTO_EC_POINT_AFFINE, 540 { 541 (HN_UBASE *)&secp192r1_fixed_points_data[14], 542 24 >> HN_SIZE_SHIFT, 24, (UINT)NX_CRYPTO_FALSE 543 }, 544 { 545 (HN_UBASE *)&secp192r1_fixed_points_data[15], 546 24 >> HN_SIZE_SHIFT, 24, (UINT)NX_CRYPTO_FALSE 547 }, 548 {(HN_UBASE *)NX_CRYPTO_NULL, 0u, 0u, 0u} 549 }, 550 551 /* 10G */ 552 { 553 NX_CRYPTO_EC_POINT_AFFINE, 554 { 555 (HN_UBASE *)&secp192r1_fixed_points_data[16], 556 24 >> HN_SIZE_SHIFT, 24, (UINT)NX_CRYPTO_FALSE 557 }, 558 { 559 (HN_UBASE *)&secp192r1_fixed_points_data[17], 560 24 >> HN_SIZE_SHIFT, 24, (UINT)NX_CRYPTO_FALSE 561 }, 562 {(HN_UBASE *)NX_CRYPTO_NULL, 0u, 0u, 0u} 563 }, 564 565 /* 11G */ 566 { 567 NX_CRYPTO_EC_POINT_AFFINE, 568 { 569 (HN_UBASE *)&secp192r1_fixed_points_data[18], 570 24 >> HN_SIZE_SHIFT, 24, (UINT)NX_CRYPTO_FALSE 571 }, 572 { 573 (HN_UBASE *)&secp192r1_fixed_points_data[19], 574 24 >> HN_SIZE_SHIFT, 24, (UINT)NX_CRYPTO_FALSE 575 }, 576 {(HN_UBASE *)NX_CRYPTO_NULL, 0u, 0u, 0u} 577 }, 578 579 /* 12G */ 580 { 581 NX_CRYPTO_EC_POINT_AFFINE, 582 { 583 (HN_UBASE *)&secp192r1_fixed_points_data[20], 584 24 >> HN_SIZE_SHIFT, 24, (UINT)NX_CRYPTO_FALSE 585 }, 586 { 587 (HN_UBASE *)&secp192r1_fixed_points_data[21], 588 24 >> HN_SIZE_SHIFT, 24, (UINT)NX_CRYPTO_FALSE 589 }, 590 {(HN_UBASE *)NX_CRYPTO_NULL, 0u, 0u, 0u} 591 }, 592 593 /* 13G */ 594 { 595 NX_CRYPTO_EC_POINT_AFFINE, 596 { 597 (HN_UBASE *)&secp192r1_fixed_points_data[22], 598 24 >> HN_SIZE_SHIFT, 24, (UINT)NX_CRYPTO_FALSE 599 }, 600 { 601 (HN_UBASE *)&secp192r1_fixed_points_data[23], 602 24 >> HN_SIZE_SHIFT, 24, (UINT)NX_CRYPTO_FALSE 603 }, 604 {(HN_UBASE *)NX_CRYPTO_NULL, 0u, 0u, 0u} 605 }, 606 607 /* 14G */ 608 { 609 NX_CRYPTO_EC_POINT_AFFINE, 610 { 611 (HN_UBASE *)&secp192r1_fixed_points_data[24], 612 24 >> HN_SIZE_SHIFT, 24, (UINT)NX_CRYPTO_FALSE 613 }, 614 { 615 (HN_UBASE *)&secp192r1_fixed_points_data[25], 616 24 >> HN_SIZE_SHIFT, 24, (UINT)NX_CRYPTO_FALSE 617 }, 618 {(HN_UBASE *)NX_CRYPTO_NULL, 0u, 0u, 0u} 619 }, 620 621 /* 15G */ 622 { 623 NX_CRYPTO_EC_POINT_AFFINE, 624 { 625 (HN_UBASE *)&secp192r1_fixed_points_data[26], 626 24 >> HN_SIZE_SHIFT, 24, (UINT)NX_CRYPTO_FALSE 627 }, 628 { 629 (HN_UBASE *)&secp192r1_fixed_points_data[27], 630 24 >> HN_SIZE_SHIFT, 24, (UINT)NX_CRYPTO_FALSE 631 }, 632 {(HN_UBASE *)NX_CRYPTO_NULL, 0u, 0u, 0u} 633 } 634 }; 635 static NX_CRYPTO_CONST NX_CRYPTO_EC_POINT secp192r1_fixed_points_2e_array[] = 636 { 637 638 /* 2^e * 1G */ 639 { 640 NX_CRYPTO_EC_POINT_AFFINE, 641 { 642 (HN_UBASE *)&secp192r1_fixed_points_2e_data[0], 643 24 >> HN_SIZE_SHIFT, 24, (UINT)NX_CRYPTO_FALSE 644 }, 645 { 646 (HN_UBASE *)&secp192r1_fixed_points_2e_data[1], 647 24 >> HN_SIZE_SHIFT, 24, (UINT)NX_CRYPTO_FALSE 648 }, 649 {(HN_UBASE *)NX_CRYPTO_NULL, 0u, 0u, 0u} 650 }, 651 652 /* 2^e * 2G */ 653 { 654 NX_CRYPTO_EC_POINT_AFFINE, 655 { 656 (HN_UBASE *)&secp192r1_fixed_points_2e_data[2], 657 24 >> HN_SIZE_SHIFT, 24, (UINT)NX_CRYPTO_FALSE 658 }, 659 { 660 (HN_UBASE *)&secp192r1_fixed_points_2e_data[3], 661 24 >> HN_SIZE_SHIFT, 24, (UINT)NX_CRYPTO_FALSE 662 }, 663 {(HN_UBASE *)NX_CRYPTO_NULL, 0u, 0u, 0u} 664 }, 665 666 /* 2^e * 3G */ 667 { 668 NX_CRYPTO_EC_POINT_AFFINE, 669 { 670 (HN_UBASE *)&secp192r1_fixed_points_2e_data[4], 671 24 >> HN_SIZE_SHIFT, 24, (UINT)NX_CRYPTO_FALSE 672 }, 673 { 674 (HN_UBASE *)&secp192r1_fixed_points_2e_data[5], 675 24 >> HN_SIZE_SHIFT, 24, (UINT)NX_CRYPTO_FALSE 676 }, 677 {(HN_UBASE *)NX_CRYPTO_NULL, 0u, 0u, 0u} 678 }, 679 680 /* 2^e * 4G */ 681 { 682 NX_CRYPTO_EC_POINT_AFFINE, 683 { 684 (HN_UBASE *)&secp192r1_fixed_points_2e_data[6], 685 24 >> HN_SIZE_SHIFT, 24, (UINT)NX_CRYPTO_FALSE 686 }, 687 { 688 (HN_UBASE *)&secp192r1_fixed_points_2e_data[7], 689 24 >> HN_SIZE_SHIFT, 24, (UINT)NX_CRYPTO_FALSE 690 }, 691 {(HN_UBASE *)NX_CRYPTO_NULL, 0u, 0u, 0u} 692 }, 693 694 /* 2^e * 5G */ 695 { 696 NX_CRYPTO_EC_POINT_AFFINE, 697 { 698 (HN_UBASE *)&secp192r1_fixed_points_2e_data[8], 699 24 >> HN_SIZE_SHIFT, 24, (UINT)NX_CRYPTO_FALSE 700 }, 701 { 702 (HN_UBASE *)&secp192r1_fixed_points_2e_data[9], 703 24 >> HN_SIZE_SHIFT, 24, (UINT)NX_CRYPTO_FALSE 704 }, 705 {(HN_UBASE *)NX_CRYPTO_NULL, 0u, 0u, 0u} 706 }, 707 708 /* 2^e * 6G */ 709 { 710 NX_CRYPTO_EC_POINT_AFFINE, 711 { 712 (HN_UBASE *)&secp192r1_fixed_points_2e_data[10], 713 24 >> HN_SIZE_SHIFT, 24, (UINT)NX_CRYPTO_FALSE 714 }, 715 { 716 (HN_UBASE *)&secp192r1_fixed_points_2e_data[11], 717 24 >> HN_SIZE_SHIFT, 24, (UINT)NX_CRYPTO_FALSE 718 }, 719 {(HN_UBASE *)NX_CRYPTO_NULL, 0u, 0u, 0u} 720 }, 721 722 /* 2^e * 7G */ 723 { 724 NX_CRYPTO_EC_POINT_AFFINE, 725 { 726 (HN_UBASE *)&secp192r1_fixed_points_2e_data[12], 727 24 >> HN_SIZE_SHIFT, 24, (UINT)NX_CRYPTO_FALSE 728 }, 729 { 730 (HN_UBASE *)&secp192r1_fixed_points_2e_data[13], 731 24 >> HN_SIZE_SHIFT, 24, (UINT)NX_CRYPTO_FALSE 732 }, 733 {(HN_UBASE *)NX_CRYPTO_NULL, 0u, 0u, 0u} 734 }, 735 736 /* 2^e * 8G */ 737 { 738 NX_CRYPTO_EC_POINT_AFFINE, 739 { 740 (HN_UBASE *)&secp192r1_fixed_points_2e_data[14], 741 24 >> HN_SIZE_SHIFT, 24, (UINT)NX_CRYPTO_FALSE 742 }, 743 { 744 (HN_UBASE *)&secp192r1_fixed_points_2e_data[15], 745 24 >> HN_SIZE_SHIFT, 24, (UINT)NX_CRYPTO_FALSE 746 }, 747 {(HN_UBASE *)NX_CRYPTO_NULL, 0u, 0u, 0u} 748 }, 749 750 /* 2^e * 9G */ 751 { 752 NX_CRYPTO_EC_POINT_AFFINE, 753 { 754 (HN_UBASE *)&secp192r1_fixed_points_2e_data[16], 755 24 >> HN_SIZE_SHIFT, 24, (UINT)NX_CRYPTO_FALSE 756 }, 757 { 758 (HN_UBASE *)&secp192r1_fixed_points_2e_data[17], 759 24 >> HN_SIZE_SHIFT, 24, (UINT)NX_CRYPTO_FALSE 760 }, 761 {(HN_UBASE *)NX_CRYPTO_NULL, 0u, 0u, 0u} 762 }, 763 764 /* 2^e * 10G */ 765 { 766 NX_CRYPTO_EC_POINT_AFFINE, 767 { 768 (HN_UBASE *)&secp192r1_fixed_points_2e_data[18], 769 24 >> HN_SIZE_SHIFT, 24, (UINT)NX_CRYPTO_FALSE 770 }, 771 { 772 (HN_UBASE *)&secp192r1_fixed_points_2e_data[19], 773 24 >> HN_SIZE_SHIFT, 24, (UINT)NX_CRYPTO_FALSE 774 }, 775 {(HN_UBASE *)NX_CRYPTO_NULL, 0u, 0u, 0u} 776 }, 777 778 /* 2^e * 11G */ 779 { 780 NX_CRYPTO_EC_POINT_AFFINE, 781 { 782 (HN_UBASE *)&secp192r1_fixed_points_2e_data[20], 783 24 >> HN_SIZE_SHIFT, 24, (UINT)NX_CRYPTO_FALSE 784 }, 785 { 786 (HN_UBASE *)&secp192r1_fixed_points_2e_data[21], 787 24 >> HN_SIZE_SHIFT, 24, (UINT)NX_CRYPTO_FALSE 788 }, 789 {(HN_UBASE *)NX_CRYPTO_NULL, 0u, 0u, 0u} 790 }, 791 792 /* 2^e * 12G */ 793 { 794 NX_CRYPTO_EC_POINT_AFFINE, 795 { 796 (HN_UBASE *)&secp192r1_fixed_points_2e_data[22], 797 24 >> HN_SIZE_SHIFT, 24, (UINT)NX_CRYPTO_FALSE 798 }, 799 { 800 (HN_UBASE *)&secp192r1_fixed_points_2e_data[23], 801 24 >> HN_SIZE_SHIFT, 24, (UINT)NX_CRYPTO_FALSE 802 }, 803 {(HN_UBASE *)NX_CRYPTO_NULL, 0u, 0u, 0u} 804 }, 805 806 /* 2^e * 13G */ 807 { 808 NX_CRYPTO_EC_POINT_AFFINE, 809 { 810 (HN_UBASE *)&secp192r1_fixed_points_2e_data[24], 811 24 >> HN_SIZE_SHIFT, 24, (UINT)NX_CRYPTO_FALSE 812 }, 813 { 814 (HN_UBASE *)&secp192r1_fixed_points_2e_data[25], 815 24 >> HN_SIZE_SHIFT, 24, (UINT)NX_CRYPTO_FALSE 816 }, 817 {(HN_UBASE *)NX_CRYPTO_NULL, 0u, 0u, 0u} 818 }, 819 820 /* 2^e * 14G */ 821 { 822 NX_CRYPTO_EC_POINT_AFFINE, 823 { 824 (HN_UBASE *)&secp192r1_fixed_points_2e_data[26], 825 24 >> HN_SIZE_SHIFT, 24, (UINT)NX_CRYPTO_FALSE 826 }, 827 { 828 (HN_UBASE *)&secp192r1_fixed_points_2e_data[27], 829 24 >> HN_SIZE_SHIFT, 24, (UINT)NX_CRYPTO_FALSE 830 }, 831 {(HN_UBASE *)NX_CRYPTO_NULL, 0u, 0u, 0u} 832 }, 833 834 /* 2^e * 15G */ 835 { 836 NX_CRYPTO_EC_POINT_AFFINE, 837 { 838 (HN_UBASE *)&secp192r1_fixed_points_2e_data[28], 839 24 >> HN_SIZE_SHIFT, 24, (UINT)NX_CRYPTO_FALSE 840 }, 841 { 842 (HN_UBASE *)&secp192r1_fixed_points_2e_data[29], 843 24 >> HN_SIZE_SHIFT, 24, (UINT)NX_CRYPTO_FALSE 844 }, 845 {(HN_UBASE *)NX_CRYPTO_NULL, 0u, 0u, 0u} 846 } 847 }; 848 849 850 NX_CRYPTO_CONST NX_CRYPTO_EC_FIXED_POINTS _nx_crypto_ec_secp192r1_fixed_points = 851 { 852 4u, 196u, 49u, 25u, 853 (NX_CRYPTO_EC_POINT *)secp192r1_fixed_points_array, 854 (NX_CRYPTO_EC_POINT *)secp192r1_fixed_points_2e_array 855 }; 856 857