ec_curve.c 138 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311
  1. /*
  2. * Copyright 2002-2019 The OpenSSL Project Authors. All Rights Reserved.
  3. * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved
  4. *
  5. * Licensed under the OpenSSL license (the "License"). You may not use
  6. * this file except in compliance with the License. You can obtain a copy
  7. * in the file LICENSE in the source distribution or at
  8. * https://www.openssl.org/source/license.html
  9. */
  10. #include <string.h>
  11. #include "ec_local.h"
  12. #include <openssl/err.h>
  13. #include <openssl/obj_mac.h>
  14. #include <openssl/opensslconf.h>
  15. #include "internal/nelem.h"
  16. typedef struct {
  17. int field_type, /* either NID_X9_62_prime_field or
  18. * NID_X9_62_characteristic_two_field */
  19. seed_len, param_len;
  20. unsigned int cofactor; /* promoted to BN_ULONG */
  21. } EC_CURVE_DATA;
  22. /* the nist prime curves */
  23. static const struct {
  24. EC_CURVE_DATA h;
  25. unsigned char data[20 + 24 * 6];
  26. } _EC_NIST_PRIME_192 = {
  27. {
  28. NID_X9_62_prime_field, 20, 24, 1
  29. },
  30. {
  31. /* seed */
  32. 0x30, 0x45, 0xAE, 0x6F, 0xC8, 0x42, 0x2F, 0x64, 0xED, 0x57, 0x95, 0x28,
  33. 0xD3, 0x81, 0x20, 0xEA, 0xE1, 0x21, 0x96, 0xD5,
  34. /* p */
  35. 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
  36. 0xFF, 0xFF, 0xFF, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
  37. /* a */
  38. 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
  39. 0xFF, 0xFF, 0xFF, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC,
  40. /* b */
  41. 0x64, 0x21, 0x05, 0x19, 0xE5, 0x9C, 0x80, 0xE7, 0x0F, 0xA7, 0xE9, 0xAB,
  42. 0x72, 0x24, 0x30, 0x49, 0xFE, 0xB8, 0xDE, 0xEC, 0xC1, 0x46, 0xB9, 0xB1,
  43. /* x */
  44. 0x18, 0x8D, 0xA8, 0x0E, 0xB0, 0x30, 0x90, 0xF6, 0x7C, 0xBF, 0x20, 0xEB,
  45. 0x43, 0xA1, 0x88, 0x00, 0xF4, 0xFF, 0x0A, 0xFD, 0x82, 0xFF, 0x10, 0x12,
  46. /* y */
  47. 0x07, 0x19, 0x2b, 0x95, 0xff, 0xc8, 0xda, 0x78, 0x63, 0x10, 0x11, 0xed,
  48. 0x6b, 0x24, 0xcd, 0xd5, 0x73, 0xf9, 0x77, 0xa1, 0x1e, 0x79, 0x48, 0x11,
  49. /* order */
  50. 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
  51. 0x99, 0xDE, 0xF8, 0x36, 0x14, 0x6B, 0xC9, 0xB1, 0xB4, 0xD2, 0x28, 0x31
  52. }
  53. };
  54. static const struct {
  55. EC_CURVE_DATA h;
  56. unsigned char data[20 + 28 * 6];
  57. } _EC_NIST_PRIME_224 = {
  58. {
  59. NID_X9_62_prime_field, 20, 28, 1
  60. },
  61. {
  62. /* seed */
  63. 0xBD, 0x71, 0x34, 0x47, 0x99, 0xD5, 0xC7, 0xFC, 0xDC, 0x45, 0xB5, 0x9F,
  64. 0xA3, 0xB9, 0xAB, 0x8F, 0x6A, 0x94, 0x8B, 0xC5,
  65. /* p */
  66. 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
  67. 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  68. 0x00, 0x00, 0x00, 0x01,
  69. /* a */
  70. 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
  71. 0xFF, 0xFF, 0xFF, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
  72. 0xFF, 0xFF, 0xFF, 0xFE,
  73. /* b */
  74. 0xB4, 0x05, 0x0A, 0x85, 0x0C, 0x04, 0xB3, 0xAB, 0xF5, 0x41, 0x32, 0x56,
  75. 0x50, 0x44, 0xB0, 0xB7, 0xD7, 0xBF, 0xD8, 0xBA, 0x27, 0x0B, 0x39, 0x43,
  76. 0x23, 0x55, 0xFF, 0xB4,
  77. /* x */
  78. 0xB7, 0x0E, 0x0C, 0xBD, 0x6B, 0xB4, 0xBF, 0x7F, 0x32, 0x13, 0x90, 0xB9,
  79. 0x4A, 0x03, 0xC1, 0xD3, 0x56, 0xC2, 0x11, 0x22, 0x34, 0x32, 0x80, 0xD6,
  80. 0x11, 0x5C, 0x1D, 0x21,
  81. /* y */
  82. 0xbd, 0x37, 0x63, 0x88, 0xb5, 0xf7, 0x23, 0xfb, 0x4c, 0x22, 0xdf, 0xe6,
  83. 0xcd, 0x43, 0x75, 0xa0, 0x5a, 0x07, 0x47, 0x64, 0x44, 0xd5, 0x81, 0x99,
  84. 0x85, 0x00, 0x7e, 0x34,
  85. /* order */
  86. 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
  87. 0xFF, 0xFF, 0x16, 0xA2, 0xE0, 0xB8, 0xF0, 0x3E, 0x13, 0xDD, 0x29, 0x45,
  88. 0x5C, 0x5C, 0x2A, 0x3D
  89. }
  90. };
  91. static const struct {
  92. EC_CURVE_DATA h;
  93. unsigned char data[20 + 48 * 6];
  94. } _EC_NIST_PRIME_384 = {
  95. {
  96. NID_X9_62_prime_field, 20, 48, 1
  97. },
  98. {
  99. /* seed */
  100. 0xA3, 0x35, 0x92, 0x6A, 0xA3, 0x19, 0xA2, 0x7A, 0x1D, 0x00, 0x89, 0x6A,
  101. 0x67, 0x73, 0xA4, 0x82, 0x7A, 0xCD, 0xAC, 0x73,
  102. /* p */
  103. 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
  104. 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
  105. 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF,
  106. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF,
  107. /* a */
  108. 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
  109. 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
  110. 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF,
  111. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFC,
  112. /* b */
  113. 0xB3, 0x31, 0x2F, 0xA7, 0xE2, 0x3E, 0xE7, 0xE4, 0x98, 0x8E, 0x05, 0x6B,
  114. 0xE3, 0xF8, 0x2D, 0x19, 0x18, 0x1D, 0x9C, 0x6E, 0xFE, 0x81, 0x41, 0x12,
  115. 0x03, 0x14, 0x08, 0x8F, 0x50, 0x13, 0x87, 0x5A, 0xC6, 0x56, 0x39, 0x8D,
  116. 0x8A, 0x2E, 0xD1, 0x9D, 0x2A, 0x85, 0xC8, 0xED, 0xD3, 0xEC, 0x2A, 0xEF,
  117. /* x */
  118. 0xAA, 0x87, 0xCA, 0x22, 0xBE, 0x8B, 0x05, 0x37, 0x8E, 0xB1, 0xC7, 0x1E,
  119. 0xF3, 0x20, 0xAD, 0x74, 0x6E, 0x1D, 0x3B, 0x62, 0x8B, 0xA7, 0x9B, 0x98,
  120. 0x59, 0xF7, 0x41, 0xE0, 0x82, 0x54, 0x2A, 0x38, 0x55, 0x02, 0xF2, 0x5D,
  121. 0xBF, 0x55, 0x29, 0x6C, 0x3A, 0x54, 0x5E, 0x38, 0x72, 0x76, 0x0A, 0xB7,
  122. /* y */
  123. 0x36, 0x17, 0xde, 0x4a, 0x96, 0x26, 0x2c, 0x6f, 0x5d, 0x9e, 0x98, 0xbf,
  124. 0x92, 0x92, 0xdc, 0x29, 0xf8, 0xf4, 0x1d, 0xbd, 0x28, 0x9a, 0x14, 0x7c,
  125. 0xe9, 0xda, 0x31, 0x13, 0xb5, 0xf0, 0xb8, 0xc0, 0x0a, 0x60, 0xb1, 0xce,
  126. 0x1d, 0x7e, 0x81, 0x9d, 0x7a, 0x43, 0x1d, 0x7c, 0x90, 0xea, 0x0e, 0x5f,
  127. /* order */
  128. 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
  129. 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
  130. 0xC7, 0x63, 0x4D, 0x81, 0xF4, 0x37, 0x2D, 0xDF, 0x58, 0x1A, 0x0D, 0xB2,
  131. 0x48, 0xB0, 0xA7, 0x7A, 0xEC, 0xEC, 0x19, 0x6A, 0xCC, 0xC5, 0x29, 0x73
  132. }
  133. };
  134. static const struct {
  135. EC_CURVE_DATA h;
  136. unsigned char data[20 + 66 * 6];
  137. } _EC_NIST_PRIME_521 = {
  138. {
  139. NID_X9_62_prime_field, 20, 66, 1
  140. },
  141. {
  142. /* seed */
  143. 0xD0, 0x9E, 0x88, 0x00, 0x29, 0x1C, 0xB8, 0x53, 0x96, 0xCC, 0x67, 0x17,
  144. 0x39, 0x32, 0x84, 0xAA, 0xA0, 0xDA, 0x64, 0xBA,
  145. /* p */
  146. 0x01, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
  147. 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
  148. 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
  149. 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
  150. 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
  151. 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
  152. /* a */
  153. 0x01, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
  154. 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
  155. 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
  156. 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
  157. 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
  158. 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC,
  159. /* b */
  160. 0x00, 0x51, 0x95, 0x3E, 0xB9, 0x61, 0x8E, 0x1C, 0x9A, 0x1F, 0x92, 0x9A,
  161. 0x21, 0xA0, 0xB6, 0x85, 0x40, 0xEE, 0xA2, 0xDA, 0x72, 0x5B, 0x99, 0xB3,
  162. 0x15, 0xF3, 0xB8, 0xB4, 0x89, 0x91, 0x8E, 0xF1, 0x09, 0xE1, 0x56, 0x19,
  163. 0x39, 0x51, 0xEC, 0x7E, 0x93, 0x7B, 0x16, 0x52, 0xC0, 0xBD, 0x3B, 0xB1,
  164. 0xBF, 0x07, 0x35, 0x73, 0xDF, 0x88, 0x3D, 0x2C, 0x34, 0xF1, 0xEF, 0x45,
  165. 0x1F, 0xD4, 0x6B, 0x50, 0x3F, 0x00,
  166. /* x */
  167. 0x00, 0xC6, 0x85, 0x8E, 0x06, 0xB7, 0x04, 0x04, 0xE9, 0xCD, 0x9E, 0x3E,
  168. 0xCB, 0x66, 0x23, 0x95, 0xB4, 0x42, 0x9C, 0x64, 0x81, 0x39, 0x05, 0x3F,
  169. 0xB5, 0x21, 0xF8, 0x28, 0xAF, 0x60, 0x6B, 0x4D, 0x3D, 0xBA, 0xA1, 0x4B,
  170. 0x5E, 0x77, 0xEF, 0xE7, 0x59, 0x28, 0xFE, 0x1D, 0xC1, 0x27, 0xA2, 0xFF,
  171. 0xA8, 0xDE, 0x33, 0x48, 0xB3, 0xC1, 0x85, 0x6A, 0x42, 0x9B, 0xF9, 0x7E,
  172. 0x7E, 0x31, 0xC2, 0xE5, 0xBD, 0x66,
  173. /* y */
  174. 0x01, 0x18, 0x39, 0x29, 0x6a, 0x78, 0x9a, 0x3b, 0xc0, 0x04, 0x5c, 0x8a,
  175. 0x5f, 0xb4, 0x2c, 0x7d, 0x1b, 0xd9, 0x98, 0xf5, 0x44, 0x49, 0x57, 0x9b,
  176. 0x44, 0x68, 0x17, 0xaf, 0xbd, 0x17, 0x27, 0x3e, 0x66, 0x2c, 0x97, 0xee,
  177. 0x72, 0x99, 0x5e, 0xf4, 0x26, 0x40, 0xc5, 0x50, 0xb9, 0x01, 0x3f, 0xad,
  178. 0x07, 0x61, 0x35, 0x3c, 0x70, 0x86, 0xa2, 0x72, 0xc2, 0x40, 0x88, 0xbe,
  179. 0x94, 0x76, 0x9f, 0xd1, 0x66, 0x50,
  180. /* order */
  181. 0x01, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
  182. 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
  183. 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFA, 0x51, 0x86,
  184. 0x87, 0x83, 0xBF, 0x2F, 0x96, 0x6B, 0x7F, 0xCC, 0x01, 0x48, 0xF7, 0x09,
  185. 0xA5, 0xD0, 0x3B, 0xB5, 0xC9, 0xB8, 0x89, 0x9C, 0x47, 0xAE, 0xBB, 0x6F,
  186. 0xB7, 0x1E, 0x91, 0x38, 0x64, 0x09
  187. }
  188. };
  189. /* the x9.62 prime curves (minus the nist prime curves) */
  190. static const struct {
  191. EC_CURVE_DATA h;
  192. unsigned char data[20 + 24 * 6];
  193. } _EC_X9_62_PRIME_192V2 = {
  194. {
  195. NID_X9_62_prime_field, 20, 24, 1
  196. },
  197. {
  198. /* seed */
  199. 0x31, 0xA9, 0x2E, 0xE2, 0x02, 0x9F, 0xD1, 0x0D, 0x90, 0x1B, 0x11, 0x3E,
  200. 0x99, 0x07, 0x10, 0xF0, 0xD2, 0x1A, 0xC6, 0xB6,
  201. /* p */
  202. 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
  203. 0xFF, 0xFF, 0xFF, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
  204. /* a */
  205. 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
  206. 0xFF, 0xFF, 0xFF, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC,
  207. /* b */
  208. 0xCC, 0x22, 0xD6, 0xDF, 0xB9, 0x5C, 0x6B, 0x25, 0xE4, 0x9C, 0x0D, 0x63,
  209. 0x64, 0xA4, 0xE5, 0x98, 0x0C, 0x39, 0x3A, 0xA2, 0x16, 0x68, 0xD9, 0x53,
  210. /* x */
  211. 0xEE, 0xA2, 0xBA, 0xE7, 0xE1, 0x49, 0x78, 0x42, 0xF2, 0xDE, 0x77, 0x69,
  212. 0xCF, 0xE9, 0xC9, 0x89, 0xC0, 0x72, 0xAD, 0x69, 0x6F, 0x48, 0x03, 0x4A,
  213. /* y */
  214. 0x65, 0x74, 0xd1, 0x1d, 0x69, 0xb6, 0xec, 0x7a, 0x67, 0x2b, 0xb8, 0x2a,
  215. 0x08, 0x3d, 0xf2, 0xf2, 0xb0, 0x84, 0x7d, 0xe9, 0x70, 0xb2, 0xde, 0x15,
  216. /* order */
  217. 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE,
  218. 0x5F, 0xB1, 0xA7, 0x24, 0xDC, 0x80, 0x41, 0x86, 0x48, 0xD8, 0xDD, 0x31
  219. }
  220. };
  221. static const struct {
  222. EC_CURVE_DATA h;
  223. unsigned char data[20 + 24 * 6];
  224. } _EC_X9_62_PRIME_192V3 = {
  225. {
  226. NID_X9_62_prime_field, 20, 24, 1
  227. },
  228. {
  229. /* seed */
  230. 0xC4, 0x69, 0x68, 0x44, 0x35, 0xDE, 0xB3, 0x78, 0xC4, 0xB6, 0x5C, 0xA9,
  231. 0x59, 0x1E, 0x2A, 0x57, 0x63, 0x05, 0x9A, 0x2E,
  232. /* p */
  233. 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
  234. 0xFF, 0xFF, 0xFF, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
  235. /* a */
  236. 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
  237. 0xFF, 0xFF, 0xFF, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC,
  238. /* b */
  239. 0x22, 0x12, 0x3D, 0xC2, 0x39, 0x5A, 0x05, 0xCA, 0xA7, 0x42, 0x3D, 0xAE,
  240. 0xCC, 0xC9, 0x47, 0x60, 0xA7, 0xD4, 0x62, 0x25, 0x6B, 0xD5, 0x69, 0x16,
  241. /* x */
  242. 0x7D, 0x29, 0x77, 0x81, 0x00, 0xC6, 0x5A, 0x1D, 0xA1, 0x78, 0x37, 0x16,
  243. 0x58, 0x8D, 0xCE, 0x2B, 0x8B, 0x4A, 0xEE, 0x8E, 0x22, 0x8F, 0x18, 0x96,
  244. /* y */
  245. 0x38, 0xa9, 0x0f, 0x22, 0x63, 0x73, 0x37, 0x33, 0x4b, 0x49, 0xdc, 0xb6,
  246. 0x6a, 0x6d, 0xc8, 0xf9, 0x97, 0x8a, 0xca, 0x76, 0x48, 0xa9, 0x43, 0xb0,
  247. /* order */
  248. 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
  249. 0x7A, 0x62, 0xD0, 0x31, 0xC8, 0x3F, 0x42, 0x94, 0xF6, 0x40, 0xEC, 0x13
  250. }
  251. };
  252. static const struct {
  253. EC_CURVE_DATA h;
  254. unsigned char data[20 + 30 * 6];
  255. } _EC_X9_62_PRIME_239V1 = {
  256. {
  257. NID_X9_62_prime_field, 20, 30, 1
  258. },
  259. {
  260. /* seed */
  261. 0xE4, 0x3B, 0xB4, 0x60, 0xF0, 0xB8, 0x0C, 0xC0, 0xC0, 0xB0, 0x75, 0x79,
  262. 0x8E, 0x94, 0x80, 0x60, 0xF8, 0x32, 0x1B, 0x7D,
  263. /* p */
  264. 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
  265. 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00,
  266. 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
  267. /* a */
  268. 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
  269. 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00,
  270. 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC,
  271. /* b */
  272. 0x6B, 0x01, 0x6C, 0x3B, 0xDC, 0xF1, 0x89, 0x41, 0xD0, 0xD6, 0x54, 0x92,
  273. 0x14, 0x75, 0xCA, 0x71, 0xA9, 0xDB, 0x2F, 0xB2, 0x7D, 0x1D, 0x37, 0x79,
  274. 0x61, 0x85, 0xC2, 0x94, 0x2C, 0x0A,
  275. /* x */
  276. 0x0F, 0xFA, 0x96, 0x3C, 0xDC, 0xA8, 0x81, 0x6C, 0xCC, 0x33, 0xB8, 0x64,
  277. 0x2B, 0xED, 0xF9, 0x05, 0xC3, 0xD3, 0x58, 0x57, 0x3D, 0x3F, 0x27, 0xFB,
  278. 0xBD, 0x3B, 0x3C, 0xB9, 0xAA, 0xAF,
  279. /* y */
  280. 0x7d, 0xeb, 0xe8, 0xe4, 0xe9, 0x0a, 0x5d, 0xae, 0x6e, 0x40, 0x54, 0xca,
  281. 0x53, 0x0b, 0xa0, 0x46, 0x54, 0xb3, 0x68, 0x18, 0xce, 0x22, 0x6b, 0x39,
  282. 0xfc, 0xcb, 0x7b, 0x02, 0xf1, 0xae,
  283. /* order */
  284. 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
  285. 0x7F, 0xFF, 0xFF, 0x9E, 0x5E, 0x9A, 0x9F, 0x5D, 0x90, 0x71, 0xFB, 0xD1,
  286. 0x52, 0x26, 0x88, 0x90, 0x9D, 0x0B
  287. }
  288. };
  289. static const struct {
  290. EC_CURVE_DATA h;
  291. unsigned char data[20 + 30 * 6];
  292. } _EC_X9_62_PRIME_239V2 = {
  293. {
  294. NID_X9_62_prime_field, 20, 30, 1
  295. },
  296. {
  297. /* seed */
  298. 0xE8, 0xB4, 0x01, 0x16, 0x04, 0x09, 0x53, 0x03, 0xCA, 0x3B, 0x80, 0x99,
  299. 0x98, 0x2B, 0xE0, 0x9F, 0xCB, 0x9A, 0xE6, 0x16,
  300. /* p */
  301. 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
  302. 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00,
  303. 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
  304. /* a */
  305. 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
  306. 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00,
  307. 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC,
  308. /* b */
  309. 0x61, 0x7F, 0xAB, 0x68, 0x32, 0x57, 0x6C, 0xBB, 0xFE, 0xD5, 0x0D, 0x99,
  310. 0xF0, 0x24, 0x9C, 0x3F, 0xEE, 0x58, 0xB9, 0x4B, 0xA0, 0x03, 0x8C, 0x7A,
  311. 0xE8, 0x4C, 0x8C, 0x83, 0x2F, 0x2C,
  312. /* x */
  313. 0x38, 0xAF, 0x09, 0xD9, 0x87, 0x27, 0x70, 0x51, 0x20, 0xC9, 0x21, 0xBB,
  314. 0x5E, 0x9E, 0x26, 0x29, 0x6A, 0x3C, 0xDC, 0xF2, 0xF3, 0x57, 0x57, 0xA0,
  315. 0xEA, 0xFD, 0x87, 0xB8, 0x30, 0xE7,
  316. /* y */
  317. 0x5b, 0x01, 0x25, 0xe4, 0xdb, 0xea, 0x0e, 0xc7, 0x20, 0x6d, 0xa0, 0xfc,
  318. 0x01, 0xd9, 0xb0, 0x81, 0x32, 0x9f, 0xb5, 0x55, 0xde, 0x6e, 0xf4, 0x60,
  319. 0x23, 0x7d, 0xff, 0x8b, 0xe4, 0xba,
  320. /* order */
  321. 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
  322. 0x80, 0x00, 0x00, 0xCF, 0xA7, 0xE8, 0x59, 0x43, 0x77, 0xD4, 0x14, 0xC0,
  323. 0x38, 0x21, 0xBC, 0x58, 0x20, 0x63
  324. }
  325. };
  326. static const struct {
  327. EC_CURVE_DATA h;
  328. unsigned char data[20 + 30 * 6];
  329. } _EC_X9_62_PRIME_239V3 = {
  330. {
  331. NID_X9_62_prime_field, 20, 30, 1
  332. },
  333. {
  334. /* seed */
  335. 0x7D, 0x73, 0x74, 0x16, 0x8F, 0xFE, 0x34, 0x71, 0xB6, 0x0A, 0x85, 0x76,
  336. 0x86, 0xA1, 0x94, 0x75, 0xD3, 0xBF, 0xA2, 0xFF,
  337. /* p */
  338. 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
  339. 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00,
  340. 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
  341. /* a */
  342. 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
  343. 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00,
  344. 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC,
  345. /* b */
  346. 0x25, 0x57, 0x05, 0xFA, 0x2A, 0x30, 0x66, 0x54, 0xB1, 0xF4, 0xCB, 0x03,
  347. 0xD6, 0xA7, 0x50, 0xA3, 0x0C, 0x25, 0x01, 0x02, 0xD4, 0x98, 0x87, 0x17,
  348. 0xD9, 0xBA, 0x15, 0xAB, 0x6D, 0x3E,
  349. /* x */
  350. 0x67, 0x68, 0xAE, 0x8E, 0x18, 0xBB, 0x92, 0xCF, 0xCF, 0x00, 0x5C, 0x94,
  351. 0x9A, 0xA2, 0xC6, 0xD9, 0x48, 0x53, 0xD0, 0xE6, 0x60, 0xBB, 0xF8, 0x54,
  352. 0xB1, 0xC9, 0x50, 0x5F, 0xE9, 0x5A,
  353. /* y */
  354. 0x16, 0x07, 0xe6, 0x89, 0x8f, 0x39, 0x0c, 0x06, 0xbc, 0x1d, 0x55, 0x2b,
  355. 0xad, 0x22, 0x6f, 0x3b, 0x6f, 0xcf, 0xe4, 0x8b, 0x6e, 0x81, 0x84, 0x99,
  356. 0xaf, 0x18, 0xe3, 0xed, 0x6c, 0xf3,
  357. /* order */
  358. 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
  359. 0x7F, 0xFF, 0xFF, 0x97, 0x5D, 0xEB, 0x41, 0xB3, 0xA6, 0x05, 0x7C, 0x3C,
  360. 0x43, 0x21, 0x46, 0x52, 0x65, 0x51
  361. }
  362. };
  363. static const struct {
  364. EC_CURVE_DATA h;
  365. unsigned char data[20 + 32 * 6];
  366. } _EC_X9_62_PRIME_256V1 = {
  367. {
  368. NID_X9_62_prime_field, 20, 32, 1
  369. },
  370. {
  371. /* seed */
  372. 0xC4, 0x9D, 0x36, 0x08, 0x86, 0xE7, 0x04, 0x93, 0x6A, 0x66, 0x78, 0xE1,
  373. 0x13, 0x9D, 0x26, 0xB7, 0x81, 0x9F, 0x7E, 0x90,
  374. /* p */
  375. 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
  376. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF,
  377. 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
  378. /* a */
  379. 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
  380. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF,
  381. 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC,
  382. /* b */
  383. 0x5A, 0xC6, 0x35, 0xD8, 0xAA, 0x3A, 0x93, 0xE7, 0xB3, 0xEB, 0xBD, 0x55,
  384. 0x76, 0x98, 0x86, 0xBC, 0x65, 0x1D, 0x06, 0xB0, 0xCC, 0x53, 0xB0, 0xF6,
  385. 0x3B, 0xCE, 0x3C, 0x3E, 0x27, 0xD2, 0x60, 0x4B,
  386. /* x */
  387. 0x6B, 0x17, 0xD1, 0xF2, 0xE1, 0x2C, 0x42, 0x47, 0xF8, 0xBC, 0xE6, 0xE5,
  388. 0x63, 0xA4, 0x40, 0xF2, 0x77, 0x03, 0x7D, 0x81, 0x2D, 0xEB, 0x33, 0xA0,
  389. 0xF4, 0xA1, 0x39, 0x45, 0xD8, 0x98, 0xC2, 0x96,
  390. /* y */
  391. 0x4f, 0xe3, 0x42, 0xe2, 0xfe, 0x1a, 0x7f, 0x9b, 0x8e, 0xe7, 0xeb, 0x4a,
  392. 0x7c, 0x0f, 0x9e, 0x16, 0x2b, 0xce, 0x33, 0x57, 0x6b, 0x31, 0x5e, 0xce,
  393. 0xcb, 0xb6, 0x40, 0x68, 0x37, 0xbf, 0x51, 0xf5,
  394. /* order */
  395. 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF,
  396. 0xFF, 0xFF, 0xFF, 0xFF, 0xBC, 0xE6, 0xFA, 0xAD, 0xA7, 0x17, 0x9E, 0x84,
  397. 0xF3, 0xB9, 0xCA, 0xC2, 0xFC, 0x63, 0x25, 0x51
  398. }
  399. };
  400. /* the secg prime curves (minus the nist and x9.62 prime curves) */
  401. static const struct {
  402. EC_CURVE_DATA h;
  403. unsigned char data[20 + 14 * 6];
  404. } _EC_SECG_PRIME_112R1 = {
  405. {
  406. NID_X9_62_prime_field, 20, 14, 1
  407. },
  408. {
  409. /* seed */
  410. 0x00, 0xF5, 0x0B, 0x02, 0x8E, 0x4D, 0x69, 0x6E, 0x67, 0x68, 0x75, 0x61,
  411. 0x51, 0x75, 0x29, 0x04, 0x72, 0x78, 0x3F, 0xB1,
  412. /* p */
  413. 0xDB, 0x7C, 0x2A, 0xBF, 0x62, 0xE3, 0x5E, 0x66, 0x80, 0x76, 0xBE, 0xAD,
  414. 0x20, 0x8B,
  415. /* a */
  416. 0xDB, 0x7C, 0x2A, 0xBF, 0x62, 0xE3, 0x5E, 0x66, 0x80, 0x76, 0xBE, 0xAD,
  417. 0x20, 0x88,
  418. /* b */
  419. 0x65, 0x9E, 0xF8, 0xBA, 0x04, 0x39, 0x16, 0xEE, 0xDE, 0x89, 0x11, 0x70,
  420. 0x2B, 0x22,
  421. /* x */
  422. 0x09, 0x48, 0x72, 0x39, 0x99, 0x5A, 0x5E, 0xE7, 0x6B, 0x55, 0xF9, 0xC2,
  423. 0xF0, 0x98,
  424. /* y */
  425. 0xa8, 0x9c, 0xe5, 0xaf, 0x87, 0x24, 0xc0, 0xa2, 0x3e, 0x0e, 0x0f, 0xf7,
  426. 0x75, 0x00,
  427. /* order */
  428. 0xDB, 0x7C, 0x2A, 0xBF, 0x62, 0xE3, 0x5E, 0x76, 0x28, 0xDF, 0xAC, 0x65,
  429. 0x61, 0xC5
  430. }
  431. };
  432. static const struct {
  433. EC_CURVE_DATA h;
  434. unsigned char data[20 + 14 * 6];
  435. } _EC_SECG_PRIME_112R2 = {
  436. {
  437. NID_X9_62_prime_field, 20, 14, 4
  438. },
  439. {
  440. /* seed */
  441. 0x00, 0x27, 0x57, 0xA1, 0x11, 0x4D, 0x69, 0x6E, 0x67, 0x68, 0x75, 0x61,
  442. 0x51, 0x75, 0x53, 0x16, 0xC0, 0x5E, 0x0B, 0xD4,
  443. /* p */
  444. 0xDB, 0x7C, 0x2A, 0xBF, 0x62, 0xE3, 0x5E, 0x66, 0x80, 0x76, 0xBE, 0xAD,
  445. 0x20, 0x8B,
  446. /* a */
  447. 0x61, 0x27, 0xC2, 0x4C, 0x05, 0xF3, 0x8A, 0x0A, 0xAA, 0xF6, 0x5C, 0x0E,
  448. 0xF0, 0x2C,
  449. /* b */
  450. 0x51, 0xDE, 0xF1, 0x81, 0x5D, 0xB5, 0xED, 0x74, 0xFC, 0xC3, 0x4C, 0x85,
  451. 0xD7, 0x09,
  452. /* x */
  453. 0x4B, 0xA3, 0x0A, 0xB5, 0xE8, 0x92, 0xB4, 0xE1, 0x64, 0x9D, 0xD0, 0x92,
  454. 0x86, 0x43,
  455. /* y */
  456. 0xad, 0xcd, 0x46, 0xf5, 0x88, 0x2e, 0x37, 0x47, 0xde, 0xf3, 0x6e, 0x95,
  457. 0x6e, 0x97,
  458. /* order */
  459. 0x36, 0xDF, 0x0A, 0xAF, 0xD8, 0xB8, 0xD7, 0x59, 0x7C, 0xA1, 0x05, 0x20,
  460. 0xD0, 0x4B
  461. }
  462. };
  463. static const struct {
  464. EC_CURVE_DATA h;
  465. unsigned char data[20 + 16 * 6];
  466. } _EC_SECG_PRIME_128R1 = {
  467. {
  468. NID_X9_62_prime_field, 20, 16, 1
  469. },
  470. {
  471. /* seed */
  472. 0x00, 0x0E, 0x0D, 0x4D, 0x69, 0x6E, 0x67, 0x68, 0x75, 0x61, 0x51, 0x75,
  473. 0x0C, 0xC0, 0x3A, 0x44, 0x73, 0xD0, 0x36, 0x79,
  474. /* p */
  475. 0xFF, 0xFF, 0xFF, 0xFD, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
  476. 0xFF, 0xFF, 0xFF, 0xFF,
  477. /* a */
  478. 0xFF, 0xFF, 0xFF, 0xFD, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
  479. 0xFF, 0xFF, 0xFF, 0xFC,
  480. /* b */
  481. 0xE8, 0x75, 0x79, 0xC1, 0x10, 0x79, 0xF4, 0x3D, 0xD8, 0x24, 0x99, 0x3C,
  482. 0x2C, 0xEE, 0x5E, 0xD3,
  483. /* x */
  484. 0x16, 0x1F, 0xF7, 0x52, 0x8B, 0x89, 0x9B, 0x2D, 0x0C, 0x28, 0x60, 0x7C,
  485. 0xA5, 0x2C, 0x5B, 0x86,
  486. /* y */
  487. 0xcf, 0x5a, 0xc8, 0x39, 0x5b, 0xaf, 0xeb, 0x13, 0xc0, 0x2d, 0xa2, 0x92,
  488. 0xdd, 0xed, 0x7a, 0x83,
  489. /* order */
  490. 0xFF, 0xFF, 0xFF, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x75, 0xA3, 0x0D, 0x1B,
  491. 0x90, 0x38, 0xA1, 0x15
  492. }
  493. };
  494. static const struct {
  495. EC_CURVE_DATA h;
  496. unsigned char data[20 + 16 * 6];
  497. } _EC_SECG_PRIME_128R2 = {
  498. {
  499. NID_X9_62_prime_field, 20, 16, 4
  500. },
  501. {
  502. /* seed */
  503. 0x00, 0x4D, 0x69, 0x6E, 0x67, 0x68, 0x75, 0x61, 0x51, 0x75, 0x12, 0xD8,
  504. 0xF0, 0x34, 0x31, 0xFC, 0xE6, 0x3B, 0x88, 0xF4,
  505. /* p */
  506. 0xFF, 0xFF, 0xFF, 0xFD, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
  507. 0xFF, 0xFF, 0xFF, 0xFF,
  508. /* a */
  509. 0xD6, 0x03, 0x19, 0x98, 0xD1, 0xB3, 0xBB, 0xFE, 0xBF, 0x59, 0xCC, 0x9B,
  510. 0xBF, 0xF9, 0xAE, 0xE1,
  511. /* b */
  512. 0x5E, 0xEE, 0xFC, 0xA3, 0x80, 0xD0, 0x29, 0x19, 0xDC, 0x2C, 0x65, 0x58,
  513. 0xBB, 0x6D, 0x8A, 0x5D,
  514. /* x */
  515. 0x7B, 0x6A, 0xA5, 0xD8, 0x5E, 0x57, 0x29, 0x83, 0xE6, 0xFB, 0x32, 0xA7,
  516. 0xCD, 0xEB, 0xC1, 0x40,
  517. /* y */
  518. 0x27, 0xb6, 0x91, 0x6a, 0x89, 0x4d, 0x3a, 0xee, 0x71, 0x06, 0xfe, 0x80,
  519. 0x5f, 0xc3, 0x4b, 0x44,
  520. /* order */
  521. 0x3F, 0xFF, 0xFF, 0xFF, 0x7F, 0xFF, 0xFF, 0xFF, 0xBE, 0x00, 0x24, 0x72,
  522. 0x06, 0x13, 0xB5, 0xA3
  523. }
  524. };
  525. static const struct {
  526. EC_CURVE_DATA h;
  527. unsigned char data[0 + 21 * 6];
  528. } _EC_SECG_PRIME_160K1 = {
  529. {
  530. NID_X9_62_prime_field, 0, 21, 1
  531. },
  532. {
  533. /* no seed */
  534. /* p */
  535. 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
  536. 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0xFF, 0xFF, 0xAC, 0x73,
  537. /* a */
  538. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  539. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  540. /* b */
  541. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  542. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07,
  543. /* x */
  544. 0x00, 0x3B, 0x4C, 0x38, 0x2C, 0xE3, 0x7A, 0xA1, 0x92, 0xA4, 0x01, 0x9E,
  545. 0x76, 0x30, 0x36, 0xF4, 0xF5, 0xDD, 0x4D, 0x7E, 0xBB,
  546. /* y */
  547. 0x00, 0x93, 0x8c, 0xf9, 0x35, 0x31, 0x8f, 0xdc, 0xed, 0x6b, 0xc2, 0x82,
  548. 0x86, 0x53, 0x17, 0x33, 0xc3, 0xf0, 0x3c, 0x4f, 0xee,
  549. /* order */
  550. 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xB8,
  551. 0xFA, 0x16, 0xDF, 0xAB, 0x9A, 0xCA, 0x16, 0xB6, 0xB3
  552. }
  553. };
  554. static const struct {
  555. EC_CURVE_DATA h;
  556. unsigned char data[20 + 21 * 6];
  557. } _EC_SECG_PRIME_160R1 = {
  558. {
  559. NID_X9_62_prime_field, 20, 21, 1
  560. },
  561. {
  562. /* seed */
  563. 0x10, 0x53, 0xCD, 0xE4, 0x2C, 0x14, 0xD6, 0x96, 0xE6, 0x76, 0x87, 0x56,
  564. 0x15, 0x17, 0x53, 0x3B, 0xF3, 0xF8, 0x33, 0x45,
  565. /* p */
  566. 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
  567. 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F, 0xFF, 0xFF, 0xFF,
  568. /* a */
  569. 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
  570. 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F, 0xFF, 0xFF, 0xFC,
  571. /* b */
  572. 0x00, 0x1C, 0x97, 0xBE, 0xFC, 0x54, 0xBD, 0x7A, 0x8B, 0x65, 0xAC, 0xF8,
  573. 0x9F, 0x81, 0xD4, 0xD4, 0xAD, 0xC5, 0x65, 0xFA, 0x45,
  574. /* x */
  575. 0x00, 0x4A, 0x96, 0xB5, 0x68, 0x8E, 0xF5, 0x73, 0x28, 0x46, 0x64, 0x69,
  576. 0x89, 0x68, 0xC3, 0x8B, 0xB9, 0x13, 0xCB, 0xFC, 0x82,
  577. /* y */
  578. 0x00, 0x23, 0xa6, 0x28, 0x55, 0x31, 0x68, 0x94, 0x7d, 0x59, 0xdc, 0xc9,
  579. 0x12, 0x04, 0x23, 0x51, 0x37, 0x7a, 0xc5, 0xfb, 0x32,
  580. /* order */
  581. 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xF4,
  582. 0xC8, 0xF9, 0x27, 0xAE, 0xD3, 0xCA, 0x75, 0x22, 0x57
  583. }
  584. };
  585. static const struct {
  586. EC_CURVE_DATA h;
  587. unsigned char data[20 + 21 * 6];
  588. } _EC_SECG_PRIME_160R2 = {
  589. {
  590. NID_X9_62_prime_field, 20, 21, 1
  591. },
  592. {
  593. /* seed */
  594. 0xB9, 0x9B, 0x99, 0xB0, 0x99, 0xB3, 0x23, 0xE0, 0x27, 0x09, 0xA4, 0xD6,
  595. 0x96, 0xE6, 0x76, 0x87, 0x56, 0x15, 0x17, 0x51,
  596. /* p */
  597. 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
  598. 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0xFF, 0xFF, 0xAC, 0x73,
  599. /* a */
  600. 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
  601. 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0xFF, 0xFF, 0xAC, 0x70,
  602. /* b */
  603. 0x00, 0xB4, 0xE1, 0x34, 0xD3, 0xFB, 0x59, 0xEB, 0x8B, 0xAB, 0x57, 0x27,
  604. 0x49, 0x04, 0x66, 0x4D, 0x5A, 0xF5, 0x03, 0x88, 0xBA,
  605. /* x */
  606. 0x00, 0x52, 0xDC, 0xB0, 0x34, 0x29, 0x3A, 0x11, 0x7E, 0x1F, 0x4F, 0xF1,
  607. 0x1B, 0x30, 0xF7, 0x19, 0x9D, 0x31, 0x44, 0xCE, 0x6D,
  608. /* y */
  609. 0x00, 0xfe, 0xaf, 0xfe, 0xf2, 0xe3, 0x31, 0xf2, 0x96, 0xe0, 0x71, 0xfa,
  610. 0x0d, 0xf9, 0x98, 0x2c, 0xfe, 0xa7, 0xd4, 0x3f, 0x2e,
  611. /* order */
  612. 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x35,
  613. 0x1E, 0xE7, 0x86, 0xA8, 0x18, 0xF3, 0xA1, 0xA1, 0x6B
  614. }
  615. };
  616. static const struct {
  617. EC_CURVE_DATA h;
  618. unsigned char data[0 + 24 * 6];
  619. } _EC_SECG_PRIME_192K1 = {
  620. {
  621. NID_X9_62_prime_field, 0, 24, 1
  622. },
  623. {
  624. /* no seed */
  625. /* p */
  626. 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
  627. 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0xFF, 0xFF, 0xEE, 0x37,
  628. /* a */
  629. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  630. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  631. /* b */
  632. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  633. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03,
  634. /* x */
  635. 0xDB, 0x4F, 0xF1, 0x0E, 0xC0, 0x57, 0xE9, 0xAE, 0x26, 0xB0, 0x7D, 0x02,
  636. 0x80, 0xB7, 0xF4, 0x34, 0x1D, 0xA5, 0xD1, 0xB1, 0xEA, 0xE0, 0x6C, 0x7D,
  637. /* y */
  638. 0x9b, 0x2f, 0x2f, 0x6d, 0x9c, 0x56, 0x28, 0xa7, 0x84, 0x41, 0x63, 0xd0,
  639. 0x15, 0xbe, 0x86, 0x34, 0x40, 0x82, 0xaa, 0x88, 0xd9, 0x5e, 0x2f, 0x9d,
  640. /* order */
  641. 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE,
  642. 0x26, 0xF2, 0xFC, 0x17, 0x0F, 0x69, 0x46, 0x6A, 0x74, 0xDE, 0xFD, 0x8D
  643. }
  644. };
  645. static const struct {
  646. EC_CURVE_DATA h;
  647. unsigned char data[0 + 29 * 6];
  648. } _EC_SECG_PRIME_224K1 = {
  649. {
  650. NID_X9_62_prime_field, 0, 29, 1
  651. },
  652. {
  653. /* no seed */
  654. /* p */
  655. 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
  656. 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
  657. 0xFE, 0xFF, 0xFF, 0xE5, 0x6D,
  658. /* a */
  659. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  660. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  661. 0x00, 0x00, 0x00, 0x00, 0x00,
  662. /* b */
  663. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  664. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  665. 0x00, 0x00, 0x00, 0x00, 0x05,
  666. /* x */
  667. 0x00, 0xA1, 0x45, 0x5B, 0x33, 0x4D, 0xF0, 0x99, 0xDF, 0x30, 0xFC, 0x28,
  668. 0xA1, 0x69, 0xA4, 0x67, 0xE9, 0xE4, 0x70, 0x75, 0xA9, 0x0F, 0x7E, 0x65,
  669. 0x0E, 0xB6, 0xB7, 0xA4, 0x5C,
  670. /* y */
  671. 0x00, 0x7e, 0x08, 0x9f, 0xed, 0x7f, 0xba, 0x34, 0x42, 0x82, 0xca, 0xfb,
  672. 0xd6, 0xf7, 0xe3, 0x19, 0xf7, 0xc0, 0xb0, 0xbd, 0x59, 0xe2, 0xca, 0x4b,
  673. 0xdb, 0x55, 0x6d, 0x61, 0xa5,
  674. /* order */
  675. 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  676. 0x00, 0x00, 0x01, 0xDC, 0xE8, 0xD2, 0xEC, 0x61, 0x84, 0xCA, 0xF0, 0xA9,
  677. 0x71, 0x76, 0x9F, 0xB1, 0xF7
  678. }
  679. };
  680. static const struct {
  681. EC_CURVE_DATA h;
  682. unsigned char data[0 + 32 * 6];
  683. } _EC_SECG_PRIME_256K1 = {
  684. {
  685. NID_X9_62_prime_field, 0, 32, 1
  686. },
  687. {
  688. /* no seed */
  689. /* p */
  690. 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
  691. 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
  692. 0xFF, 0xFF, 0xFF, 0xFE, 0xFF, 0xFF, 0xFC, 0x2F,
  693. /* a */
  694. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  695. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  696. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  697. /* b */
  698. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  699. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  700. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07,
  701. /* x */
  702. 0x79, 0xBE, 0x66, 0x7E, 0xF9, 0xDC, 0xBB, 0xAC, 0x55, 0xA0, 0x62, 0x95,
  703. 0xCE, 0x87, 0x0B, 0x07, 0x02, 0x9B, 0xFC, 0xDB, 0x2D, 0xCE, 0x28, 0xD9,
  704. 0x59, 0xF2, 0x81, 0x5B, 0x16, 0xF8, 0x17, 0x98,
  705. /* y */
  706. 0x48, 0x3a, 0xda, 0x77, 0x26, 0xa3, 0xc4, 0x65, 0x5d, 0xa4, 0xfb, 0xfc,
  707. 0x0e, 0x11, 0x08, 0xa8, 0xfd, 0x17, 0xb4, 0x48, 0xa6, 0x85, 0x54, 0x19,
  708. 0x9c, 0x47, 0xd0, 0x8f, 0xfb, 0x10, 0xd4, 0xb8,
  709. /* order */
  710. 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
  711. 0xFF, 0xFF, 0xFF, 0xFE, 0xBA, 0xAE, 0xDC, 0xE6, 0xAF, 0x48, 0xA0, 0x3B,
  712. 0xBF, 0xD2, 0x5E, 0x8C, 0xD0, 0x36, 0x41, 0x41
  713. }
  714. };
  715. /* some wap/wtls curves */
  716. static const struct {
  717. EC_CURVE_DATA h;
  718. unsigned char data[0 + 15 * 6];
  719. } _EC_WTLS_8 = {
  720. {
  721. NID_X9_62_prime_field, 0, 15, 1
  722. },
  723. {
  724. /* no seed */
  725. /* p */
  726. 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
  727. 0xFF, 0xFD, 0xE7,
  728. /* a */
  729. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  730. 0x00, 0x00, 0x00,
  731. /* b */
  732. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  733. 0x00, 0x00, 0x03,
  734. /* x */
  735. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  736. 0x00, 0x00, 0x01,
  737. /* y */
  738. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  739. 0x00, 0x00, 0x02,
  740. /* order */
  741. 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xEC, 0xEA, 0x55, 0x1A,
  742. 0xD8, 0x37, 0xE9
  743. }
  744. };
  745. static const struct {
  746. EC_CURVE_DATA h;
  747. unsigned char data[0 + 21 * 6];
  748. } _EC_WTLS_9 = {
  749. {
  750. NID_X9_62_prime_field, 0, 21, 1
  751. },
  752. {
  753. /* no seed */
  754. /* p */
  755. 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
  756. 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0x80, 0x8F,
  757. /* a */
  758. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  759. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  760. /* b */
  761. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  762. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03,
  763. /* x */
  764. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  765. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
  766. /* y */
  767. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  768. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02,
  769. /* order */
  770. 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xCD,
  771. 0xC9, 0x8A, 0xE0, 0xE2, 0xDE, 0x57, 0x4A, 0xBF, 0x33
  772. }
  773. };
  774. static const struct {
  775. EC_CURVE_DATA h;
  776. unsigned char data[0 + 28 * 6];
  777. } _EC_WTLS_12 = {
  778. {
  779. NID_X9_62_prime_field, 0, 28, 1
  780. },
  781. {
  782. /* no seed */
  783. /* p */
  784. 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
  785. 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  786. 0x00, 0x00, 0x00, 0x01,
  787. /* a */
  788. 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
  789. 0xFF, 0xFF, 0xFF, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
  790. 0xFF, 0xFF, 0xFF, 0xFE,
  791. /* b */
  792. 0xB4, 0x05, 0x0A, 0x85, 0x0C, 0x04, 0xB3, 0xAB, 0xF5, 0x41, 0x32, 0x56,
  793. 0x50, 0x44, 0xB0, 0xB7, 0xD7, 0xBF, 0xD8, 0xBA, 0x27, 0x0B, 0x39, 0x43,
  794. 0x23, 0x55, 0xFF, 0xB4,
  795. /* x */
  796. 0xB7, 0x0E, 0x0C, 0xBD, 0x6B, 0xB4, 0xBF, 0x7F, 0x32, 0x13, 0x90, 0xB9,
  797. 0x4A, 0x03, 0xC1, 0xD3, 0x56, 0xC2, 0x11, 0x22, 0x34, 0x32, 0x80, 0xD6,
  798. 0x11, 0x5C, 0x1D, 0x21,
  799. /* y */
  800. 0xbd, 0x37, 0x63, 0x88, 0xb5, 0xf7, 0x23, 0xfb, 0x4c, 0x22, 0xdf, 0xe6,
  801. 0xcd, 0x43, 0x75, 0xa0, 0x5a, 0x07, 0x47, 0x64, 0x44, 0xd5, 0x81, 0x99,
  802. 0x85, 0x00, 0x7e, 0x34,
  803. /* order */
  804. 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
  805. 0xFF, 0xFF, 0x16, 0xA2, 0xE0, 0xB8, 0xF0, 0x3E, 0x13, 0xDD, 0x29, 0x45,
  806. 0x5C, 0x5C, 0x2A, 0x3D
  807. }
  808. };
  809. #ifndef OPENSSL_NO_EC2M
  810. /* characteristic two curves */
  811. static const struct {
  812. EC_CURVE_DATA h;
  813. unsigned char data[20 + 15 * 6];
  814. } _EC_SECG_CHAR2_113R1 = {
  815. {
  816. NID_X9_62_characteristic_two_field, 20, 15, 2
  817. },
  818. {
  819. /* seed */
  820. 0x10, 0xE7, 0x23, 0xAB, 0x14, 0xD6, 0x96, 0xE6, 0x76, 0x87, 0x56, 0x15,
  821. 0x17, 0x56, 0xFE, 0xBF, 0x8F, 0xCB, 0x49, 0xA9,
  822. /* p */
  823. 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  824. 0x00, 0x02, 0x01,
  825. /* a */
  826. 0x00, 0x30, 0x88, 0x25, 0x0C, 0xA6, 0xE7, 0xC7, 0xFE, 0x64, 0x9C, 0xE8,
  827. 0x58, 0x20, 0xF7,
  828. /* b */
  829. 0x00, 0xE8, 0xBE, 0xE4, 0xD3, 0xE2, 0x26, 0x07, 0x44, 0x18, 0x8B, 0xE0,
  830. 0xE9, 0xC7, 0x23,
  831. /* x */
  832. 0x00, 0x9D, 0x73, 0x61, 0x6F, 0x35, 0xF4, 0xAB, 0x14, 0x07, 0xD7, 0x35,
  833. 0x62, 0xC1, 0x0F,
  834. /* y */
  835. 0x00, 0xA5, 0x28, 0x30, 0x27, 0x79, 0x58, 0xEE, 0x84, 0xD1, 0x31, 0x5E,
  836. 0xD3, 0x18, 0x86,
  837. /* order */
  838. 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xD9, 0xCC, 0xEC, 0x8A,
  839. 0x39, 0xE5, 0x6F
  840. }
  841. };
  842. static const struct {
  843. EC_CURVE_DATA h;
  844. unsigned char data[20 + 15 * 6];
  845. } _EC_SECG_CHAR2_113R2 = {
  846. {
  847. NID_X9_62_characteristic_two_field, 20, 15, 2
  848. },
  849. {
  850. /* seed */
  851. 0x10, 0xC0, 0xFB, 0x15, 0x76, 0x08, 0x60, 0xDE, 0xF1, 0xEE, 0xF4, 0xD6,
  852. 0x96, 0xE6, 0x76, 0x87, 0x56, 0x15, 0x17, 0x5D,
  853. /* p */
  854. 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  855. 0x00, 0x02, 0x01,
  856. /* a */
  857. 0x00, 0x68, 0x99, 0x18, 0xDB, 0xEC, 0x7E, 0x5A, 0x0D, 0xD6, 0xDF, 0xC0,
  858. 0xAA, 0x55, 0xC7,
  859. /* b */
  860. 0x00, 0x95, 0xE9, 0xA9, 0xEC, 0x9B, 0x29, 0x7B, 0xD4, 0xBF, 0x36, 0xE0,
  861. 0x59, 0x18, 0x4F,
  862. /* x */
  863. 0x01, 0xA5, 0x7A, 0x6A, 0x7B, 0x26, 0xCA, 0x5E, 0xF5, 0x2F, 0xCD, 0xB8,
  864. 0x16, 0x47, 0x97,
  865. /* y */
  866. 0x00, 0xB3, 0xAD, 0xC9, 0x4E, 0xD1, 0xFE, 0x67, 0x4C, 0x06, 0xE6, 0x95,
  867. 0xBA, 0xBA, 0x1D,
  868. /* order */
  869. 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x08, 0x78, 0x9B, 0x24,
  870. 0x96, 0xAF, 0x93
  871. }
  872. };
  873. static const struct {
  874. EC_CURVE_DATA h;
  875. unsigned char data[20 + 17 * 6];
  876. } _EC_SECG_CHAR2_131R1 = {
  877. {
  878. NID_X9_62_characteristic_two_field, 20, 17, 2
  879. },
  880. {
  881. /* seed */
  882. 0x4D, 0x69, 0x6E, 0x67, 0x68, 0x75, 0x61, 0x51, 0x75, 0x98, 0x5B, 0xD3,
  883. 0xAD, 0xBA, 0xDA, 0x21, 0xB4, 0x3A, 0x97, 0xE2,
  884. /* p */
  885. 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  886. 0x00, 0x00, 0x00, 0x01, 0x0D,
  887. /* a */
  888. 0x07, 0xA1, 0x1B, 0x09, 0xA7, 0x6B, 0x56, 0x21, 0x44, 0x41, 0x8F, 0xF3,
  889. 0xFF, 0x8C, 0x25, 0x70, 0xB8,
  890. /* b */
  891. 0x02, 0x17, 0xC0, 0x56, 0x10, 0x88, 0x4B, 0x63, 0xB9, 0xC6, 0xC7, 0x29,
  892. 0x16, 0x78, 0xF9, 0xD3, 0x41,
  893. /* x */
  894. 0x00, 0x81, 0xBA, 0xF9, 0x1F, 0xDF, 0x98, 0x33, 0xC4, 0x0F, 0x9C, 0x18,
  895. 0x13, 0x43, 0x63, 0x83, 0x99,
  896. /* y */
  897. 0x07, 0x8C, 0x6E, 0x7E, 0xA3, 0x8C, 0x00, 0x1F, 0x73, 0xC8, 0x13, 0x4B,
  898. 0x1B, 0x4E, 0xF9, 0xE1, 0x50,
  899. /* order */
  900. 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x31, 0x23, 0x95,
  901. 0x3A, 0x94, 0x64, 0xB5, 0x4D
  902. }
  903. };
  904. static const struct {
  905. EC_CURVE_DATA h;
  906. unsigned char data[20 + 17 * 6];
  907. } _EC_SECG_CHAR2_131R2 = {
  908. {
  909. NID_X9_62_characteristic_two_field, 20, 17, 2
  910. },
  911. {
  912. /* seed */
  913. 0x98, 0x5B, 0xD3, 0xAD, 0xBA, 0xD4, 0xD6, 0x96, 0xE6, 0x76, 0x87, 0x56,
  914. 0x15, 0x17, 0x5A, 0x21, 0xB4, 0x3A, 0x97, 0xE3,
  915. /* p */
  916. 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  917. 0x00, 0x00, 0x00, 0x01, 0x0D,
  918. /* a */
  919. 0x03, 0xE5, 0xA8, 0x89, 0x19, 0xD7, 0xCA, 0xFC, 0xBF, 0x41, 0x5F, 0x07,
  920. 0xC2, 0x17, 0x65, 0x73, 0xB2,
  921. /* b */
  922. 0x04, 0xB8, 0x26, 0x6A, 0x46, 0xC5, 0x56, 0x57, 0xAC, 0x73, 0x4C, 0xE3,
  923. 0x8F, 0x01, 0x8F, 0x21, 0x92,
  924. /* x */
  925. 0x03, 0x56, 0xDC, 0xD8, 0xF2, 0xF9, 0x50, 0x31, 0xAD, 0x65, 0x2D, 0x23,
  926. 0x95, 0x1B, 0xB3, 0x66, 0xA8,
  927. /* y */
  928. 0x06, 0x48, 0xF0, 0x6D, 0x86, 0x79, 0x40, 0xA5, 0x36, 0x6D, 0x9E, 0x26,
  929. 0x5D, 0xE9, 0xEB, 0x24, 0x0F,
  930. /* order */
  931. 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x69, 0x54, 0xA2,
  932. 0x33, 0x04, 0x9B, 0xA9, 0x8F
  933. }
  934. };
  935. static const struct {
  936. EC_CURVE_DATA h;
  937. unsigned char data[0 + 21 * 6];
  938. } _EC_NIST_CHAR2_163K = {
  939. {
  940. NID_X9_62_characteristic_two_field, 0, 21, 2
  941. },
  942. {
  943. /* no seed */
  944. /* p */
  945. 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  946. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC9,
  947. /* a */
  948. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  949. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
  950. /* b */
  951. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  952. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
  953. /* x */
  954. 0x02, 0xFE, 0x13, 0xC0, 0x53, 0x7B, 0xBC, 0x11, 0xAC, 0xAA, 0x07, 0xD7,
  955. 0x93, 0xDE, 0x4E, 0x6D, 0x5E, 0x5C, 0x94, 0xEE, 0xE8,
  956. /* y */
  957. 0x02, 0x89, 0x07, 0x0F, 0xB0, 0x5D, 0x38, 0xFF, 0x58, 0x32, 0x1F, 0x2E,
  958. 0x80, 0x05, 0x36, 0xD5, 0x38, 0xCC, 0xDA, 0xA3, 0xD9,
  959. /* order */
  960. 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x01,
  961. 0x08, 0xA2, 0xE0, 0xCC, 0x0D, 0x99, 0xF8, 0xA5, 0xEF
  962. }
  963. };
  964. static const struct {
  965. EC_CURVE_DATA h;
  966. unsigned char data[0 + 21 * 6];
  967. } _EC_SECG_CHAR2_163R1 = {
  968. {
  969. NID_X9_62_characteristic_two_field, 0, 21, 2
  970. },
  971. {
  972. /* p */
  973. 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  974. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC9,
  975. /* a */
  976. 0x07, 0xB6, 0x88, 0x2C, 0xAA, 0xEF, 0xA8, 0x4F, 0x95, 0x54, 0xFF, 0x84,
  977. 0x28, 0xBD, 0x88, 0xE2, 0x46, 0xD2, 0x78, 0x2A, 0xE2,
  978. /* b */
  979. 0x07, 0x13, 0x61, 0x2D, 0xCD, 0xDC, 0xB4, 0x0A, 0xAB, 0x94, 0x6B, 0xDA,
  980. 0x29, 0xCA, 0x91, 0xF7, 0x3A, 0xF9, 0x58, 0xAF, 0xD9,
  981. /* x */
  982. 0x03, 0x69, 0x97, 0x96, 0x97, 0xAB, 0x43, 0x89, 0x77, 0x89, 0x56, 0x67,
  983. 0x89, 0x56, 0x7F, 0x78, 0x7A, 0x78, 0x76, 0xA6, 0x54,
  984. /* y */
  985. 0x00, 0x43, 0x5E, 0xDB, 0x42, 0xEF, 0xAF, 0xB2, 0x98, 0x9D, 0x51, 0xFE,
  986. 0xFC, 0xE3, 0xC8, 0x09, 0x88, 0xF4, 0x1F, 0xF8, 0x83,
  987. /* order */
  988. 0x03, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x48,
  989. 0xAA, 0xB6, 0x89, 0xC2, 0x9C, 0xA7, 0x10, 0x27, 0x9B
  990. }
  991. };
  992. static const struct {
  993. EC_CURVE_DATA h;
  994. unsigned char data[0 + 21 * 6];
  995. } _EC_NIST_CHAR2_163B = {
  996. {
  997. NID_X9_62_characteristic_two_field, 0, 21, 2
  998. },
  999. {
  1000. /* p */
  1001. 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1002. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC9,
  1003. /* a */
  1004. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1005. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
  1006. /* b */
  1007. 0x02, 0x0A, 0x60, 0x19, 0x07, 0xB8, 0xC9, 0x53, 0xCA, 0x14, 0x81, 0xEB,
  1008. 0x10, 0x51, 0x2F, 0x78, 0x74, 0x4A, 0x32, 0x05, 0xFD,
  1009. /* x */
  1010. 0x03, 0xF0, 0xEB, 0xA1, 0x62, 0x86, 0xA2, 0xD5, 0x7E, 0xA0, 0x99, 0x11,
  1011. 0x68, 0xD4, 0x99, 0x46, 0x37, 0xE8, 0x34, 0x3E, 0x36,
  1012. /* y */
  1013. 0x00, 0xD5, 0x1F, 0xBC, 0x6C, 0x71, 0xA0, 0x09, 0x4F, 0xA2, 0xCD, 0xD5,
  1014. 0x45, 0xB1, 0x1C, 0x5C, 0x0C, 0x79, 0x73, 0x24, 0xF1,
  1015. /* order */
  1016. 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x92,
  1017. 0xFE, 0x77, 0xE7, 0x0C, 0x12, 0xA4, 0x23, 0x4C, 0x33
  1018. }
  1019. };
  1020. static const struct {
  1021. EC_CURVE_DATA h;
  1022. unsigned char data[20 + 25 * 6];
  1023. } _EC_SECG_CHAR2_193R1 = {
  1024. {
  1025. NID_X9_62_characteristic_two_field, 20, 25, 2
  1026. },
  1027. {
  1028. /* seed */
  1029. 0x10, 0x3F, 0xAE, 0xC7, 0x4D, 0x69, 0x6E, 0x67, 0x68, 0x75, 0x61, 0x51,
  1030. 0x75, 0x77, 0x7F, 0xC5, 0xB1, 0x91, 0xEF, 0x30,
  1031. /* p */
  1032. 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1033. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80,
  1034. 0x01,
  1035. /* a */
  1036. 0x00, 0x17, 0x85, 0x8F, 0xEB, 0x7A, 0x98, 0x97, 0x51, 0x69, 0xE1, 0x71,
  1037. 0xF7, 0x7B, 0x40, 0x87, 0xDE, 0x09, 0x8A, 0xC8, 0xA9, 0x11, 0xDF, 0x7B,
  1038. 0x01,
  1039. /* b */
  1040. 0x00, 0xFD, 0xFB, 0x49, 0xBF, 0xE6, 0xC3, 0xA8, 0x9F, 0xAC, 0xAD, 0xAA,
  1041. 0x7A, 0x1E, 0x5B, 0xBC, 0x7C, 0xC1, 0xC2, 0xE5, 0xD8, 0x31, 0x47, 0x88,
  1042. 0x14,
  1043. /* x */
  1044. 0x01, 0xF4, 0x81, 0xBC, 0x5F, 0x0F, 0xF8, 0x4A, 0x74, 0xAD, 0x6C, 0xDF,
  1045. 0x6F, 0xDE, 0xF4, 0xBF, 0x61, 0x79, 0x62, 0x53, 0x72, 0xD8, 0xC0, 0xC5,
  1046. 0xE1,
  1047. /* y */
  1048. 0x00, 0x25, 0xE3, 0x99, 0xF2, 0x90, 0x37, 0x12, 0xCC, 0xF3, 0xEA, 0x9E,
  1049. 0x3A, 0x1A, 0xD1, 0x7F, 0xB0, 0xB3, 0x20, 0x1B, 0x6A, 0xF7, 0xCE, 0x1B,
  1050. 0x05,
  1051. /* order */
  1052. 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1053. 0x00, 0xC7, 0xF3, 0x4A, 0x77, 0x8F, 0x44, 0x3A, 0xCC, 0x92, 0x0E, 0xBA,
  1054. 0x49
  1055. }
  1056. };
  1057. static const struct {
  1058. EC_CURVE_DATA h;
  1059. unsigned char data[20 + 25 * 6];
  1060. } _EC_SECG_CHAR2_193R2 = {
  1061. {
  1062. NID_X9_62_characteristic_two_field, 20, 25, 2
  1063. },
  1064. {
  1065. /* seed */
  1066. 0x10, 0xB7, 0xB4, 0xD6, 0x96, 0xE6, 0x76, 0x87, 0x56, 0x15, 0x17, 0x51,
  1067. 0x37, 0xC8, 0xA1, 0x6F, 0xD0, 0xDA, 0x22, 0x11,
  1068. /* p */
  1069. 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1070. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80,
  1071. 0x01,
  1072. /* a */
  1073. 0x01, 0x63, 0xF3, 0x5A, 0x51, 0x37, 0xC2, 0xCE, 0x3E, 0xA6, 0xED, 0x86,
  1074. 0x67, 0x19, 0x0B, 0x0B, 0xC4, 0x3E, 0xCD, 0x69, 0x97, 0x77, 0x02, 0x70,
  1075. 0x9B,
  1076. /* b */
  1077. 0x00, 0xC9, 0xBB, 0x9E, 0x89, 0x27, 0xD4, 0xD6, 0x4C, 0x37, 0x7E, 0x2A,
  1078. 0xB2, 0x85, 0x6A, 0x5B, 0x16, 0xE3, 0xEF, 0xB7, 0xF6, 0x1D, 0x43, 0x16,
  1079. 0xAE,
  1080. /* x */
  1081. 0x00, 0xD9, 0xB6, 0x7D, 0x19, 0x2E, 0x03, 0x67, 0xC8, 0x03, 0xF3, 0x9E,
  1082. 0x1A, 0x7E, 0x82, 0xCA, 0x14, 0xA6, 0x51, 0x35, 0x0A, 0xAE, 0x61, 0x7E,
  1083. 0x8F,
  1084. /* y */
  1085. 0x01, 0xCE, 0x94, 0x33, 0x56, 0x07, 0xC3, 0x04, 0xAC, 0x29, 0xE7, 0xDE,
  1086. 0xFB, 0xD9, 0xCA, 0x01, 0xF5, 0x96, 0xF9, 0x27, 0x22, 0x4C, 0xDE, 0xCF,
  1087. 0x6C,
  1088. /* order */
  1089. 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1090. 0x01, 0x5A, 0xAB, 0x56, 0x1B, 0x00, 0x54, 0x13, 0xCC, 0xD4, 0xEE, 0x99,
  1091. 0xD5
  1092. }
  1093. };
  1094. static const struct {
  1095. EC_CURVE_DATA h;
  1096. unsigned char data[0 + 30 * 6];
  1097. } _EC_NIST_CHAR2_233K = {
  1098. {
  1099. NID_X9_62_characteristic_two_field, 0, 30, 4
  1100. },
  1101. {
  1102. /* no seed */
  1103. 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1104. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
  1105. 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
  1106. /* a */
  1107. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1108. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1109. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1110. /* b */
  1111. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1112. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1113. 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
  1114. /* x */
  1115. 0x01, 0x72, 0x32, 0xBA, 0x85, 0x3A, 0x7E, 0x73, 0x1A, 0xF1, 0x29, 0xF2,
  1116. 0x2F, 0xF4, 0x14, 0x95, 0x63, 0xA4, 0x19, 0xC2, 0x6B, 0xF5, 0x0A, 0x4C,
  1117. 0x9D, 0x6E, 0xEF, 0xAD, 0x61, 0x26,
  1118. /* y */
  1119. 0x01, 0xDB, 0x53, 0x7D, 0xEC, 0xE8, 0x19, 0xB7, 0xF7, 0x0F, 0x55, 0x5A,
  1120. 0x67, 0xC4, 0x27, 0xA8, 0xCD, 0x9B, 0xF1, 0x8A, 0xEB, 0x9B, 0x56, 0xE0,
  1121. 0xC1, 0x10, 0x56, 0xFA, 0xE6, 0xA3,
  1122. /* order */
  1123. 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1124. 0x00, 0x00, 0x00, 0x06, 0x9D, 0x5B, 0xB9, 0x15, 0xBC, 0xD4, 0x6E, 0xFB,
  1125. 0x1A, 0xD5, 0xF1, 0x73, 0xAB, 0xDF
  1126. }
  1127. };
  1128. static const struct {
  1129. EC_CURVE_DATA h;
  1130. unsigned char data[20 + 30 * 6];
  1131. } _EC_NIST_CHAR2_233B = {
  1132. {
  1133. NID_X9_62_characteristic_two_field, 20, 30, 2
  1134. },
  1135. {
  1136. /* seed */
  1137. 0x74, 0xD5, 0x9F, 0xF0, 0x7F, 0x6B, 0x41, 0x3D, 0x0E, 0xA1, 0x4B, 0x34,
  1138. 0x4B, 0x20, 0xA2, 0xDB, 0x04, 0x9B, 0x50, 0xC3,
  1139. /* p */
  1140. 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1141. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
  1142. 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
  1143. /* a */
  1144. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1145. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1146. 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
  1147. /* b */
  1148. 0x00, 0x66, 0x64, 0x7E, 0xDE, 0x6C, 0x33, 0x2C, 0x7F, 0x8C, 0x09, 0x23,
  1149. 0xBB, 0x58, 0x21, 0x3B, 0x33, 0x3B, 0x20, 0xE9, 0xCE, 0x42, 0x81, 0xFE,
  1150. 0x11, 0x5F, 0x7D, 0x8F, 0x90, 0xAD,
  1151. /* x */
  1152. 0x00, 0xFA, 0xC9, 0xDF, 0xCB, 0xAC, 0x83, 0x13, 0xBB, 0x21, 0x39, 0xF1,
  1153. 0xBB, 0x75, 0x5F, 0xEF, 0x65, 0xBC, 0x39, 0x1F, 0x8B, 0x36, 0xF8, 0xF8,
  1154. 0xEB, 0x73, 0x71, 0xFD, 0x55, 0x8B,
  1155. /* y */
  1156. 0x01, 0x00, 0x6A, 0x08, 0xA4, 0x19, 0x03, 0x35, 0x06, 0x78, 0xE5, 0x85,
  1157. 0x28, 0xBE, 0xBF, 0x8A, 0x0B, 0xEF, 0xF8, 0x67, 0xA7, 0xCA, 0x36, 0x71,
  1158. 0x6F, 0x7E, 0x01, 0xF8, 0x10, 0x52,
  1159. /* order */
  1160. 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1161. 0x00, 0x00, 0x00, 0x13, 0xE9, 0x74, 0xE7, 0x2F, 0x8A, 0x69, 0x22, 0x03,
  1162. 0x1D, 0x26, 0x03, 0xCF, 0xE0, 0xD7
  1163. }
  1164. };
  1165. static const struct {
  1166. EC_CURVE_DATA h;
  1167. unsigned char data[0 + 30 * 6];
  1168. } _EC_SECG_CHAR2_239K1 = {
  1169. {
  1170. NID_X9_62_characteristic_two_field, 0, 30, 4
  1171. },
  1172. {
  1173. /* no seed */
  1174. 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00,
  1175. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1176. 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
  1177. /* a */
  1178. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1179. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1180. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1181. /* b */
  1182. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1183. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1184. 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
  1185. /* x */
  1186. 0x29, 0xA0, 0xB6, 0xA8, 0x87, 0xA9, 0x83, 0xE9, 0x73, 0x09, 0x88, 0xA6,
  1187. 0x87, 0x27, 0xA8, 0xB2, 0xD1, 0x26, 0xC4, 0x4C, 0xC2, 0xCC, 0x7B, 0x2A,
  1188. 0x65, 0x55, 0x19, 0x30, 0x35, 0xDC,
  1189. /* y */
  1190. 0x76, 0x31, 0x08, 0x04, 0xF1, 0x2E, 0x54, 0x9B, 0xDB, 0x01, 0x1C, 0x10,
  1191. 0x30, 0x89, 0xE7, 0x35, 0x10, 0xAC, 0xB2, 0x75, 0xFC, 0x31, 0x2A, 0x5D,
  1192. 0xC6, 0xB7, 0x65, 0x53, 0xF0, 0xCA,
  1193. /* order */
  1194. 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1195. 0x00, 0x00, 0x00, 0x5A, 0x79, 0xFE, 0xC6, 0x7C, 0xB6, 0xE9, 0x1F, 0x1C,
  1196. 0x1D, 0xA8, 0x00, 0xE4, 0x78, 0xA5
  1197. }
  1198. };
  1199. static const struct {
  1200. EC_CURVE_DATA h;
  1201. unsigned char data[0 + 36 * 6];
  1202. } _EC_NIST_CHAR2_283K = {
  1203. {
  1204. NID_X9_62_characteristic_two_field, 0, 36, 4
  1205. },
  1206. {
  1207. /* no seed */
  1208. 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1209. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1210. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0xA1,
  1211. /* a */
  1212. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1213. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1214. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1215. /* b */
  1216. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1217. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1218. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
  1219. /* x */
  1220. 0x05, 0x03, 0x21, 0x3F, 0x78, 0xCA, 0x44, 0x88, 0x3F, 0x1A, 0x3B, 0x81,
  1221. 0x62, 0xF1, 0x88, 0xE5, 0x53, 0xCD, 0x26, 0x5F, 0x23, 0xC1, 0x56, 0x7A,
  1222. 0x16, 0x87, 0x69, 0x13, 0xB0, 0xC2, 0xAC, 0x24, 0x58, 0x49, 0x28, 0x36,
  1223. /* y */
  1224. 0x01, 0xCC, 0xDA, 0x38, 0x0F, 0x1C, 0x9E, 0x31, 0x8D, 0x90, 0xF9, 0x5D,
  1225. 0x07, 0xE5, 0x42, 0x6F, 0xE8, 0x7E, 0x45, 0xC0, 0xE8, 0x18, 0x46, 0x98,
  1226. 0xE4, 0x59, 0x62, 0x36, 0x4E, 0x34, 0x11, 0x61, 0x77, 0xDD, 0x22, 0x59,
  1227. /* order */
  1228. 0x01, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
  1229. 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xE9, 0xAE, 0x2E, 0xD0, 0x75, 0x77,
  1230. 0x26, 0x5D, 0xFF, 0x7F, 0x94, 0x45, 0x1E, 0x06, 0x1E, 0x16, 0x3C, 0x61
  1231. }
  1232. };
  1233. static const struct {
  1234. EC_CURVE_DATA h;
  1235. unsigned char data[20 + 36 * 6];
  1236. } _EC_NIST_CHAR2_283B = {
  1237. {
  1238. NID_X9_62_characteristic_two_field, 20, 36, 2
  1239. },
  1240. {
  1241. /* no seed */
  1242. 0x77, 0xE2, 0xB0, 0x73, 0x70, 0xEB, 0x0F, 0x83, 0x2A, 0x6D, 0xD5, 0xB6,
  1243. 0x2D, 0xFC, 0x88, 0xCD, 0x06, 0xBB, 0x84, 0xBE,
  1244. /* p */
  1245. 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1246. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1247. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0xA1,
  1248. /* a */
  1249. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1250. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1251. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
  1252. /* b */
  1253. 0x02, 0x7B, 0x68, 0x0A, 0xC8, 0xB8, 0x59, 0x6D, 0xA5, 0xA4, 0xAF, 0x8A,
  1254. 0x19, 0xA0, 0x30, 0x3F, 0xCA, 0x97, 0xFD, 0x76, 0x45, 0x30, 0x9F, 0xA2,
  1255. 0xA5, 0x81, 0x48, 0x5A, 0xF6, 0x26, 0x3E, 0x31, 0x3B, 0x79, 0xA2, 0xF5,
  1256. /* x */
  1257. 0x05, 0xF9, 0x39, 0x25, 0x8D, 0xB7, 0xDD, 0x90, 0xE1, 0x93, 0x4F, 0x8C,
  1258. 0x70, 0xB0, 0xDF, 0xEC, 0x2E, 0xED, 0x25, 0xB8, 0x55, 0x7E, 0xAC, 0x9C,
  1259. 0x80, 0xE2, 0xE1, 0x98, 0xF8, 0xCD, 0xBE, 0xCD, 0x86, 0xB1, 0x20, 0x53,
  1260. /* y */
  1261. 0x03, 0x67, 0x68, 0x54, 0xFE, 0x24, 0x14, 0x1C, 0xB9, 0x8F, 0xE6, 0xD4,
  1262. 0xB2, 0x0D, 0x02, 0xB4, 0x51, 0x6F, 0xF7, 0x02, 0x35, 0x0E, 0xDD, 0xB0,
  1263. 0x82, 0x67, 0x79, 0xC8, 0x13, 0xF0, 0xDF, 0x45, 0xBE, 0x81, 0x12, 0xF4,
  1264. /* order */
  1265. 0x03, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
  1266. 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xEF, 0x90, 0x39, 0x96, 0x60, 0xFC,
  1267. 0x93, 0x8A, 0x90, 0x16, 0x5B, 0x04, 0x2A, 0x7C, 0xEF, 0xAD, 0xB3, 0x07
  1268. }
  1269. };
  1270. static const struct {
  1271. EC_CURVE_DATA h;
  1272. unsigned char data[0 + 52 * 6];
  1273. } _EC_NIST_CHAR2_409K = {
  1274. {
  1275. NID_X9_62_characteristic_two_field, 0, 52, 4
  1276. },
  1277. {
  1278. /* no seed */
  1279. /* p */
  1280. 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1281. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1282. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1283. 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1284. 0x00, 0x00, 0x00, 0x01,
  1285. /* a */
  1286. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1287. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1288. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1289. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1290. 0x00, 0x00, 0x00, 0x00,
  1291. /* b */
  1292. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1293. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1294. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1295. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1296. 0x00, 0x00, 0x00, 0x01,
  1297. /* x */
  1298. 0x00, 0x60, 0xF0, 0x5F, 0x65, 0x8F, 0x49, 0xC1, 0xAD, 0x3A, 0xB1, 0x89,
  1299. 0x0F, 0x71, 0x84, 0x21, 0x0E, 0xFD, 0x09, 0x87, 0xE3, 0x07, 0xC8, 0x4C,
  1300. 0x27, 0xAC, 0xCF, 0xB8, 0xF9, 0xF6, 0x7C, 0xC2, 0xC4, 0x60, 0x18, 0x9E,
  1301. 0xB5, 0xAA, 0xAA, 0x62, 0xEE, 0x22, 0x2E, 0xB1, 0xB3, 0x55, 0x40, 0xCF,
  1302. 0xE9, 0x02, 0x37, 0x46,
  1303. /* y */
  1304. 0x01, 0xE3, 0x69, 0x05, 0x0B, 0x7C, 0x4E, 0x42, 0xAC, 0xBA, 0x1D, 0xAC,
  1305. 0xBF, 0x04, 0x29, 0x9C, 0x34, 0x60, 0x78, 0x2F, 0x91, 0x8E, 0xA4, 0x27,
  1306. 0xE6, 0x32, 0x51, 0x65, 0xE9, 0xEA, 0x10, 0xE3, 0xDA, 0x5F, 0x6C, 0x42,
  1307. 0xE9, 0xC5, 0x52, 0x15, 0xAA, 0x9C, 0xA2, 0x7A, 0x58, 0x63, 0xEC, 0x48,
  1308. 0xD8, 0xE0, 0x28, 0x6B,
  1309. /* order */
  1310. 0x00, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
  1311. 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
  1312. 0xFF, 0xFF, 0xFE, 0x5F, 0x83, 0xB2, 0xD4, 0xEA, 0x20, 0x40, 0x0E, 0xC4,
  1313. 0x55, 0x7D, 0x5E, 0xD3, 0xE3, 0xE7, 0xCA, 0x5B, 0x4B, 0x5C, 0x83, 0xB8,
  1314. 0xE0, 0x1E, 0x5F, 0xCF
  1315. }
  1316. };
  1317. static const struct {
  1318. EC_CURVE_DATA h;
  1319. unsigned char data[20 + 52 * 6];
  1320. } _EC_NIST_CHAR2_409B = {
  1321. {
  1322. NID_X9_62_characteristic_two_field, 20, 52, 2
  1323. },
  1324. {
  1325. /* seed */
  1326. 0x40, 0x99, 0xB5, 0xA4, 0x57, 0xF9, 0xD6, 0x9F, 0x79, 0x21, 0x3D, 0x09,
  1327. 0x4C, 0x4B, 0xCD, 0x4D, 0x42, 0x62, 0x21, 0x0B,
  1328. /* p */
  1329. 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1330. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1331. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1332. 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1333. 0x00, 0x00, 0x00, 0x01,
  1334. /* a */
  1335. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1336. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1337. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1338. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1339. 0x00, 0x00, 0x00, 0x01,
  1340. /* b */
  1341. 0x00, 0x21, 0xA5, 0xC2, 0xC8, 0xEE, 0x9F, 0xEB, 0x5C, 0x4B, 0x9A, 0x75,
  1342. 0x3B, 0x7B, 0x47, 0x6B, 0x7F, 0xD6, 0x42, 0x2E, 0xF1, 0xF3, 0xDD, 0x67,
  1343. 0x47, 0x61, 0xFA, 0x99, 0xD6, 0xAC, 0x27, 0xC8, 0xA9, 0xA1, 0x97, 0xB2,
  1344. 0x72, 0x82, 0x2F, 0x6C, 0xD5, 0x7A, 0x55, 0xAA, 0x4F, 0x50, 0xAE, 0x31,
  1345. 0x7B, 0x13, 0x54, 0x5F,
  1346. /* x */
  1347. 0x01, 0x5D, 0x48, 0x60, 0xD0, 0x88, 0xDD, 0xB3, 0x49, 0x6B, 0x0C, 0x60,
  1348. 0x64, 0x75, 0x62, 0x60, 0x44, 0x1C, 0xDE, 0x4A, 0xF1, 0x77, 0x1D, 0x4D,
  1349. 0xB0, 0x1F, 0xFE, 0x5B, 0x34, 0xE5, 0x97, 0x03, 0xDC, 0x25, 0x5A, 0x86,
  1350. 0x8A, 0x11, 0x80, 0x51, 0x56, 0x03, 0xAE, 0xAB, 0x60, 0x79, 0x4E, 0x54,
  1351. 0xBB, 0x79, 0x96, 0xA7,
  1352. /* y */
  1353. 0x00, 0x61, 0xB1, 0xCF, 0xAB, 0x6B, 0xE5, 0xF3, 0x2B, 0xBF, 0xA7, 0x83,
  1354. 0x24, 0xED, 0x10, 0x6A, 0x76, 0x36, 0xB9, 0xC5, 0xA7, 0xBD, 0x19, 0x8D,
  1355. 0x01, 0x58, 0xAA, 0x4F, 0x54, 0x88, 0xD0, 0x8F, 0x38, 0x51, 0x4F, 0x1F,
  1356. 0xDF, 0x4B, 0x4F, 0x40, 0xD2, 0x18, 0x1B, 0x36, 0x81, 0xC3, 0x64, 0xBA,
  1357. 0x02, 0x73, 0xC7, 0x06,
  1358. /* order */
  1359. 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1360. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1361. 0x00, 0x00, 0x01, 0xE2, 0xAA, 0xD6, 0xA6, 0x12, 0xF3, 0x33, 0x07, 0xBE,
  1362. 0x5F, 0xA4, 0x7C, 0x3C, 0x9E, 0x05, 0x2F, 0x83, 0x81, 0x64, 0xCD, 0x37,
  1363. 0xD9, 0xA2, 0x11, 0x73
  1364. }
  1365. };
  1366. static const struct {
  1367. EC_CURVE_DATA h;
  1368. unsigned char data[0 + 72 * 6];
  1369. } _EC_NIST_CHAR2_571K = {
  1370. {
  1371. NID_X9_62_characteristic_two_field, 0, 72, 4
  1372. },
  1373. {
  1374. /* no seed */
  1375. /* p */
  1376. 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1377. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1378. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1379. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1380. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1381. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x25,
  1382. /* a */
  1383. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1384. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1385. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1386. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1387. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1388. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1389. /* b */
  1390. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1391. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1392. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1393. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1394. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1395. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
  1396. /* x */
  1397. 0x02, 0x6E, 0xB7, 0xA8, 0x59, 0x92, 0x3F, 0xBC, 0x82, 0x18, 0x96, 0x31,
  1398. 0xF8, 0x10, 0x3F, 0xE4, 0xAC, 0x9C, 0xA2, 0x97, 0x00, 0x12, 0xD5, 0xD4,
  1399. 0x60, 0x24, 0x80, 0x48, 0x01, 0x84, 0x1C, 0xA4, 0x43, 0x70, 0x95, 0x84,
  1400. 0x93, 0xB2, 0x05, 0xE6, 0x47, 0xDA, 0x30, 0x4D, 0xB4, 0xCE, 0xB0, 0x8C,
  1401. 0xBB, 0xD1, 0xBA, 0x39, 0x49, 0x47, 0x76, 0xFB, 0x98, 0x8B, 0x47, 0x17,
  1402. 0x4D, 0xCA, 0x88, 0xC7, 0xE2, 0x94, 0x52, 0x83, 0xA0, 0x1C, 0x89, 0x72,
  1403. /* y */
  1404. 0x03, 0x49, 0xDC, 0x80, 0x7F, 0x4F, 0xBF, 0x37, 0x4F, 0x4A, 0xEA, 0xDE,
  1405. 0x3B, 0xCA, 0x95, 0x31, 0x4D, 0xD5, 0x8C, 0xEC, 0x9F, 0x30, 0x7A, 0x54,
  1406. 0xFF, 0xC6, 0x1E, 0xFC, 0x00, 0x6D, 0x8A, 0x2C, 0x9D, 0x49, 0x79, 0xC0,
  1407. 0xAC, 0x44, 0xAE, 0xA7, 0x4F, 0xBE, 0xBB, 0xB9, 0xF7, 0x72, 0xAE, 0xDC,
  1408. 0xB6, 0x20, 0xB0, 0x1A, 0x7B, 0xA7, 0xAF, 0x1B, 0x32, 0x04, 0x30, 0xC8,
  1409. 0x59, 0x19, 0x84, 0xF6, 0x01, 0xCD, 0x4C, 0x14, 0x3E, 0xF1, 0xC7, 0xA3,
  1410. /* order */
  1411. 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1412. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1413. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1414. 0x13, 0x18, 0x50, 0xE1, 0xF1, 0x9A, 0x63, 0xE4, 0xB3, 0x91, 0xA8, 0xDB,
  1415. 0x91, 0x7F, 0x41, 0x38, 0xB6, 0x30, 0xD8, 0x4B, 0xE5, 0xD6, 0x39, 0x38,
  1416. 0x1E, 0x91, 0xDE, 0xB4, 0x5C, 0xFE, 0x77, 0x8F, 0x63, 0x7C, 0x10, 0x01
  1417. }
  1418. };
  1419. static const struct {
  1420. EC_CURVE_DATA h;
  1421. unsigned char data[20 + 72 * 6];
  1422. } _EC_NIST_CHAR2_571B = {
  1423. {
  1424. NID_X9_62_characteristic_two_field, 20, 72, 2
  1425. },
  1426. {
  1427. /* seed */
  1428. 0x2A, 0xA0, 0x58, 0xF7, 0x3A, 0x0E, 0x33, 0xAB, 0x48, 0x6B, 0x0F, 0x61,
  1429. 0x04, 0x10, 0xC5, 0x3A, 0x7F, 0x13, 0x23, 0x10,
  1430. /* p */
  1431. 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1432. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1433. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1434. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1435. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1436. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x25,
  1437. /* a */
  1438. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1439. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1440. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1441. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1442. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1443. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
  1444. /* b */
  1445. 0x02, 0xF4, 0x0E, 0x7E, 0x22, 0x21, 0xF2, 0x95, 0xDE, 0x29, 0x71, 0x17,
  1446. 0xB7, 0xF3, 0xD6, 0x2F, 0x5C, 0x6A, 0x97, 0xFF, 0xCB, 0x8C, 0xEF, 0xF1,
  1447. 0xCD, 0x6B, 0xA8, 0xCE, 0x4A, 0x9A, 0x18, 0xAD, 0x84, 0xFF, 0xAB, 0xBD,
  1448. 0x8E, 0xFA, 0x59, 0x33, 0x2B, 0xE7, 0xAD, 0x67, 0x56, 0xA6, 0x6E, 0x29,
  1449. 0x4A, 0xFD, 0x18, 0x5A, 0x78, 0xFF, 0x12, 0xAA, 0x52, 0x0E, 0x4D, 0xE7,
  1450. 0x39, 0xBA, 0xCA, 0x0C, 0x7F, 0xFE, 0xFF, 0x7F, 0x29, 0x55, 0x72, 0x7A,
  1451. /* x */
  1452. 0x03, 0x03, 0x00, 0x1D, 0x34, 0xB8, 0x56, 0x29, 0x6C, 0x16, 0xC0, 0xD4,
  1453. 0x0D, 0x3C, 0xD7, 0x75, 0x0A, 0x93, 0xD1, 0xD2, 0x95, 0x5F, 0xA8, 0x0A,
  1454. 0xA5, 0xF4, 0x0F, 0xC8, 0xDB, 0x7B, 0x2A, 0xBD, 0xBD, 0xE5, 0x39, 0x50,
  1455. 0xF4, 0xC0, 0xD2, 0x93, 0xCD, 0xD7, 0x11, 0xA3, 0x5B, 0x67, 0xFB, 0x14,
  1456. 0x99, 0xAE, 0x60, 0x03, 0x86, 0x14, 0xF1, 0x39, 0x4A, 0xBF, 0xA3, 0xB4,
  1457. 0xC8, 0x50, 0xD9, 0x27, 0xE1, 0xE7, 0x76, 0x9C, 0x8E, 0xEC, 0x2D, 0x19,
  1458. /* y */
  1459. 0x03, 0x7B, 0xF2, 0x73, 0x42, 0xDA, 0x63, 0x9B, 0x6D, 0xCC, 0xFF, 0xFE,
  1460. 0xB7, 0x3D, 0x69, 0xD7, 0x8C, 0x6C, 0x27, 0xA6, 0x00, 0x9C, 0xBB, 0xCA,
  1461. 0x19, 0x80, 0xF8, 0x53, 0x39, 0x21, 0xE8, 0xA6, 0x84, 0x42, 0x3E, 0x43,
  1462. 0xBA, 0xB0, 0x8A, 0x57, 0x62, 0x91, 0xAF, 0x8F, 0x46, 0x1B, 0xB2, 0xA8,
  1463. 0xB3, 0x53, 0x1D, 0x2F, 0x04, 0x85, 0xC1, 0x9B, 0x16, 0xE2, 0xF1, 0x51,
  1464. 0x6E, 0x23, 0xDD, 0x3C, 0x1A, 0x48, 0x27, 0xAF, 0x1B, 0x8A, 0xC1, 0x5B,
  1465. /* order */
  1466. 0x03, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
  1467. 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
  1468. 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
  1469. 0xE6, 0x61, 0xCE, 0x18, 0xFF, 0x55, 0x98, 0x73, 0x08, 0x05, 0x9B, 0x18,
  1470. 0x68, 0x23, 0x85, 0x1E, 0xC7, 0xDD, 0x9C, 0xA1, 0x16, 0x1D, 0xE9, 0x3D,
  1471. 0x51, 0x74, 0xD6, 0x6E, 0x83, 0x82, 0xE9, 0xBB, 0x2F, 0xE8, 0x4E, 0x47
  1472. }
  1473. };
  1474. static const struct {
  1475. EC_CURVE_DATA h;
  1476. unsigned char data[20 + 21 * 6];
  1477. } _EC_X9_62_CHAR2_163V1 = {
  1478. {
  1479. NID_X9_62_characteristic_two_field, 20, 21, 2
  1480. },
  1481. {
  1482. /* seed */
  1483. 0xD2, 0xC0, 0xFB, 0x15, 0x76, 0x08, 0x60, 0xDE, 0xF1, 0xEE, 0xF4, 0xD6,
  1484. 0x96, 0xE6, 0x76, 0x87, 0x56, 0x15, 0x17, 0x54,
  1485. /* p */
  1486. 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1487. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x07,
  1488. /* a */
  1489. 0x07, 0x25, 0x46, 0xB5, 0x43, 0x52, 0x34, 0xA4, 0x22, 0xE0, 0x78, 0x96,
  1490. 0x75, 0xF4, 0x32, 0xC8, 0x94, 0x35, 0xDE, 0x52, 0x42,
  1491. /* b */
  1492. 0x00, 0xC9, 0x51, 0x7D, 0x06, 0xD5, 0x24, 0x0D, 0x3C, 0xFF, 0x38, 0xC7,
  1493. 0x4B, 0x20, 0xB6, 0xCD, 0x4D, 0x6F, 0x9D, 0xD4, 0xD9,
  1494. /* x */
  1495. 0x07, 0xAF, 0x69, 0x98, 0x95, 0x46, 0x10, 0x3D, 0x79, 0x32, 0x9F, 0xCC,
  1496. 0x3D, 0x74, 0x88, 0x0F, 0x33, 0xBB, 0xE8, 0x03, 0xCB,
  1497. /* y */
  1498. 0x01, 0xEC, 0x23, 0x21, 0x1B, 0x59, 0x66, 0xAD, 0xEA, 0x1D, 0x3F, 0x87,
  1499. 0xF7, 0xEA, 0x58, 0x48, 0xAE, 0xF0, 0xB7, 0xCA, 0x9F,
  1500. /* order */
  1501. 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xE6,
  1502. 0x0F, 0xC8, 0x82, 0x1C, 0xC7, 0x4D, 0xAE, 0xAF, 0xC1
  1503. }
  1504. };
  1505. static const struct {
  1506. EC_CURVE_DATA h;
  1507. unsigned char data[20 + 21 * 6];
  1508. } _EC_X9_62_CHAR2_163V2 = {
  1509. {
  1510. NID_X9_62_characteristic_two_field, 20, 21, 2
  1511. },
  1512. {
  1513. /* seed */
  1514. 0x53, 0x81, 0x4C, 0x05, 0x0D, 0x44, 0xD6, 0x96, 0xE6, 0x76, 0x87, 0x56,
  1515. 0x15, 0x17, 0x58, 0x0C, 0xA4, 0xE2, 0x9F, 0xFD,
  1516. /* p */
  1517. 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1518. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x07,
  1519. /* a */
  1520. 0x01, 0x08, 0xB3, 0x9E, 0x77, 0xC4, 0xB1, 0x08, 0xBE, 0xD9, 0x81, 0xED,
  1521. 0x0E, 0x89, 0x0E, 0x11, 0x7C, 0x51, 0x1C, 0xF0, 0x72,
  1522. /* b */
  1523. 0x06, 0x67, 0xAC, 0xEB, 0x38, 0xAF, 0x4E, 0x48, 0x8C, 0x40, 0x74, 0x33,
  1524. 0xFF, 0xAE, 0x4F, 0x1C, 0x81, 0x16, 0x38, 0xDF, 0x20,
  1525. /* x */
  1526. 0x00, 0x24, 0x26, 0x6E, 0x4E, 0xB5, 0x10, 0x6D, 0x0A, 0x96, 0x4D, 0x92,
  1527. 0xC4, 0x86, 0x0E, 0x26, 0x71, 0xDB, 0x9B, 0x6C, 0xC5,
  1528. /* y */
  1529. 0x07, 0x9F, 0x68, 0x4D, 0xDF, 0x66, 0x84, 0xC5, 0xCD, 0x25, 0x8B, 0x38,
  1530. 0x90, 0x02, 0x1B, 0x23, 0x86, 0xDF, 0xD1, 0x9F, 0xC5,
  1531. /* order */
  1532. 0x03, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFD, 0xF6,
  1533. 0x4D, 0xE1, 0x15, 0x1A, 0xDB, 0xB7, 0x8F, 0x10, 0xA7
  1534. }
  1535. };
  1536. static const struct {
  1537. EC_CURVE_DATA h;
  1538. unsigned char data[20 + 21 * 6];
  1539. } _EC_X9_62_CHAR2_163V3 = {
  1540. {
  1541. NID_X9_62_characteristic_two_field, 20, 21, 2
  1542. },
  1543. {
  1544. /* seed */
  1545. 0x50, 0xCB, 0xF1, 0xD9, 0x5C, 0xA9, 0x4D, 0x69, 0x6E, 0x67, 0x68, 0x75,
  1546. 0x61, 0x51, 0x75, 0xF1, 0x6A, 0x36, 0xA3, 0xB8,
  1547. /* p */
  1548. 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1549. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x07,
  1550. /* a */
  1551. 0x07, 0xA5, 0x26, 0xC6, 0x3D, 0x3E, 0x25, 0xA2, 0x56, 0xA0, 0x07, 0x69,
  1552. 0x9F, 0x54, 0x47, 0xE3, 0x2A, 0xE4, 0x56, 0xB5, 0x0E,
  1553. /* b */
  1554. 0x03, 0xF7, 0x06, 0x17, 0x98, 0xEB, 0x99, 0xE2, 0x38, 0xFD, 0x6F, 0x1B,
  1555. 0xF9, 0x5B, 0x48, 0xFE, 0xEB, 0x48, 0x54, 0x25, 0x2B,
  1556. /* x */
  1557. 0x02, 0xF9, 0xF8, 0x7B, 0x7C, 0x57, 0x4D, 0x0B, 0xDE, 0xCF, 0x8A, 0x22,
  1558. 0xE6, 0x52, 0x47, 0x75, 0xF9, 0x8C, 0xDE, 0xBD, 0xCB,
  1559. /* y */
  1560. 0x05, 0xB9, 0x35, 0x59, 0x0C, 0x15, 0x5E, 0x17, 0xEA, 0x48, 0xEB, 0x3F,
  1561. 0xF3, 0x71, 0x8B, 0x89, 0x3D, 0xF5, 0x9A, 0x05, 0xD0,
  1562. /* order */
  1563. 0x03, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0x1A,
  1564. 0xEE, 0x14, 0x0F, 0x11, 0x0A, 0xFF, 0x96, 0x13, 0x09
  1565. }
  1566. };
  1567. static const struct {
  1568. EC_CURVE_DATA h;
  1569. unsigned char data[0 + 23 * 6];
  1570. } _EC_X9_62_CHAR2_176V1 = {
  1571. {
  1572. NID_X9_62_characteristic_two_field, 0, 23, 0xFF6E
  1573. },
  1574. {
  1575. /* no seed */
  1576. /* p */
  1577. 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1578. 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x07,
  1579. /* a */
  1580. 0x00, 0xE4, 0xE6, 0xDB, 0x29, 0x95, 0x06, 0x5C, 0x40, 0x7D, 0x9D, 0x39,
  1581. 0xB8, 0xD0, 0x96, 0x7B, 0x96, 0x70, 0x4B, 0xA8, 0xE9, 0xC9, 0x0B,
  1582. /* b */
  1583. 0x00, 0x5D, 0xDA, 0x47, 0x0A, 0xBE, 0x64, 0x14, 0xDE, 0x8E, 0xC1, 0x33,
  1584. 0xAE, 0x28, 0xE9, 0xBB, 0xD7, 0xFC, 0xEC, 0x0A, 0xE0, 0xFF, 0xF2,
  1585. /* x */
  1586. 0x00, 0x8D, 0x16, 0xC2, 0x86, 0x67, 0x98, 0xB6, 0x00, 0xF9, 0xF0, 0x8B,
  1587. 0xB4, 0xA8, 0xE8, 0x60, 0xF3, 0x29, 0x8C, 0xE0, 0x4A, 0x57, 0x98,
  1588. /* y */
  1589. 0x00, 0x6F, 0xA4, 0x53, 0x9C, 0x2D, 0xAD, 0xDD, 0xD6, 0xBA, 0xB5, 0x16,
  1590. 0x7D, 0x61, 0xB4, 0x36, 0xE1, 0xD9, 0x2B, 0xB1, 0x6A, 0x56, 0x2C,
  1591. /* order */
  1592. 0x00, 0x00, 0x01, 0x00, 0x92, 0x53, 0x73, 0x97, 0xEC, 0xA4, 0xF6, 0x14,
  1593. 0x57, 0x99, 0xD6, 0x2B, 0x0A, 0x19, 0xCE, 0x06, 0xFE, 0x26, 0xAD
  1594. }
  1595. };
  1596. static const struct {
  1597. EC_CURVE_DATA h;
  1598. unsigned char data[20 + 24 * 6];
  1599. } _EC_X9_62_CHAR2_191V1 = {
  1600. {
  1601. NID_X9_62_characteristic_two_field, 20, 24, 2
  1602. },
  1603. {
  1604. /* seed */
  1605. 0x4E, 0x13, 0xCA, 0x54, 0x27, 0x44, 0xD6, 0x96, 0xE6, 0x76, 0x87, 0x56,
  1606. 0x15, 0x17, 0x55, 0x2F, 0x27, 0x9A, 0x8C, 0x84,
  1607. /* p */
  1608. 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1609. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x01,
  1610. /* a */
  1611. 0x28, 0x66, 0x53, 0x7B, 0x67, 0x67, 0x52, 0x63, 0x6A, 0x68, 0xF5, 0x65,
  1612. 0x54, 0xE1, 0x26, 0x40, 0x27, 0x6B, 0x64, 0x9E, 0xF7, 0x52, 0x62, 0x67,
  1613. /* b */
  1614. 0x2E, 0x45, 0xEF, 0x57, 0x1F, 0x00, 0x78, 0x6F, 0x67, 0xB0, 0x08, 0x1B,
  1615. 0x94, 0x95, 0xA3, 0xD9, 0x54, 0x62, 0xF5, 0xDE, 0x0A, 0xA1, 0x85, 0xEC,
  1616. /* x */
  1617. 0x36, 0xB3, 0xDA, 0xF8, 0xA2, 0x32, 0x06, 0xF9, 0xC4, 0xF2, 0x99, 0xD7,
  1618. 0xB2, 0x1A, 0x9C, 0x36, 0x91, 0x37, 0xF2, 0xC8, 0x4A, 0xE1, 0xAA, 0x0D,
  1619. /* y */
  1620. 0x76, 0x5B, 0xE7, 0x34, 0x33, 0xB3, 0xF9, 0x5E, 0x33, 0x29, 0x32, 0xE7,
  1621. 0x0E, 0xA2, 0x45, 0xCA, 0x24, 0x18, 0xEA, 0x0E, 0xF9, 0x80, 0x18, 0xFB,
  1622. /* order */
  1623. 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1624. 0x04, 0xA2, 0x0E, 0x90, 0xC3, 0x90, 0x67, 0xC8, 0x93, 0xBB, 0xB9, 0xA5
  1625. }
  1626. };
  1627. static const struct {
  1628. EC_CURVE_DATA h;
  1629. unsigned char data[20 + 24 * 6];
  1630. } _EC_X9_62_CHAR2_191V2 = {
  1631. {
  1632. NID_X9_62_characteristic_two_field, 20, 24, 4
  1633. },
  1634. {
  1635. /* seed */
  1636. 0x08, 0x71, 0xEF, 0x2F, 0xEF, 0x24, 0xD6, 0x96, 0xE6, 0x76, 0x87, 0x56,
  1637. 0x15, 0x17, 0x58, 0xBE, 0xE0, 0xD9, 0x5C, 0x15,
  1638. /* p */
  1639. 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1640. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x01,
  1641. /* a */
  1642. 0x40, 0x10, 0x28, 0x77, 0x4D, 0x77, 0x77, 0xC7, 0xB7, 0x66, 0x6D, 0x13,
  1643. 0x66, 0xEA, 0x43, 0x20, 0x71, 0x27, 0x4F, 0x89, 0xFF, 0x01, 0xE7, 0x18,
  1644. /* b */
  1645. 0x06, 0x20, 0x04, 0x8D, 0x28, 0xBC, 0xBD, 0x03, 0xB6, 0x24, 0x9C, 0x99,
  1646. 0x18, 0x2B, 0x7C, 0x8C, 0xD1, 0x97, 0x00, 0xC3, 0x62, 0xC4, 0x6A, 0x01,
  1647. /* x */
  1648. 0x38, 0x09, 0xB2, 0xB7, 0xCC, 0x1B, 0x28, 0xCC, 0x5A, 0x87, 0x92, 0x6A,
  1649. 0xAD, 0x83, 0xFD, 0x28, 0x78, 0x9E, 0x81, 0xE2, 0xC9, 0xE3, 0xBF, 0x10,
  1650. /* y */
  1651. 0x17, 0x43, 0x43, 0x86, 0x62, 0x6D, 0x14, 0xF3, 0xDB, 0xF0, 0x17, 0x60,
  1652. 0xD9, 0x21, 0x3A, 0x3E, 0x1C, 0xF3, 0x7A, 0xEC, 0x43, 0x7D, 0x66, 0x8A,
  1653. /* order */
  1654. 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1655. 0x50, 0x50, 0x8C, 0xB8, 0x9F, 0x65, 0x28, 0x24, 0xE0, 0x6B, 0x81, 0x73
  1656. }
  1657. };
  1658. static const struct {
  1659. EC_CURVE_DATA h;
  1660. unsigned char data[20 + 24 * 6];
  1661. } _EC_X9_62_CHAR2_191V3 = {
  1662. {
  1663. NID_X9_62_characteristic_two_field, 20, 24, 6
  1664. },
  1665. {
  1666. /* seed */
  1667. 0xE0, 0x53, 0x51, 0x2D, 0xC6, 0x84, 0xD6, 0x96, 0xE6, 0x76, 0x87, 0x56,
  1668. 0x15, 0x17, 0x50, 0x67, 0xAE, 0x78, 0x6D, 0x1F,
  1669. /* p */
  1670. 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1671. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x01,
  1672. /* a */
  1673. 0x6C, 0x01, 0x07, 0x47, 0x56, 0x09, 0x91, 0x22, 0x22, 0x10, 0x56, 0x91,
  1674. 0x1C, 0x77, 0xD7, 0x7E, 0x77, 0xA7, 0x77, 0xE7, 0xE7, 0xE7, 0x7F, 0xCB,
  1675. /* b */
  1676. 0x71, 0xFE, 0x1A, 0xF9, 0x26, 0xCF, 0x84, 0x79, 0x89, 0xEF, 0xEF, 0x8D,
  1677. 0xB4, 0x59, 0xF6, 0x63, 0x94, 0xD9, 0x0F, 0x32, 0xAD, 0x3F, 0x15, 0xE8,
  1678. /* x */
  1679. 0x37, 0x5D, 0x4C, 0xE2, 0x4F, 0xDE, 0x43, 0x44, 0x89, 0xDE, 0x87, 0x46,
  1680. 0xE7, 0x17, 0x86, 0x01, 0x50, 0x09, 0xE6, 0x6E, 0x38, 0xA9, 0x26, 0xDD,
  1681. /* y */
  1682. 0x54, 0x5A, 0x39, 0x17, 0x61, 0x96, 0x57, 0x5D, 0x98, 0x59, 0x99, 0x36,
  1683. 0x6E, 0x6A, 0xD3, 0x4C, 0xE0, 0xA7, 0x7C, 0xD7, 0x12, 0x7B, 0x06, 0xBE,
  1684. /* order */
  1685. 0x15, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55,
  1686. 0x61, 0x0C, 0x0B, 0x19, 0x68, 0x12, 0xBF, 0xB6, 0x28, 0x8A, 0x3E, 0xA3
  1687. }
  1688. };
  1689. static const struct {
  1690. EC_CURVE_DATA h;
  1691. unsigned char data[0 + 27 * 6];
  1692. } _EC_X9_62_CHAR2_208W1 = {
  1693. {
  1694. NID_X9_62_characteristic_two_field, 0, 27, 0xFE48
  1695. },
  1696. {
  1697. /* no seed */
  1698. /* p */
  1699. 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1700. 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1701. 0x00, 0x00, 0x07,
  1702. /* a */
  1703. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1704. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1705. 0x00, 0x00, 0x00,
  1706. /* b */
  1707. 0x00, 0xC8, 0x61, 0x9E, 0xD4, 0x5A, 0x62, 0xE6, 0x21, 0x2E, 0x11, 0x60,
  1708. 0x34, 0x9E, 0x2B, 0xFA, 0x84, 0x44, 0x39, 0xFA, 0xFC, 0x2A, 0x3F, 0xD1,
  1709. 0x63, 0x8F, 0x9E,
  1710. /* x */
  1711. 0x00, 0x89, 0xFD, 0xFB, 0xE4, 0xAB, 0xE1, 0x93, 0xDF, 0x95, 0x59, 0xEC,
  1712. 0xF0, 0x7A, 0xC0, 0xCE, 0x78, 0x55, 0x4E, 0x27, 0x84, 0xEB, 0x8C, 0x1E,
  1713. 0xD1, 0xA5, 0x7A,
  1714. /* y */
  1715. 0x00, 0x0F, 0x55, 0xB5, 0x1A, 0x06, 0xE7, 0x8E, 0x9A, 0xC3, 0x8A, 0x03,
  1716. 0x5F, 0xF5, 0x20, 0xD8, 0xB0, 0x17, 0x81, 0xBE, 0xB1, 0xA6, 0xBB, 0x08,
  1717. 0x61, 0x7D, 0xE3,
  1718. /* order */
  1719. 0x00, 0x00, 0x01, 0x01, 0xBA, 0xF9, 0x5C, 0x97, 0x23, 0xC5, 0x7B, 0x6C,
  1720. 0x21, 0xDA, 0x2E, 0xFF, 0x2D, 0x5E, 0xD5, 0x88, 0xBD, 0xD5, 0x71, 0x7E,
  1721. 0x21, 0x2F, 0x9D
  1722. }
  1723. };
  1724. static const struct {
  1725. EC_CURVE_DATA h;
  1726. unsigned char data[20 + 30 * 6];
  1727. } _EC_X9_62_CHAR2_239V1 = {
  1728. {
  1729. NID_X9_62_characteristic_two_field, 20, 30, 4
  1730. },
  1731. {
  1732. /* seed */
  1733. 0xD3, 0x4B, 0x9A, 0x4D, 0x69, 0x6E, 0x67, 0x68, 0x75, 0x61, 0x51, 0x75,
  1734. 0xCA, 0x71, 0xB9, 0x20, 0xBF, 0xEF, 0xB0, 0x5D,
  1735. /* p */
  1736. 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1737. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1738. 0x00, 0x10, 0x00, 0x00, 0x00, 0x01,
  1739. /* a */
  1740. 0x32, 0x01, 0x08, 0x57, 0x07, 0x7C, 0x54, 0x31, 0x12, 0x3A, 0x46, 0xB8,
  1741. 0x08, 0x90, 0x67, 0x56, 0xF5, 0x43, 0x42, 0x3E, 0x8D, 0x27, 0x87, 0x75,
  1742. 0x78, 0x12, 0x57, 0x78, 0xAC, 0x76,
  1743. /* b */
  1744. 0x79, 0x04, 0x08, 0xF2, 0xEE, 0xDA, 0xF3, 0x92, 0xB0, 0x12, 0xED, 0xEF,
  1745. 0xB3, 0x39, 0x2F, 0x30, 0xF4, 0x32, 0x7C, 0x0C, 0xA3, 0xF3, 0x1F, 0xC3,
  1746. 0x83, 0xC4, 0x22, 0xAA, 0x8C, 0x16,
  1747. /* x */
  1748. 0x57, 0x92, 0x70, 0x98, 0xFA, 0x93, 0x2E, 0x7C, 0x0A, 0x96, 0xD3, 0xFD,
  1749. 0x5B, 0x70, 0x6E, 0xF7, 0xE5, 0xF5, 0xC1, 0x56, 0xE1, 0x6B, 0x7E, 0x7C,
  1750. 0x86, 0x03, 0x85, 0x52, 0xE9, 0x1D,
  1751. /* y */
  1752. 0x61, 0xD8, 0xEE, 0x50, 0x77, 0xC3, 0x3F, 0xEC, 0xF6, 0xF1, 0xA1, 0x6B,
  1753. 0x26, 0x8D, 0xE4, 0x69, 0xC3, 0xC7, 0x74, 0x4E, 0xA9, 0xA9, 0x71, 0x64,
  1754. 0x9F, 0xC7, 0xA9, 0x61, 0x63, 0x05,
  1755. /* order */
  1756. 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1757. 0x00, 0x00, 0x00, 0x0F, 0x4D, 0x42, 0xFF, 0xE1, 0x49, 0x2A, 0x49, 0x93,
  1758. 0xF1, 0xCA, 0xD6, 0x66, 0xE4, 0x47
  1759. }
  1760. };
  1761. static const struct {
  1762. EC_CURVE_DATA h;
  1763. unsigned char data[20 + 30 * 6];
  1764. } _EC_X9_62_CHAR2_239V2 = {
  1765. {
  1766. NID_X9_62_characteristic_two_field, 20, 30, 6
  1767. },
  1768. {
  1769. /* seed */
  1770. 0x2A, 0xA6, 0x98, 0x2F, 0xDF, 0xA4, 0xD6, 0x96, 0xE6, 0x76, 0x87, 0x56,
  1771. 0x15, 0x17, 0x5D, 0x26, 0x67, 0x27, 0x27, 0x7D,
  1772. /* p */
  1773. 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1774. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1775. 0x00, 0x10, 0x00, 0x00, 0x00, 0x01,
  1776. /* a */
  1777. 0x42, 0x30, 0x01, 0x77, 0x57, 0xA7, 0x67, 0xFA, 0xE4, 0x23, 0x98, 0x56,
  1778. 0x9B, 0x74, 0x63, 0x25, 0xD4, 0x53, 0x13, 0xAF, 0x07, 0x66, 0x26, 0x64,
  1779. 0x79, 0xB7, 0x56, 0x54, 0xE6, 0x5F,
  1780. /* b */
  1781. 0x50, 0x37, 0xEA, 0x65, 0x41, 0x96, 0xCF, 0xF0, 0xCD, 0x82, 0xB2, 0xC1,
  1782. 0x4A, 0x2F, 0xCF, 0x2E, 0x3F, 0xF8, 0x77, 0x52, 0x85, 0xB5, 0x45, 0x72,
  1783. 0x2F, 0x03, 0xEA, 0xCD, 0xB7, 0x4B,
  1784. /* x */
  1785. 0x28, 0xF9, 0xD0, 0x4E, 0x90, 0x00, 0x69, 0xC8, 0xDC, 0x47, 0xA0, 0x85,
  1786. 0x34, 0xFE, 0x76, 0xD2, 0xB9, 0x00, 0xB7, 0xD7, 0xEF, 0x31, 0xF5, 0x70,
  1787. 0x9F, 0x20, 0x0C, 0x4C, 0xA2, 0x05,
  1788. /* y */
  1789. 0x56, 0x67, 0x33, 0x4C, 0x45, 0xAF, 0xF3, 0xB5, 0xA0, 0x3B, 0xAD, 0x9D,
  1790. 0xD7, 0x5E, 0x2C, 0x71, 0xA9, 0x93, 0x62, 0x56, 0x7D, 0x54, 0x53, 0xF7,
  1791. 0xFA, 0x6E, 0x22, 0x7E, 0xC8, 0x33,
  1792. /* order */
  1793. 0x15, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55,
  1794. 0x55, 0x55, 0x55, 0x3C, 0x6F, 0x28, 0x85, 0x25, 0x9C, 0x31, 0xE3, 0xFC,
  1795. 0xDF, 0x15, 0x46, 0x24, 0x52, 0x2D
  1796. }
  1797. };
  1798. static const struct {
  1799. EC_CURVE_DATA h;
  1800. unsigned char data[20 + 30 * 6];
  1801. } _EC_X9_62_CHAR2_239V3 = {
  1802. {
  1803. NID_X9_62_characteristic_two_field, 20, 30, 0xA
  1804. },
  1805. {
  1806. /* seed */
  1807. 0x9E, 0x07, 0x6F, 0x4D, 0x69, 0x6E, 0x67, 0x68, 0x75, 0x61, 0x51, 0x75,
  1808. 0xE1, 0x1E, 0x9F, 0xDD, 0x77, 0xF9, 0x20, 0x41,
  1809. /* p */
  1810. 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1811. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1812. 0x00, 0x10, 0x00, 0x00, 0x00, 0x01,
  1813. /* a */
  1814. 0x01, 0x23, 0x87, 0x74, 0x66, 0x6A, 0x67, 0x76, 0x6D, 0x66, 0x76, 0xF7,
  1815. 0x78, 0xE6, 0x76, 0xB6, 0x69, 0x99, 0x17, 0x66, 0x66, 0xE6, 0x87, 0x66,
  1816. 0x6D, 0x87, 0x66, 0xC6, 0x6A, 0x9F,
  1817. /* b */
  1818. 0x6A, 0x94, 0x19, 0x77, 0xBA, 0x9F, 0x6A, 0x43, 0x51, 0x99, 0xAC, 0xFC,
  1819. 0x51, 0x06, 0x7E, 0xD5, 0x87, 0xF5, 0x19, 0xC5, 0xEC, 0xB5, 0x41, 0xB8,
  1820. 0xE4, 0x41, 0x11, 0xDE, 0x1D, 0x40,
  1821. /* x */
  1822. 0x70, 0xF6, 0xE9, 0xD0, 0x4D, 0x28, 0x9C, 0x4E, 0x89, 0x91, 0x3C, 0xE3,
  1823. 0x53, 0x0B, 0xFD, 0xE9, 0x03, 0x97, 0x7D, 0x42, 0xB1, 0x46, 0xD5, 0x39,
  1824. 0xBF, 0x1B, 0xDE, 0x4E, 0x9C, 0x92,
  1825. /* y */
  1826. 0x2E, 0x5A, 0x0E, 0xAF, 0x6E, 0x5E, 0x13, 0x05, 0xB9, 0x00, 0x4D, 0xCE,
  1827. 0x5C, 0x0E, 0xD7, 0xFE, 0x59, 0xA3, 0x56, 0x08, 0xF3, 0x38, 0x37, 0xC8,
  1828. 0x16, 0xD8, 0x0B, 0x79, 0xF4, 0x61,
  1829. /* order */
  1830. 0x0C, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC,
  1831. 0xCC, 0xCC, 0xCC, 0xAC, 0x49, 0x12, 0xD2, 0xD9, 0xDF, 0x90, 0x3E, 0xF9,
  1832. 0x88, 0x8B, 0x8A, 0x0E, 0x4C, 0xFF
  1833. }
  1834. };
  1835. static const struct {
  1836. EC_CURVE_DATA h;
  1837. unsigned char data[0 + 35 * 6];
  1838. } _EC_X9_62_CHAR2_272W1 = {
  1839. {
  1840. NID_X9_62_characteristic_two_field, 0, 35, 0xFF06
  1841. },
  1842. {
  1843. /* no seed */
  1844. /* p */
  1845. 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1846. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1847. 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0B,
  1848. /* a */
  1849. 0x00, 0x91, 0xA0, 0x91, 0xF0, 0x3B, 0x5F, 0xBA, 0x4A, 0xB2, 0xCC, 0xF4,
  1850. 0x9C, 0x4E, 0xDD, 0x22, 0x0F, 0xB0, 0x28, 0x71, 0x2D, 0x42, 0xBE, 0x75,
  1851. 0x2B, 0x2C, 0x40, 0x09, 0x4D, 0xBA, 0xCD, 0xB5, 0x86, 0xFB, 0x20,
  1852. /* b */
  1853. 0x00, 0x71, 0x67, 0xEF, 0xC9, 0x2B, 0xB2, 0xE3, 0xCE, 0x7C, 0x8A, 0xAA,
  1854. 0xFF, 0x34, 0xE1, 0x2A, 0x9C, 0x55, 0x70, 0x03, 0xD7, 0xC7, 0x3A, 0x6F,
  1855. 0xAF, 0x00, 0x3F, 0x99, 0xF6, 0xCC, 0x84, 0x82, 0xE5, 0x40, 0xF7,
  1856. /* x */
  1857. 0x00, 0x61, 0x08, 0xBA, 0xBB, 0x2C, 0xEE, 0xBC, 0xF7, 0x87, 0x05, 0x8A,
  1858. 0x05, 0x6C, 0xBE, 0x0C, 0xFE, 0x62, 0x2D, 0x77, 0x23, 0xA2, 0x89, 0xE0,
  1859. 0x8A, 0x07, 0xAE, 0x13, 0xEF, 0x0D, 0x10, 0xD1, 0x71, 0xDD, 0x8D,
  1860. /* y */
  1861. 0x00, 0x10, 0xC7, 0x69, 0x57, 0x16, 0x85, 0x1E, 0xEF, 0x6B, 0xA7, 0xF6,
  1862. 0x87, 0x2E, 0x61, 0x42, 0xFB, 0xD2, 0x41, 0xB8, 0x30, 0xFF, 0x5E, 0xFC,
  1863. 0xAC, 0xEC, 0xCA, 0xB0, 0x5E, 0x02, 0x00, 0x5D, 0xDE, 0x9D, 0x23,
  1864. /* order */
  1865. 0x00, 0x00, 0x01, 0x00, 0xFA, 0xF5, 0x13, 0x54, 0xE0, 0xE3, 0x9E, 0x48,
  1866. 0x92, 0xDF, 0x6E, 0x31, 0x9C, 0x72, 0xC8, 0x16, 0x16, 0x03, 0xFA, 0x45,
  1867. 0xAA, 0x7B, 0x99, 0x8A, 0x16, 0x7B, 0x8F, 0x1E, 0x62, 0x95, 0x21
  1868. }
  1869. };
  1870. static const struct {
  1871. EC_CURVE_DATA h;
  1872. unsigned char data[0 + 39 * 6];
  1873. } _EC_X9_62_CHAR2_304W1 = {
  1874. {
  1875. NID_X9_62_characteristic_two_field, 0, 39, 0xFE2E
  1876. },
  1877. {
  1878. /* no seed */
  1879. /* p */
  1880. 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1881. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1882. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1883. 0x00, 0x08, 0x07,
  1884. /* a */
  1885. 0x00, 0xFD, 0x0D, 0x69, 0x31, 0x49, 0xA1, 0x18, 0xF6, 0x51, 0xE6, 0xDC,
  1886. 0xE6, 0x80, 0x20, 0x85, 0x37, 0x7E, 0x5F, 0x88, 0x2D, 0x1B, 0x51, 0x0B,
  1887. 0x44, 0x16, 0x00, 0x74, 0xC1, 0x28, 0x80, 0x78, 0x36, 0x5A, 0x03, 0x96,
  1888. 0xC8, 0xE6, 0x81,
  1889. /* b */
  1890. 0x00, 0xBD, 0xDB, 0x97, 0xE5, 0x55, 0xA5, 0x0A, 0x90, 0x8E, 0x43, 0xB0,
  1891. 0x1C, 0x79, 0x8E, 0xA5, 0xDA, 0xA6, 0x78, 0x8F, 0x1E, 0xA2, 0x79, 0x4E,
  1892. 0xFC, 0xF5, 0x71, 0x66, 0xB8, 0xC1, 0x40, 0x39, 0x60, 0x1E, 0x55, 0x82,
  1893. 0x73, 0x40, 0xBE,
  1894. /* x */
  1895. 0x00, 0x19, 0x7B, 0x07, 0x84, 0x5E, 0x9B, 0xE2, 0xD9, 0x6A, 0xDB, 0x0F,
  1896. 0x5F, 0x3C, 0x7F, 0x2C, 0xFF, 0xBD, 0x7A, 0x3E, 0xB8, 0xB6, 0xFE, 0xC3,
  1897. 0x5C, 0x7F, 0xD6, 0x7F, 0x26, 0xDD, 0xF6, 0x28, 0x5A, 0x64, 0x4F, 0x74,
  1898. 0x0A, 0x26, 0x14,
  1899. /* y */
  1900. 0x00, 0xE1, 0x9F, 0xBE, 0xB7, 0x6E, 0x0D, 0xA1, 0x71, 0x51, 0x7E, 0xCF,
  1901. 0x40, 0x1B, 0x50, 0x28, 0x9B, 0xF0, 0x14, 0x10, 0x32, 0x88, 0x52, 0x7A,
  1902. 0x9B, 0x41, 0x6A, 0x10, 0x5E, 0x80, 0x26, 0x0B, 0x54, 0x9F, 0xDC, 0x1B,
  1903. 0x92, 0xC0, 0x3B,
  1904. /* order */
  1905. 0x00, 0x00, 0x01, 0x01, 0xD5, 0x56, 0x57, 0x2A, 0xAB, 0xAC, 0x80, 0x01,
  1906. 0x01, 0xD5, 0x56, 0x57, 0x2A, 0xAB, 0xAC, 0x80, 0x01, 0x02, 0x2D, 0x5C,
  1907. 0x91, 0xDD, 0x17, 0x3F, 0x8F, 0xB5, 0x61, 0xDA, 0x68, 0x99, 0x16, 0x44,
  1908. 0x43, 0x05, 0x1D
  1909. }
  1910. };
  1911. static const struct {
  1912. EC_CURVE_DATA h;
  1913. unsigned char data[20 + 45 * 6];
  1914. } _EC_X9_62_CHAR2_359V1 = {
  1915. {
  1916. NID_X9_62_characteristic_two_field, 20, 45, 0x4C
  1917. },
  1918. {
  1919. /* seed */
  1920. 0x2B, 0x35, 0x49, 0x20, 0xB7, 0x24, 0xD6, 0x96, 0xE6, 0x76, 0x87, 0x56,
  1921. 0x15, 0x17, 0x58, 0x5B, 0xA1, 0x33, 0x2D, 0xC6,
  1922. /* p */
  1923. 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1924. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1925. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1926. 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
  1927. /* a */
  1928. 0x56, 0x67, 0x67, 0x6A, 0x65, 0x4B, 0x20, 0x75, 0x4F, 0x35, 0x6E, 0xA9,
  1929. 0x20, 0x17, 0xD9, 0x46, 0x56, 0x7C, 0x46, 0x67, 0x55, 0x56, 0xF1, 0x95,
  1930. 0x56, 0xA0, 0x46, 0x16, 0xB5, 0x67, 0xD2, 0x23, 0xA5, 0xE0, 0x56, 0x56,
  1931. 0xFB, 0x54, 0x90, 0x16, 0xA9, 0x66, 0x56, 0xA5, 0x57,
  1932. /* b */
  1933. 0x24, 0x72, 0xE2, 0xD0, 0x19, 0x7C, 0x49, 0x36, 0x3F, 0x1F, 0xE7, 0xF5,
  1934. 0xB6, 0xDB, 0x07, 0x5D, 0x52, 0xB6, 0x94, 0x7D, 0x13, 0x5D, 0x8C, 0xA4,
  1935. 0x45, 0x80, 0x5D, 0x39, 0xBC, 0x34, 0x56, 0x26, 0x08, 0x96, 0x87, 0x74,
  1936. 0x2B, 0x63, 0x29, 0xE7, 0x06, 0x80, 0x23, 0x19, 0x88,
  1937. /* x */
  1938. 0x3C, 0x25, 0x8E, 0xF3, 0x04, 0x77, 0x67, 0xE7, 0xED, 0xE0, 0xF1, 0xFD,
  1939. 0xAA, 0x79, 0xDA, 0xEE, 0x38, 0x41, 0x36, 0x6A, 0x13, 0x2E, 0x16, 0x3A,
  1940. 0xCE, 0xD4, 0xED, 0x24, 0x01, 0xDF, 0x9C, 0x6B, 0xDC, 0xDE, 0x98, 0xE8,
  1941. 0xE7, 0x07, 0xC0, 0x7A, 0x22, 0x39, 0xB1, 0xB0, 0x97,
  1942. /* y */
  1943. 0x53, 0xD7, 0xE0, 0x85, 0x29, 0x54, 0x70, 0x48, 0x12, 0x1E, 0x9C, 0x95,
  1944. 0xF3, 0x79, 0x1D, 0xD8, 0x04, 0x96, 0x39, 0x48, 0xF3, 0x4F, 0xAE, 0x7B,
  1945. 0xF4, 0x4E, 0xA8, 0x23, 0x65, 0xDC, 0x78, 0x68, 0xFE, 0x57, 0xE4, 0xAE,
  1946. 0x2D, 0xE2, 0x11, 0x30, 0x5A, 0x40, 0x71, 0x04, 0xBD,
  1947. /* order */
  1948. 0x01, 0xAF, 0x28, 0x6B, 0xCA, 0x1A, 0xF2, 0x86, 0xBC, 0xA1, 0xAF, 0x28,
  1949. 0x6B, 0xCA, 0x1A, 0xF2, 0x86, 0xBC, 0xA1, 0xAF, 0x28, 0x6B, 0xC9, 0xFB,
  1950. 0x8F, 0x6B, 0x85, 0xC5, 0x56, 0x89, 0x2C, 0x20, 0xA7, 0xEB, 0x96, 0x4F,
  1951. 0xE7, 0x71, 0x9E, 0x74, 0xF4, 0x90, 0x75, 0x8D, 0x3B
  1952. }
  1953. };
  1954. static const struct {
  1955. EC_CURVE_DATA h;
  1956. unsigned char data[0 + 47 * 6];
  1957. } _EC_X9_62_CHAR2_368W1 = {
  1958. {
  1959. NID_X9_62_characteristic_two_field, 0, 47, 0xFF70
  1960. },
  1961. {
  1962. /* no seed */
  1963. /* p */
  1964. 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1965. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1966. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1967. 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07,
  1968. /* a */
  1969. 0x00, 0xE0, 0xD2, 0xEE, 0x25, 0x09, 0x52, 0x06, 0xF5, 0xE2, 0xA4, 0xF9,
  1970. 0xED, 0x22, 0x9F, 0x1F, 0x25, 0x6E, 0x79, 0xA0, 0xE2, 0xB4, 0x55, 0x97,
  1971. 0x0D, 0x8D, 0x0D, 0x86, 0x5B, 0xD9, 0x47, 0x78, 0xC5, 0x76, 0xD6, 0x2F,
  1972. 0x0A, 0xB7, 0x51, 0x9C, 0xCD, 0x2A, 0x1A, 0x90, 0x6A, 0xE3, 0x0D,
  1973. /* b */
  1974. 0x00, 0xFC, 0x12, 0x17, 0xD4, 0x32, 0x0A, 0x90, 0x45, 0x2C, 0x76, 0x0A,
  1975. 0x58, 0xED, 0xCD, 0x30, 0xC8, 0xDD, 0x06, 0x9B, 0x3C, 0x34, 0x45, 0x38,
  1976. 0x37, 0xA3, 0x4E, 0xD5, 0x0C, 0xB5, 0x49, 0x17, 0xE1, 0xC2, 0x11, 0x2D,
  1977. 0x84, 0xD1, 0x64, 0xF4, 0x44, 0xF8, 0xF7, 0x47, 0x86, 0x04, 0x6A,
  1978. /* x */
  1979. 0x00, 0x10, 0x85, 0xE2, 0x75, 0x53, 0x81, 0xDC, 0xCC, 0xE3, 0xC1, 0x55,
  1980. 0x7A, 0xFA, 0x10, 0xC2, 0xF0, 0xC0, 0xC2, 0x82, 0x56, 0x46, 0xC5, 0xB3,
  1981. 0x4A, 0x39, 0x4C, 0xBC, 0xFA, 0x8B, 0xC1, 0x6B, 0x22, 0xE7, 0xE7, 0x89,
  1982. 0xE9, 0x27, 0xBE, 0x21, 0x6F, 0x02, 0xE1, 0xFB, 0x13, 0x6A, 0x5F,
  1983. /* y */
  1984. 0x00, 0x7B, 0x3E, 0xB1, 0xBD, 0xDC, 0xBA, 0x62, 0xD5, 0xD8, 0xB2, 0x05,
  1985. 0x9B, 0x52, 0x57, 0x97, 0xFC, 0x73, 0x82, 0x2C, 0x59, 0x05, 0x9C, 0x62,
  1986. 0x3A, 0x45, 0xFF, 0x38, 0x43, 0xCE, 0xE8, 0xF8, 0x7C, 0xD1, 0x85, 0x5A,
  1987. 0xDA, 0xA8, 0x1E, 0x2A, 0x07, 0x50, 0xB8, 0x0F, 0xDA, 0x23, 0x10,
  1988. /* order */
  1989. 0x00, 0x00, 0x01, 0x00, 0x90, 0x51, 0x2D, 0xA9, 0xAF, 0x72, 0xB0, 0x83,
  1990. 0x49, 0xD9, 0x8A, 0x5D, 0xD4, 0xC7, 0xB0, 0x53, 0x2E, 0xCA, 0x51, 0xCE,
  1991. 0x03, 0xE2, 0xD1, 0x0F, 0x3B, 0x7A, 0xC5, 0x79, 0xBD, 0x87, 0xE9, 0x09,
  1992. 0xAE, 0x40, 0xA6, 0xF1, 0x31, 0xE9, 0xCF, 0xCE, 0x5B, 0xD9, 0x67
  1993. }
  1994. };
  1995. static const struct {
  1996. EC_CURVE_DATA h;
  1997. unsigned char data[0 + 54 * 6];
  1998. } _EC_X9_62_CHAR2_431R1 = {
  1999. {
  2000. NID_X9_62_characteristic_two_field, 0, 54, 0x2760
  2001. },
  2002. {
  2003. /* no seed */
  2004. /* p */
  2005. 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  2006. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  2007. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  2008. 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  2009. 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
  2010. /* a */
  2011. 0x1A, 0x82, 0x7E, 0xF0, 0x0D, 0xD6, 0xFC, 0x0E, 0x23, 0x4C, 0xAF, 0x04,
  2012. 0x6C, 0x6A, 0x5D, 0x8A, 0x85, 0x39, 0x5B, 0x23, 0x6C, 0xC4, 0xAD, 0x2C,
  2013. 0xF3, 0x2A, 0x0C, 0xAD, 0xBD, 0xC9, 0xDD, 0xF6, 0x20, 0xB0, 0xEB, 0x99,
  2014. 0x06, 0xD0, 0x95, 0x7F, 0x6C, 0x6F, 0xEA, 0xCD, 0x61, 0x54, 0x68, 0xDF,
  2015. 0x10, 0x4D, 0xE2, 0x96, 0xCD, 0x8F,
  2016. /* b */
  2017. 0x10, 0xD9, 0xB4, 0xA3, 0xD9, 0x04, 0x7D, 0x8B, 0x15, 0x43, 0x59, 0xAB,
  2018. 0xFB, 0x1B, 0x7F, 0x54, 0x85, 0xB0, 0x4C, 0xEB, 0x86, 0x82, 0x37, 0xDD,
  2019. 0xC9, 0xDE, 0xDA, 0x98, 0x2A, 0x67, 0x9A, 0x5A, 0x91, 0x9B, 0x62, 0x6D,
  2020. 0x4E, 0x50, 0xA8, 0xDD, 0x73, 0x1B, 0x10, 0x7A, 0x99, 0x62, 0x38, 0x1F,
  2021. 0xB5, 0xD8, 0x07, 0xBF, 0x26, 0x18,
  2022. /* x */
  2023. 0x12, 0x0F, 0xC0, 0x5D, 0x3C, 0x67, 0xA9, 0x9D, 0xE1, 0x61, 0xD2, 0xF4,
  2024. 0x09, 0x26, 0x22, 0xFE, 0xCA, 0x70, 0x1B, 0xE4, 0xF5, 0x0F, 0x47, 0x58,
  2025. 0x71, 0x4E, 0x8A, 0x87, 0xBB, 0xF2, 0xA6, 0x58, 0xEF, 0x8C, 0x21, 0xE7,
  2026. 0xC5, 0xEF, 0xE9, 0x65, 0x36, 0x1F, 0x6C, 0x29, 0x99, 0xC0, 0xC2, 0x47,
  2027. 0xB0, 0xDB, 0xD7, 0x0C, 0xE6, 0xB7,
  2028. /* y */
  2029. 0x20, 0xD0, 0xAF, 0x89, 0x03, 0xA9, 0x6F, 0x8D, 0x5F, 0xA2, 0xC2, 0x55,
  2030. 0x74, 0x5D, 0x3C, 0x45, 0x1B, 0x30, 0x2C, 0x93, 0x46, 0xD9, 0xB7, 0xE4,
  2031. 0x85, 0xE7, 0xBC, 0xE4, 0x1F, 0x6B, 0x59, 0x1F, 0x3E, 0x8F, 0x6A, 0xDD,
  2032. 0xCB, 0xB0, 0xBC, 0x4C, 0x2F, 0x94, 0x7A, 0x7D, 0xE1, 0xA8, 0x9B, 0x62,
  2033. 0x5D, 0x6A, 0x59, 0x8B, 0x37, 0x60,
  2034. /* order */
  2035. 0x00, 0x03, 0x40, 0x34, 0x03, 0x40, 0x34, 0x03, 0x40, 0x34, 0x03, 0x40,
  2036. 0x34, 0x03, 0x40, 0x34, 0x03, 0x40, 0x34, 0x03, 0x40, 0x34, 0x03, 0x40,
  2037. 0x34, 0x03, 0x40, 0x34, 0x03, 0x23, 0xC3, 0x13, 0xFA, 0xB5, 0x05, 0x89,
  2038. 0x70, 0x3B, 0x5E, 0xC6, 0x8D, 0x35, 0x87, 0xFE, 0xC6, 0x0D, 0x16, 0x1C,
  2039. 0xC1, 0x49, 0xC1, 0xAD, 0x4A, 0x91
  2040. }
  2041. };
  2042. static const struct {
  2043. EC_CURVE_DATA h;
  2044. unsigned char data[0 + 15 * 6];
  2045. } _EC_WTLS_1 = {
  2046. {
  2047. NID_X9_62_characteristic_two_field, 0, 15, 2
  2048. },
  2049. {
  2050. /* no seed */
  2051. /* p */
  2052. 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  2053. 0x00, 0x02, 0x01,
  2054. /* a */
  2055. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  2056. 0x00, 0x00, 0x01,
  2057. /* b */
  2058. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  2059. 0x00, 0x00, 0x01,
  2060. /* x */
  2061. 0x01, 0x66, 0x79, 0x79, 0xA4, 0x0B, 0xA4, 0x97, 0xE5, 0xD5, 0xC2, 0x70,
  2062. 0x78, 0x06, 0x17,
  2063. /* y */
  2064. 0x00, 0xF4, 0x4B, 0x4A, 0xF1, 0xEC, 0xC2, 0x63, 0x0E, 0x08, 0x78, 0x5C,
  2065. 0xEB, 0xCC, 0x15,
  2066. /* order */
  2067. 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFD, 0xBF, 0x91, 0xAF,
  2068. 0x6D, 0xEA, 0x73
  2069. }
  2070. };
  2071. /* IPSec curves */
  2072. /*
  2073. * NOTE: The of curves over a extension field of non prime degree is not
  2074. * recommended (Weil-descent). As the group order is not a prime this curve
  2075. * is not suitable for ECDSA.
  2076. */
  2077. static const struct {
  2078. EC_CURVE_DATA h;
  2079. unsigned char data[0 + 20 * 6];
  2080. } _EC_IPSEC_155_ID3 = {
  2081. {
  2082. NID_X9_62_characteristic_two_field, 0, 20, 3
  2083. },
  2084. {
  2085. /* no seed */
  2086. /* p */
  2087. 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  2088. 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
  2089. /* a */
  2090. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  2091. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  2092. /* b */
  2093. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  2094. 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x33, 0x8f,
  2095. /* x */
  2096. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  2097. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7b,
  2098. /* y */
  2099. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  2100. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xc8,
  2101. /* order */
  2102. 0x02, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xC7, 0xF3,
  2103. 0xC7, 0x88, 0x1B, 0xD0, 0x86, 0x8F, 0xA8, 0x6C
  2104. }
  2105. };
  2106. /*
  2107. * NOTE: The of curves over a extension field of non prime degree is not
  2108. * recommended (Weil-descent). As the group order is not a prime this curve
  2109. * is not suitable for ECDSA.
  2110. */
  2111. static const struct {
  2112. EC_CURVE_DATA h;
  2113. unsigned char data[0 + 24 * 6];
  2114. } _EC_IPSEC_185_ID4 = {
  2115. {
  2116. NID_X9_62_characteristic_two_field, 0, 24, 2
  2117. },
  2118. {
  2119. /* no seed */
  2120. /* p */
  2121. 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  2122. 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
  2123. /* a */
  2124. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  2125. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  2126. /* b */
  2127. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  2128. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1e, 0xe9,
  2129. /* x */
  2130. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  2131. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18,
  2132. /* y */
  2133. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  2134. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0d,
  2135. /* order */
  2136. 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
  2137. 0xED, 0xF9, 0x7C, 0x44, 0xDB, 0x9F, 0x24, 0x20, 0xBA, 0xFC, 0xA7, 0x5E
  2138. }
  2139. };
  2140. #endif
  2141. /*
  2142. * These curves were added by Annie Yousar.
  2143. * For the definition of RFC 5639 curves see
  2144. * http://www.ietf.org/rfc/rfc5639.txt These curves are generated verifiable
  2145. * at random, nevertheless the seed is omitted as parameter because the
  2146. * generation mechanism is different from those defined in ANSI X9.62.
  2147. */
  2148. static const struct {
  2149. EC_CURVE_DATA h;
  2150. unsigned char data[0 + 20 * 6];
  2151. } _EC_brainpoolP160r1 = {
  2152. {
  2153. NID_X9_62_prime_field, 0, 20, 1
  2154. },
  2155. {
  2156. /* no seed */
  2157. /* p */
  2158. 0xE9, 0x5E, 0x4A, 0x5F, 0x73, 0x70, 0x59, 0xDC, 0x60, 0xDF, 0xC7, 0xAD,
  2159. 0x95, 0xB3, 0xD8, 0x13, 0x95, 0x15, 0x62, 0x0F,
  2160. /* a */
  2161. 0x34, 0x0E, 0x7B, 0xE2, 0xA2, 0x80, 0xEB, 0x74, 0xE2, 0xBE, 0x61, 0xBA,
  2162. 0xDA, 0x74, 0x5D, 0x97, 0xE8, 0xF7, 0xC3, 0x00,
  2163. /* b */
  2164. 0x1E, 0x58, 0x9A, 0x85, 0x95, 0x42, 0x34, 0x12, 0x13, 0x4F, 0xAA, 0x2D,
  2165. 0xBD, 0xEC, 0x95, 0xC8, 0xD8, 0x67, 0x5E, 0x58,
  2166. /* x */
  2167. 0xBE, 0xD5, 0xAF, 0x16, 0xEA, 0x3F, 0x6A, 0x4F, 0x62, 0x93, 0x8C, 0x46,
  2168. 0x31, 0xEB, 0x5A, 0xF7, 0xBD, 0xBC, 0xDB, 0xC3,
  2169. /* y */
  2170. 0x16, 0x67, 0xCB, 0x47, 0x7A, 0x1A, 0x8E, 0xC3, 0x38, 0xF9, 0x47, 0x41,
  2171. 0x66, 0x9C, 0x97, 0x63, 0x16, 0xDA, 0x63, 0x21,
  2172. /* order */
  2173. 0xE9, 0x5E, 0x4A, 0x5F, 0x73, 0x70, 0x59, 0xDC, 0x60, 0xDF, 0x59, 0x91,
  2174. 0xD4, 0x50, 0x29, 0x40, 0x9E, 0x60, 0xFC, 0x09
  2175. }
  2176. };
  2177. static const struct {
  2178. EC_CURVE_DATA h;
  2179. unsigned char data[0 + 20 * 6];
  2180. } _EC_brainpoolP160t1 = {
  2181. {
  2182. NID_X9_62_prime_field, 0, 20, 1
  2183. },
  2184. {
  2185. /* no seed */
  2186. /* p */
  2187. 0xE9, 0x5E, 0x4A, 0x5F, 0x73, 0x70, 0x59, 0xDC, 0x60, 0xDF, 0xC7, 0xAD,
  2188. 0x95, 0xB3, 0xD8, 0x13, 0x95, 0x15, 0x62, 0x0F,
  2189. /* a */
  2190. 0xE9, 0x5E, 0x4A, 0x5F, 0x73, 0x70, 0x59, 0xDC, 0x60, 0xDF, 0xC7, 0xAD,
  2191. 0x95, 0xB3, 0xD8, 0x13, 0x95, 0x15, 0x62, 0x0C,
  2192. /* b */
  2193. 0x7A, 0x55, 0x6B, 0x6D, 0xAE, 0x53, 0x5B, 0x7B, 0x51, 0xED, 0x2C, 0x4D,
  2194. 0x7D, 0xAA, 0x7A, 0x0B, 0x5C, 0x55, 0xF3, 0x80,
  2195. /* x */
  2196. 0xB1, 0x99, 0xB1, 0x3B, 0x9B, 0x34, 0xEF, 0xC1, 0x39, 0x7E, 0x64, 0xBA,
  2197. 0xEB, 0x05, 0xAC, 0xC2, 0x65, 0xFF, 0x23, 0x78,
  2198. /* y */
  2199. 0xAD, 0xD6, 0x71, 0x8B, 0x7C, 0x7C, 0x19, 0x61, 0xF0, 0x99, 0x1B, 0x84,
  2200. 0x24, 0x43, 0x77, 0x21, 0x52, 0xC9, 0xE0, 0xAD,
  2201. /* order */
  2202. 0xE9, 0x5E, 0x4A, 0x5F, 0x73, 0x70, 0x59, 0xDC, 0x60, 0xDF, 0x59, 0x91,
  2203. 0xD4, 0x50, 0x29, 0x40, 0x9E, 0x60, 0xFC, 0x09
  2204. }
  2205. };
  2206. static const struct {
  2207. EC_CURVE_DATA h;
  2208. unsigned char data[0 + 24 * 6];
  2209. } _EC_brainpoolP192r1 = {
  2210. {
  2211. NID_X9_62_prime_field, 0, 24, 1
  2212. },
  2213. {
  2214. /* no seed */
  2215. /* p */
  2216. 0xC3, 0x02, 0xF4, 0x1D, 0x93, 0x2A, 0x36, 0xCD, 0xA7, 0xA3, 0x46, 0x30,
  2217. 0x93, 0xD1, 0x8D, 0xB7, 0x8F, 0xCE, 0x47, 0x6D, 0xE1, 0xA8, 0x62, 0x97,
  2218. /* a */
  2219. 0x6A, 0x91, 0x17, 0x40, 0x76, 0xB1, 0xE0, 0xE1, 0x9C, 0x39, 0xC0, 0x31,
  2220. 0xFE, 0x86, 0x85, 0xC1, 0xCA, 0xE0, 0x40, 0xE5, 0xC6, 0x9A, 0x28, 0xEF,
  2221. /* b */
  2222. 0x46, 0x9A, 0x28, 0xEF, 0x7C, 0x28, 0xCC, 0xA3, 0xDC, 0x72, 0x1D, 0x04,
  2223. 0x4F, 0x44, 0x96, 0xBC, 0xCA, 0x7E, 0xF4, 0x14, 0x6F, 0xBF, 0x25, 0xC9,
  2224. /* x */
  2225. 0xC0, 0xA0, 0x64, 0x7E, 0xAA, 0xB6, 0xA4, 0x87, 0x53, 0xB0, 0x33, 0xC5,
  2226. 0x6C, 0xB0, 0xF0, 0x90, 0x0A, 0x2F, 0x5C, 0x48, 0x53, 0x37, 0x5F, 0xD6,
  2227. /* y */
  2228. 0x14, 0xB6, 0x90, 0x86, 0x6A, 0xBD, 0x5B, 0xB8, 0x8B, 0x5F, 0x48, 0x28,
  2229. 0xC1, 0x49, 0x00, 0x02, 0xE6, 0x77, 0x3F, 0xA2, 0xFA, 0x29, 0x9B, 0x8F,
  2230. /* order */
  2231. 0xC3, 0x02, 0xF4, 0x1D, 0x93, 0x2A, 0x36, 0xCD, 0xA7, 0xA3, 0x46, 0x2F,
  2232. 0x9E, 0x9E, 0x91, 0x6B, 0x5B, 0xE8, 0xF1, 0x02, 0x9A, 0xC4, 0xAC, 0xC1
  2233. }
  2234. };
  2235. static const struct {
  2236. EC_CURVE_DATA h;
  2237. unsigned char data[0 + 24 * 6];
  2238. } _EC_brainpoolP192t1 = {
  2239. {
  2240. NID_X9_62_prime_field, 0, 24, 1
  2241. },
  2242. {
  2243. /* no seed */
  2244. /* p */
  2245. 0xC3, 0x02, 0xF4, 0x1D, 0x93, 0x2A, 0x36, 0xCD, 0xA7, 0xA3, 0x46, 0x30,
  2246. 0x93, 0xD1, 0x8D, 0xB7, 0x8F, 0xCE, 0x47, 0x6D, 0xE1, 0xA8, 0x62, 0x97,
  2247. /* a */
  2248. 0xC3, 0x02, 0xF4, 0x1D, 0x93, 0x2A, 0x36, 0xCD, 0xA7, 0xA3, 0x46, 0x30,
  2249. 0x93, 0xD1, 0x8D, 0xB7, 0x8F, 0xCE, 0x47, 0x6D, 0xE1, 0xA8, 0x62, 0x94,
  2250. /* b */
  2251. 0x13, 0xD5, 0x6F, 0xFA, 0xEC, 0x78, 0x68, 0x1E, 0x68, 0xF9, 0xDE, 0xB4,
  2252. 0x3B, 0x35, 0xBE, 0xC2, 0xFB, 0x68, 0x54, 0x2E, 0x27, 0x89, 0x7B, 0x79,
  2253. /* x */
  2254. 0x3A, 0xE9, 0xE5, 0x8C, 0x82, 0xF6, 0x3C, 0x30, 0x28, 0x2E, 0x1F, 0xE7,
  2255. 0xBB, 0xF4, 0x3F, 0xA7, 0x2C, 0x44, 0x6A, 0xF6, 0xF4, 0x61, 0x81, 0x29,
  2256. /* y */
  2257. 0x09, 0x7E, 0x2C, 0x56, 0x67, 0xC2, 0x22, 0x3A, 0x90, 0x2A, 0xB5, 0xCA,
  2258. 0x44, 0x9D, 0x00, 0x84, 0xB7, 0xE5, 0xB3, 0xDE, 0x7C, 0xCC, 0x01, 0xC9,
  2259. /* order */
  2260. 0xC3, 0x02, 0xF4, 0x1D, 0x93, 0x2A, 0x36, 0xCD, 0xA7, 0xA3, 0x46, 0x2F,
  2261. 0x9E, 0x9E, 0x91, 0x6B, 0x5B, 0xE8, 0xF1, 0x02, 0x9A, 0xC4, 0xAC, 0xC1
  2262. }
  2263. };
  2264. static const struct {
  2265. EC_CURVE_DATA h;
  2266. unsigned char data[0 + 28 * 6];
  2267. } _EC_brainpoolP224r1 = {
  2268. {
  2269. NID_X9_62_prime_field, 0, 28, 1
  2270. },
  2271. {
  2272. /* no seed */
  2273. /* p */
  2274. 0xD7, 0xC1, 0x34, 0xAA, 0x26, 0x43, 0x66, 0x86, 0x2A, 0x18, 0x30, 0x25,
  2275. 0x75, 0xD1, 0xD7, 0x87, 0xB0, 0x9F, 0x07, 0x57, 0x97, 0xDA, 0x89, 0xF5,
  2276. 0x7E, 0xC8, 0xC0, 0xFF,
  2277. /* a */
  2278. 0x68, 0xA5, 0xE6, 0x2C, 0xA9, 0xCE, 0x6C, 0x1C, 0x29, 0x98, 0x03, 0xA6,
  2279. 0xC1, 0x53, 0x0B, 0x51, 0x4E, 0x18, 0x2A, 0xD8, 0xB0, 0x04, 0x2A, 0x59,
  2280. 0xCA, 0xD2, 0x9F, 0x43,
  2281. /* b */
  2282. 0x25, 0x80, 0xF6, 0x3C, 0xCF, 0xE4, 0x41, 0x38, 0x87, 0x07, 0x13, 0xB1,
  2283. 0xA9, 0x23, 0x69, 0xE3, 0x3E, 0x21, 0x35, 0xD2, 0x66, 0xDB, 0xB3, 0x72,
  2284. 0x38, 0x6C, 0x40, 0x0B,
  2285. /* x */
  2286. 0x0D, 0x90, 0x29, 0xAD, 0x2C, 0x7E, 0x5C, 0xF4, 0x34, 0x08, 0x23, 0xB2,
  2287. 0xA8, 0x7D, 0xC6, 0x8C, 0x9E, 0x4C, 0xE3, 0x17, 0x4C, 0x1E, 0x6E, 0xFD,
  2288. 0xEE, 0x12, 0xC0, 0x7D,
  2289. /* y */
  2290. 0x58, 0xAA, 0x56, 0xF7, 0x72, 0xC0, 0x72, 0x6F, 0x24, 0xC6, 0xB8, 0x9E,
  2291. 0x4E, 0xCD, 0xAC, 0x24, 0x35, 0x4B, 0x9E, 0x99, 0xCA, 0xA3, 0xF6, 0xD3,
  2292. 0x76, 0x14, 0x02, 0xCD,
  2293. /* order */
  2294. 0xD7, 0xC1, 0x34, 0xAA, 0x26, 0x43, 0x66, 0x86, 0x2A, 0x18, 0x30, 0x25,
  2295. 0x75, 0xD0, 0xFB, 0x98, 0xD1, 0x16, 0xBC, 0x4B, 0x6D, 0xDE, 0xBC, 0xA3,
  2296. 0xA5, 0xA7, 0x93, 0x9F
  2297. }
  2298. };
  2299. static const struct {
  2300. EC_CURVE_DATA h;
  2301. unsigned char data[0 + 28 * 6];
  2302. } _EC_brainpoolP224t1 = {
  2303. {
  2304. NID_X9_62_prime_field, 0, 28, 1
  2305. },
  2306. {
  2307. /* no seed */
  2308. /* p */
  2309. 0xD7, 0xC1, 0x34, 0xAA, 0x26, 0x43, 0x66, 0x86, 0x2A, 0x18, 0x30, 0x25,
  2310. 0x75, 0xD1, 0xD7, 0x87, 0xB0, 0x9F, 0x07, 0x57, 0x97, 0xDA, 0x89, 0xF5,
  2311. 0x7E, 0xC8, 0xC0, 0xFF,
  2312. /* a */
  2313. 0xD7, 0xC1, 0x34, 0xAA, 0x26, 0x43, 0x66, 0x86, 0x2A, 0x18, 0x30, 0x25,
  2314. 0x75, 0xD1, 0xD7, 0x87, 0xB0, 0x9F, 0x07, 0x57, 0x97, 0xDA, 0x89, 0xF5,
  2315. 0x7E, 0xC8, 0xC0, 0xFC,
  2316. /* b */
  2317. 0x4B, 0x33, 0x7D, 0x93, 0x41, 0x04, 0xCD, 0x7B, 0xEF, 0x27, 0x1B, 0xF6,
  2318. 0x0C, 0xED, 0x1E, 0xD2, 0x0D, 0xA1, 0x4C, 0x08, 0xB3, 0xBB, 0x64, 0xF1,
  2319. 0x8A, 0x60, 0x88, 0x8D,
  2320. /* x */
  2321. 0x6A, 0xB1, 0xE3, 0x44, 0xCE, 0x25, 0xFF, 0x38, 0x96, 0x42, 0x4E, 0x7F,
  2322. 0xFE, 0x14, 0x76, 0x2E, 0xCB, 0x49, 0xF8, 0x92, 0x8A, 0xC0, 0xC7, 0x60,
  2323. 0x29, 0xB4, 0xD5, 0x80,
  2324. /* y */
  2325. 0x03, 0x74, 0xE9, 0xF5, 0x14, 0x3E, 0x56, 0x8C, 0xD2, 0x3F, 0x3F, 0x4D,
  2326. 0x7C, 0x0D, 0x4B, 0x1E, 0x41, 0xC8, 0xCC, 0x0D, 0x1C, 0x6A, 0xBD, 0x5F,
  2327. 0x1A, 0x46, 0xDB, 0x4C,
  2328. /* order */
  2329. 0xD7, 0xC1, 0x34, 0xAA, 0x26, 0x43, 0x66, 0x86, 0x2A, 0x18, 0x30, 0x25,
  2330. 0x75, 0xD0, 0xFB, 0x98, 0xD1, 0x16, 0xBC, 0x4B, 0x6D, 0xDE, 0xBC, 0xA3,
  2331. 0xA5, 0xA7, 0x93, 0x9F
  2332. }
  2333. };
  2334. static const struct {
  2335. EC_CURVE_DATA h;
  2336. unsigned char data[0 + 32 * 6];
  2337. } _EC_brainpoolP256r1 = {
  2338. {
  2339. NID_X9_62_prime_field, 0, 32, 1
  2340. },
  2341. {
  2342. /* no seed */
  2343. /* p */
  2344. 0xA9, 0xFB, 0x57, 0xDB, 0xA1, 0xEE, 0xA9, 0xBC, 0x3E, 0x66, 0x0A, 0x90,
  2345. 0x9D, 0x83, 0x8D, 0x72, 0x6E, 0x3B, 0xF6, 0x23, 0xD5, 0x26, 0x20, 0x28,
  2346. 0x20, 0x13, 0x48, 0x1D, 0x1F, 0x6E, 0x53, 0x77,
  2347. /* a */
  2348. 0x7D, 0x5A, 0x09, 0x75, 0xFC, 0x2C, 0x30, 0x57, 0xEE, 0xF6, 0x75, 0x30,
  2349. 0x41, 0x7A, 0xFF, 0xE7, 0xFB, 0x80, 0x55, 0xC1, 0x26, 0xDC, 0x5C, 0x6C,
  2350. 0xE9, 0x4A, 0x4B, 0x44, 0xF3, 0x30, 0xB5, 0xD9,
  2351. /* b */
  2352. 0x26, 0xDC, 0x5C, 0x6C, 0xE9, 0x4A, 0x4B, 0x44, 0xF3, 0x30, 0xB5, 0xD9,
  2353. 0xBB, 0xD7, 0x7C, 0xBF, 0x95, 0x84, 0x16, 0x29, 0x5C, 0xF7, 0xE1, 0xCE,
  2354. 0x6B, 0xCC, 0xDC, 0x18, 0xFF, 0x8C, 0x07, 0xB6,
  2355. /* x */
  2356. 0x8B, 0xD2, 0xAE, 0xB9, 0xCB, 0x7E, 0x57, 0xCB, 0x2C, 0x4B, 0x48, 0x2F,
  2357. 0xFC, 0x81, 0xB7, 0xAF, 0xB9, 0xDE, 0x27, 0xE1, 0xE3, 0xBD, 0x23, 0xC2,
  2358. 0x3A, 0x44, 0x53, 0xBD, 0x9A, 0xCE, 0x32, 0x62,
  2359. /* y */
  2360. 0x54, 0x7E, 0xF8, 0x35, 0xC3, 0xDA, 0xC4, 0xFD, 0x97, 0xF8, 0x46, 0x1A,
  2361. 0x14, 0x61, 0x1D, 0xC9, 0xC2, 0x77, 0x45, 0x13, 0x2D, 0xED, 0x8E, 0x54,
  2362. 0x5C, 0x1D, 0x54, 0xC7, 0x2F, 0x04, 0x69, 0x97,
  2363. /* order */
  2364. 0xA9, 0xFB, 0x57, 0xDB, 0xA1, 0xEE, 0xA9, 0xBC, 0x3E, 0x66, 0x0A, 0x90,
  2365. 0x9D, 0x83, 0x8D, 0x71, 0x8C, 0x39, 0x7A, 0xA3, 0xB5, 0x61, 0xA6, 0xF7,
  2366. 0x90, 0x1E, 0x0E, 0x82, 0x97, 0x48, 0x56, 0xA7
  2367. }
  2368. };
  2369. static const struct {
  2370. EC_CURVE_DATA h;
  2371. unsigned char data[0 + 32 * 6];
  2372. } _EC_brainpoolP256t1 = {
  2373. {
  2374. NID_X9_62_prime_field, 0, 32, 1
  2375. },
  2376. {
  2377. /* no seed */
  2378. /* p */
  2379. 0xA9, 0xFB, 0x57, 0xDB, 0xA1, 0xEE, 0xA9, 0xBC, 0x3E, 0x66, 0x0A, 0x90,
  2380. 0x9D, 0x83, 0x8D, 0x72, 0x6E, 0x3B, 0xF6, 0x23, 0xD5, 0x26, 0x20, 0x28,
  2381. 0x20, 0x13, 0x48, 0x1D, 0x1F, 0x6E, 0x53, 0x77,
  2382. /* a */
  2383. 0xA9, 0xFB, 0x57, 0xDB, 0xA1, 0xEE, 0xA9, 0xBC, 0x3E, 0x66, 0x0A, 0x90,
  2384. 0x9D, 0x83, 0x8D, 0x72, 0x6E, 0x3B, 0xF6, 0x23, 0xD5, 0x26, 0x20, 0x28,
  2385. 0x20, 0x13, 0x48, 0x1D, 0x1F, 0x6E, 0x53, 0x74,
  2386. /* b */
  2387. 0x66, 0x2C, 0x61, 0xC4, 0x30, 0xD8, 0x4E, 0xA4, 0xFE, 0x66, 0xA7, 0x73,
  2388. 0x3D, 0x0B, 0x76, 0xB7, 0xBF, 0x93, 0xEB, 0xC4, 0xAF, 0x2F, 0x49, 0x25,
  2389. 0x6A, 0xE5, 0x81, 0x01, 0xFE, 0xE9, 0x2B, 0x04,
  2390. /* x */
  2391. 0xA3, 0xE8, 0xEB, 0x3C, 0xC1, 0xCF, 0xE7, 0xB7, 0x73, 0x22, 0x13, 0xB2,
  2392. 0x3A, 0x65, 0x61, 0x49, 0xAF, 0xA1, 0x42, 0xC4, 0x7A, 0xAF, 0xBC, 0x2B,
  2393. 0x79, 0xA1, 0x91, 0x56, 0x2E, 0x13, 0x05, 0xF4,
  2394. /* y */
  2395. 0x2D, 0x99, 0x6C, 0x82, 0x34, 0x39, 0xC5, 0x6D, 0x7F, 0x7B, 0x22, 0xE1,
  2396. 0x46, 0x44, 0x41, 0x7E, 0x69, 0xBC, 0xB6, 0xDE, 0x39, 0xD0, 0x27, 0x00,
  2397. 0x1D, 0xAB, 0xE8, 0xF3, 0x5B, 0x25, 0xC9, 0xBE,
  2398. /* order */
  2399. 0xA9, 0xFB, 0x57, 0xDB, 0xA1, 0xEE, 0xA9, 0xBC, 0x3E, 0x66, 0x0A, 0x90,
  2400. 0x9D, 0x83, 0x8D, 0x71, 0x8C, 0x39, 0x7A, 0xA3, 0xB5, 0x61, 0xA6, 0xF7,
  2401. 0x90, 0x1E, 0x0E, 0x82, 0x97, 0x48, 0x56, 0xA7
  2402. }
  2403. };
  2404. static const struct {
  2405. EC_CURVE_DATA h;
  2406. unsigned char data[0 + 40 * 6];
  2407. } _EC_brainpoolP320r1 = {
  2408. {
  2409. NID_X9_62_prime_field, 0, 40, 1
  2410. },
  2411. {
  2412. /* no seed */
  2413. /* p */
  2414. 0xD3, 0x5E, 0x47, 0x20, 0x36, 0xBC, 0x4F, 0xB7, 0xE1, 0x3C, 0x78, 0x5E,
  2415. 0xD2, 0x01, 0xE0, 0x65, 0xF9, 0x8F, 0xCF, 0xA6, 0xF6, 0xF4, 0x0D, 0xEF,
  2416. 0x4F, 0x92, 0xB9, 0xEC, 0x78, 0x93, 0xEC, 0x28, 0xFC, 0xD4, 0x12, 0xB1,
  2417. 0xF1, 0xB3, 0x2E, 0x27,
  2418. /* a */
  2419. 0x3E, 0xE3, 0x0B, 0x56, 0x8F, 0xBA, 0xB0, 0xF8, 0x83, 0xCC, 0xEB, 0xD4,
  2420. 0x6D, 0x3F, 0x3B, 0xB8, 0xA2, 0xA7, 0x35, 0x13, 0xF5, 0xEB, 0x79, 0xDA,
  2421. 0x66, 0x19, 0x0E, 0xB0, 0x85, 0xFF, 0xA9, 0xF4, 0x92, 0xF3, 0x75, 0xA9,
  2422. 0x7D, 0x86, 0x0E, 0xB4,
  2423. /* b */
  2424. 0x52, 0x08, 0x83, 0x94, 0x9D, 0xFD, 0xBC, 0x42, 0xD3, 0xAD, 0x19, 0x86,
  2425. 0x40, 0x68, 0x8A, 0x6F, 0xE1, 0x3F, 0x41, 0x34, 0x95, 0x54, 0xB4, 0x9A,
  2426. 0xCC, 0x31, 0xDC, 0xCD, 0x88, 0x45, 0x39, 0x81, 0x6F, 0x5E, 0xB4, 0xAC,
  2427. 0x8F, 0xB1, 0xF1, 0xA6,
  2428. /* x */
  2429. 0x43, 0xBD, 0x7E, 0x9A, 0xFB, 0x53, 0xD8, 0xB8, 0x52, 0x89, 0xBC, 0xC4,
  2430. 0x8E, 0xE5, 0xBF, 0xE6, 0xF2, 0x01, 0x37, 0xD1, 0x0A, 0x08, 0x7E, 0xB6,
  2431. 0xE7, 0x87, 0x1E, 0x2A, 0x10, 0xA5, 0x99, 0xC7, 0x10, 0xAF, 0x8D, 0x0D,
  2432. 0x39, 0xE2, 0x06, 0x11,
  2433. /* y */
  2434. 0x14, 0xFD, 0xD0, 0x55, 0x45, 0xEC, 0x1C, 0xC8, 0xAB, 0x40, 0x93, 0x24,
  2435. 0x7F, 0x77, 0x27, 0x5E, 0x07, 0x43, 0xFF, 0xED, 0x11, 0x71, 0x82, 0xEA,
  2436. 0xA9, 0xC7, 0x78, 0x77, 0xAA, 0xAC, 0x6A, 0xC7, 0xD3, 0x52, 0x45, 0xD1,
  2437. 0x69, 0x2E, 0x8E, 0xE1,
  2438. /* order */
  2439. 0xD3, 0x5E, 0x47, 0x20, 0x36, 0xBC, 0x4F, 0xB7, 0xE1, 0x3C, 0x78, 0x5E,
  2440. 0xD2, 0x01, 0xE0, 0x65, 0xF9, 0x8F, 0xCF, 0xA5, 0xB6, 0x8F, 0x12, 0xA3,
  2441. 0x2D, 0x48, 0x2E, 0xC7, 0xEE, 0x86, 0x58, 0xE9, 0x86, 0x91, 0x55, 0x5B,
  2442. 0x44, 0xC5, 0x93, 0x11
  2443. }
  2444. };
  2445. static const struct {
  2446. EC_CURVE_DATA h;
  2447. unsigned char data[0 + 40 * 6];
  2448. } _EC_brainpoolP320t1 = {
  2449. {
  2450. NID_X9_62_prime_field, 0, 40, 1
  2451. },
  2452. {
  2453. /* no seed */
  2454. /* p */
  2455. 0xD3, 0x5E, 0x47, 0x20, 0x36, 0xBC, 0x4F, 0xB7, 0xE1, 0x3C, 0x78, 0x5E,
  2456. 0xD2, 0x01, 0xE0, 0x65, 0xF9, 0x8F, 0xCF, 0xA6, 0xF6, 0xF4, 0x0D, 0xEF,
  2457. 0x4F, 0x92, 0xB9, 0xEC, 0x78, 0x93, 0xEC, 0x28, 0xFC, 0xD4, 0x12, 0xB1,
  2458. 0xF1, 0xB3, 0x2E, 0x27,
  2459. /* a */
  2460. 0xD3, 0x5E, 0x47, 0x20, 0x36, 0xBC, 0x4F, 0xB7, 0xE1, 0x3C, 0x78, 0x5E,
  2461. 0xD2, 0x01, 0xE0, 0x65, 0xF9, 0x8F, 0xCF, 0xA6, 0xF6, 0xF4, 0x0D, 0xEF,
  2462. 0x4F, 0x92, 0xB9, 0xEC, 0x78, 0x93, 0xEC, 0x28, 0xFC, 0xD4, 0x12, 0xB1,
  2463. 0xF1, 0xB3, 0x2E, 0x24,
  2464. /* b */
  2465. 0xA7, 0xF5, 0x61, 0xE0, 0x38, 0xEB, 0x1E, 0xD5, 0x60, 0xB3, 0xD1, 0x47,
  2466. 0xDB, 0x78, 0x20, 0x13, 0x06, 0x4C, 0x19, 0xF2, 0x7E, 0xD2, 0x7C, 0x67,
  2467. 0x80, 0xAA, 0xF7, 0x7F, 0xB8, 0xA5, 0x47, 0xCE, 0xB5, 0xB4, 0xFE, 0xF4,
  2468. 0x22, 0x34, 0x03, 0x53,
  2469. /* x */
  2470. 0x92, 0x5B, 0xE9, 0xFB, 0x01, 0xAF, 0xC6, 0xFB, 0x4D, 0x3E, 0x7D, 0x49,
  2471. 0x90, 0x01, 0x0F, 0x81, 0x34, 0x08, 0xAB, 0x10, 0x6C, 0x4F, 0x09, 0xCB,
  2472. 0x7E, 0xE0, 0x78, 0x68, 0xCC, 0x13, 0x6F, 0xFF, 0x33, 0x57, 0xF6, 0x24,
  2473. 0xA2, 0x1B, 0xED, 0x52,
  2474. /* y */
  2475. 0x63, 0xBA, 0x3A, 0x7A, 0x27, 0x48, 0x3E, 0xBF, 0x66, 0x71, 0xDB, 0xEF,
  2476. 0x7A, 0xBB, 0x30, 0xEB, 0xEE, 0x08, 0x4E, 0x58, 0xA0, 0xB0, 0x77, 0xAD,
  2477. 0x42, 0xA5, 0xA0, 0x98, 0x9D, 0x1E, 0xE7, 0x1B, 0x1B, 0x9B, 0xC0, 0x45,
  2478. 0x5F, 0xB0, 0xD2, 0xC3,
  2479. /* order */
  2480. 0xD3, 0x5E, 0x47, 0x20, 0x36, 0xBC, 0x4F, 0xB7, 0xE1, 0x3C, 0x78, 0x5E,
  2481. 0xD2, 0x01, 0xE0, 0x65, 0xF9, 0x8F, 0xCF, 0xA5, 0xB6, 0x8F, 0x12, 0xA3,
  2482. 0x2D, 0x48, 0x2E, 0xC7, 0xEE, 0x86, 0x58, 0xE9, 0x86, 0x91, 0x55, 0x5B,
  2483. 0x44, 0xC5, 0x93, 0x11
  2484. }
  2485. };
  2486. static const struct {
  2487. EC_CURVE_DATA h;
  2488. unsigned char data[0 + 48 * 6];
  2489. } _EC_brainpoolP384r1 = {
  2490. {
  2491. NID_X9_62_prime_field, 0, 48, 1
  2492. },
  2493. {
  2494. /* no seed */
  2495. /* p */
  2496. 0x8C, 0xB9, 0x1E, 0x82, 0xA3, 0x38, 0x6D, 0x28, 0x0F, 0x5D, 0x6F, 0x7E,
  2497. 0x50, 0xE6, 0x41, 0xDF, 0x15, 0x2F, 0x71, 0x09, 0xED, 0x54, 0x56, 0xB4,
  2498. 0x12, 0xB1, 0xDA, 0x19, 0x7F, 0xB7, 0x11, 0x23, 0xAC, 0xD3, 0xA7, 0x29,
  2499. 0x90, 0x1D, 0x1A, 0x71, 0x87, 0x47, 0x00, 0x13, 0x31, 0x07, 0xEC, 0x53,
  2500. /* a */
  2501. 0x7B, 0xC3, 0x82, 0xC6, 0x3D, 0x8C, 0x15, 0x0C, 0x3C, 0x72, 0x08, 0x0A,
  2502. 0xCE, 0x05, 0xAF, 0xA0, 0xC2, 0xBE, 0xA2, 0x8E, 0x4F, 0xB2, 0x27, 0x87,
  2503. 0x13, 0x91, 0x65, 0xEF, 0xBA, 0x91, 0xF9, 0x0F, 0x8A, 0xA5, 0x81, 0x4A,
  2504. 0x50, 0x3A, 0xD4, 0xEB, 0x04, 0xA8, 0xC7, 0xDD, 0x22, 0xCE, 0x28, 0x26,
  2505. /* b */
  2506. 0x04, 0xA8, 0xC7, 0xDD, 0x22, 0xCE, 0x28, 0x26, 0x8B, 0x39, 0xB5, 0x54,
  2507. 0x16, 0xF0, 0x44, 0x7C, 0x2F, 0xB7, 0x7D, 0xE1, 0x07, 0xDC, 0xD2, 0xA6,
  2508. 0x2E, 0x88, 0x0E, 0xA5, 0x3E, 0xEB, 0x62, 0xD5, 0x7C, 0xB4, 0x39, 0x02,
  2509. 0x95, 0xDB, 0xC9, 0x94, 0x3A, 0xB7, 0x86, 0x96, 0xFA, 0x50, 0x4C, 0x11,
  2510. /* x */
  2511. 0x1D, 0x1C, 0x64, 0xF0, 0x68, 0xCF, 0x45, 0xFF, 0xA2, 0xA6, 0x3A, 0x81,
  2512. 0xB7, 0xC1, 0x3F, 0x6B, 0x88, 0x47, 0xA3, 0xE7, 0x7E, 0xF1, 0x4F, 0xE3,
  2513. 0xDB, 0x7F, 0xCA, 0xFE, 0x0C, 0xBD, 0x10, 0xE8, 0xE8, 0x26, 0xE0, 0x34,
  2514. 0x36, 0xD6, 0x46, 0xAA, 0xEF, 0x87, 0xB2, 0xE2, 0x47, 0xD4, 0xAF, 0x1E,
  2515. /* y */
  2516. 0x8A, 0xBE, 0x1D, 0x75, 0x20, 0xF9, 0xC2, 0xA4, 0x5C, 0xB1, 0xEB, 0x8E,
  2517. 0x95, 0xCF, 0xD5, 0x52, 0x62, 0xB7, 0x0B, 0x29, 0xFE, 0xEC, 0x58, 0x64,
  2518. 0xE1, 0x9C, 0x05, 0x4F, 0xF9, 0x91, 0x29, 0x28, 0x0E, 0x46, 0x46, 0x21,
  2519. 0x77, 0x91, 0x81, 0x11, 0x42, 0x82, 0x03, 0x41, 0x26, 0x3C, 0x53, 0x15,
  2520. /* order */
  2521. 0x8C, 0xB9, 0x1E, 0x82, 0xA3, 0x38, 0x6D, 0x28, 0x0F, 0x5D, 0x6F, 0x7E,
  2522. 0x50, 0xE6, 0x41, 0xDF, 0x15, 0x2F, 0x71, 0x09, 0xED, 0x54, 0x56, 0xB3,
  2523. 0x1F, 0x16, 0x6E, 0x6C, 0xAC, 0x04, 0x25, 0xA7, 0xCF, 0x3A, 0xB6, 0xAF,
  2524. 0x6B, 0x7F, 0xC3, 0x10, 0x3B, 0x88, 0x32, 0x02, 0xE9, 0x04, 0x65, 0x65
  2525. }
  2526. };
  2527. static const struct {
  2528. EC_CURVE_DATA h;
  2529. unsigned char data[0 + 48 * 6];
  2530. } _EC_brainpoolP384t1 = {
  2531. {
  2532. NID_X9_62_prime_field, 0, 48, 1
  2533. },
  2534. {
  2535. /* no seed */
  2536. /* p */
  2537. 0x8C, 0xB9, 0x1E, 0x82, 0xA3, 0x38, 0x6D, 0x28, 0x0F, 0x5D, 0x6F, 0x7E,
  2538. 0x50, 0xE6, 0x41, 0xDF, 0x15, 0x2F, 0x71, 0x09, 0xED, 0x54, 0x56, 0xB4,
  2539. 0x12, 0xB1, 0xDA, 0x19, 0x7F, 0xB7, 0x11, 0x23, 0xAC, 0xD3, 0xA7, 0x29,
  2540. 0x90, 0x1D, 0x1A, 0x71, 0x87, 0x47, 0x00, 0x13, 0x31, 0x07, 0xEC, 0x53,
  2541. /* a */
  2542. 0x8C, 0xB9, 0x1E, 0x82, 0xA3, 0x38, 0x6D, 0x28, 0x0F, 0x5D, 0x6F, 0x7E,
  2543. 0x50, 0xE6, 0x41, 0xDF, 0x15, 0x2F, 0x71, 0x09, 0xED, 0x54, 0x56, 0xB4,
  2544. 0x12, 0xB1, 0xDA, 0x19, 0x7F, 0xB7, 0x11, 0x23, 0xAC, 0xD3, 0xA7, 0x29,
  2545. 0x90, 0x1D, 0x1A, 0x71, 0x87, 0x47, 0x00, 0x13, 0x31, 0x07, 0xEC, 0x50,
  2546. /* b */
  2547. 0x7F, 0x51, 0x9E, 0xAD, 0xA7, 0xBD, 0xA8, 0x1B, 0xD8, 0x26, 0xDB, 0xA6,
  2548. 0x47, 0x91, 0x0F, 0x8C, 0x4B, 0x93, 0x46, 0xED, 0x8C, 0xCD, 0xC6, 0x4E,
  2549. 0x4B, 0x1A, 0xBD, 0x11, 0x75, 0x6D, 0xCE, 0x1D, 0x20, 0x74, 0xAA, 0x26,
  2550. 0x3B, 0x88, 0x80, 0x5C, 0xED, 0x70, 0x35, 0x5A, 0x33, 0xB4, 0x71, 0xEE,
  2551. /* x */
  2552. 0x18, 0xDE, 0x98, 0xB0, 0x2D, 0xB9, 0xA3, 0x06, 0xF2, 0xAF, 0xCD, 0x72,
  2553. 0x35, 0xF7, 0x2A, 0x81, 0x9B, 0x80, 0xAB, 0x12, 0xEB, 0xD6, 0x53, 0x17,
  2554. 0x24, 0x76, 0xFE, 0xCD, 0x46, 0x2A, 0xAB, 0xFF, 0xC4, 0xFF, 0x19, 0x1B,
  2555. 0x94, 0x6A, 0x5F, 0x54, 0xD8, 0xD0, 0xAA, 0x2F, 0x41, 0x88, 0x08, 0xCC,
  2556. /* y */
  2557. 0x25, 0xAB, 0x05, 0x69, 0x62, 0xD3, 0x06, 0x51, 0xA1, 0x14, 0xAF, 0xD2,
  2558. 0x75, 0x5A, 0xD3, 0x36, 0x74, 0x7F, 0x93, 0x47, 0x5B, 0x7A, 0x1F, 0xCA,
  2559. 0x3B, 0x88, 0xF2, 0xB6, 0xA2, 0x08, 0xCC, 0xFE, 0x46, 0x94, 0x08, 0x58,
  2560. 0x4D, 0xC2, 0xB2, 0x91, 0x26, 0x75, 0xBF, 0x5B, 0x9E, 0x58, 0x29, 0x28,
  2561. /* order */
  2562. 0x8C, 0xB9, 0x1E, 0x82, 0xA3, 0x38, 0x6D, 0x28, 0x0F, 0x5D, 0x6F, 0x7E,
  2563. 0x50, 0xE6, 0x41, 0xDF, 0x15, 0x2F, 0x71, 0x09, 0xED, 0x54, 0x56, 0xB3,
  2564. 0x1F, 0x16, 0x6E, 0x6C, 0xAC, 0x04, 0x25, 0xA7, 0xCF, 0x3A, 0xB6, 0xAF,
  2565. 0x6B, 0x7F, 0xC3, 0x10, 0x3B, 0x88, 0x32, 0x02, 0xE9, 0x04, 0x65, 0x65
  2566. }
  2567. };
  2568. static const struct {
  2569. EC_CURVE_DATA h;
  2570. unsigned char data[0 + 64 * 6];
  2571. } _EC_brainpoolP512r1 = {
  2572. {
  2573. NID_X9_62_prime_field, 0, 64, 1
  2574. },
  2575. {
  2576. /* no seed */
  2577. /* p */
  2578. 0xAA, 0xDD, 0x9D, 0xB8, 0xDB, 0xE9, 0xC4, 0x8B, 0x3F, 0xD4, 0xE6, 0xAE,
  2579. 0x33, 0xC9, 0xFC, 0x07, 0xCB, 0x30, 0x8D, 0xB3, 0xB3, 0xC9, 0xD2, 0x0E,
  2580. 0xD6, 0x63, 0x9C, 0xCA, 0x70, 0x33, 0x08, 0x71, 0x7D, 0x4D, 0x9B, 0x00,
  2581. 0x9B, 0xC6, 0x68, 0x42, 0xAE, 0xCD, 0xA1, 0x2A, 0xE6, 0xA3, 0x80, 0xE6,
  2582. 0x28, 0x81, 0xFF, 0x2F, 0x2D, 0x82, 0xC6, 0x85, 0x28, 0xAA, 0x60, 0x56,
  2583. 0x58, 0x3A, 0x48, 0xF3,
  2584. /* a */
  2585. 0x78, 0x30, 0xA3, 0x31, 0x8B, 0x60, 0x3B, 0x89, 0xE2, 0x32, 0x71, 0x45,
  2586. 0xAC, 0x23, 0x4C, 0xC5, 0x94, 0xCB, 0xDD, 0x8D, 0x3D, 0xF9, 0x16, 0x10,
  2587. 0xA8, 0x34, 0x41, 0xCA, 0xEA, 0x98, 0x63, 0xBC, 0x2D, 0xED, 0x5D, 0x5A,
  2588. 0xA8, 0x25, 0x3A, 0xA1, 0x0A, 0x2E, 0xF1, 0xC9, 0x8B, 0x9A, 0xC8, 0xB5,
  2589. 0x7F, 0x11, 0x17, 0xA7, 0x2B, 0xF2, 0xC7, 0xB9, 0xE7, 0xC1, 0xAC, 0x4D,
  2590. 0x77, 0xFC, 0x94, 0xCA,
  2591. /* b */
  2592. 0x3D, 0xF9, 0x16, 0x10, 0xA8, 0x34, 0x41, 0xCA, 0xEA, 0x98, 0x63, 0xBC,
  2593. 0x2D, 0xED, 0x5D, 0x5A, 0xA8, 0x25, 0x3A, 0xA1, 0x0A, 0x2E, 0xF1, 0xC9,
  2594. 0x8B, 0x9A, 0xC8, 0xB5, 0x7F, 0x11, 0x17, 0xA7, 0x2B, 0xF2, 0xC7, 0xB9,
  2595. 0xE7, 0xC1, 0xAC, 0x4D, 0x77, 0xFC, 0x94, 0xCA, 0xDC, 0x08, 0x3E, 0x67,
  2596. 0x98, 0x40, 0x50, 0xB7, 0x5E, 0xBA, 0xE5, 0xDD, 0x28, 0x09, 0xBD, 0x63,
  2597. 0x80, 0x16, 0xF7, 0x23,
  2598. /* x */
  2599. 0x81, 0xAE, 0xE4, 0xBD, 0xD8, 0x2E, 0xD9, 0x64, 0x5A, 0x21, 0x32, 0x2E,
  2600. 0x9C, 0x4C, 0x6A, 0x93, 0x85, 0xED, 0x9F, 0x70, 0xB5, 0xD9, 0x16, 0xC1,
  2601. 0xB4, 0x3B, 0x62, 0xEE, 0xF4, 0xD0, 0x09, 0x8E, 0xFF, 0x3B, 0x1F, 0x78,
  2602. 0xE2, 0xD0, 0xD4, 0x8D, 0x50, 0xD1, 0x68, 0x7B, 0x93, 0xB9, 0x7D, 0x5F,
  2603. 0x7C, 0x6D, 0x50, 0x47, 0x40, 0x6A, 0x5E, 0x68, 0x8B, 0x35, 0x22, 0x09,
  2604. 0xBC, 0xB9, 0xF8, 0x22,
  2605. /* y */
  2606. 0x7D, 0xDE, 0x38, 0x5D, 0x56, 0x63, 0x32, 0xEC, 0xC0, 0xEA, 0xBF, 0xA9,
  2607. 0xCF, 0x78, 0x22, 0xFD, 0xF2, 0x09, 0xF7, 0x00, 0x24, 0xA5, 0x7B, 0x1A,
  2608. 0xA0, 0x00, 0xC5, 0x5B, 0x88, 0x1F, 0x81, 0x11, 0xB2, 0xDC, 0xDE, 0x49,
  2609. 0x4A, 0x5F, 0x48, 0x5E, 0x5B, 0xCA, 0x4B, 0xD8, 0x8A, 0x27, 0x63, 0xAE,
  2610. 0xD1, 0xCA, 0x2B, 0x2F, 0xA8, 0xF0, 0x54, 0x06, 0x78, 0xCD, 0x1E, 0x0F,
  2611. 0x3A, 0xD8, 0x08, 0x92,
  2612. /* order */
  2613. 0xAA, 0xDD, 0x9D, 0xB8, 0xDB, 0xE9, 0xC4, 0x8B, 0x3F, 0xD4, 0xE6, 0xAE,
  2614. 0x33, 0xC9, 0xFC, 0x07, 0xCB, 0x30, 0x8D, 0xB3, 0xB3, 0xC9, 0xD2, 0x0E,
  2615. 0xD6, 0x63, 0x9C, 0xCA, 0x70, 0x33, 0x08, 0x70, 0x55, 0x3E, 0x5C, 0x41,
  2616. 0x4C, 0xA9, 0x26, 0x19, 0x41, 0x86, 0x61, 0x19, 0x7F, 0xAC, 0x10, 0x47,
  2617. 0x1D, 0xB1, 0xD3, 0x81, 0x08, 0x5D, 0xDA, 0xDD, 0xB5, 0x87, 0x96, 0x82,
  2618. 0x9C, 0xA9, 0x00, 0x69
  2619. }
  2620. };
  2621. static const struct {
  2622. EC_CURVE_DATA h;
  2623. unsigned char data[0 + 64 * 6];
  2624. } _EC_brainpoolP512t1 = {
  2625. {
  2626. NID_X9_62_prime_field, 0, 64, 1
  2627. },
  2628. {
  2629. /* no seed */
  2630. /* p */
  2631. 0xAA, 0xDD, 0x9D, 0xB8, 0xDB, 0xE9, 0xC4, 0x8B, 0x3F, 0xD4, 0xE6, 0xAE,
  2632. 0x33, 0xC9, 0xFC, 0x07, 0xCB, 0x30, 0x8D, 0xB3, 0xB3, 0xC9, 0xD2, 0x0E,
  2633. 0xD6, 0x63, 0x9C, 0xCA, 0x70, 0x33, 0x08, 0x71, 0x7D, 0x4D, 0x9B, 0x00,
  2634. 0x9B, 0xC6, 0x68, 0x42, 0xAE, 0xCD, 0xA1, 0x2A, 0xE6, 0xA3, 0x80, 0xE6,
  2635. 0x28, 0x81, 0xFF, 0x2F, 0x2D, 0x82, 0xC6, 0x85, 0x28, 0xAA, 0x60, 0x56,
  2636. 0x58, 0x3A, 0x48, 0xF3,
  2637. /* a */
  2638. 0xAA, 0xDD, 0x9D, 0xB8, 0xDB, 0xE9, 0xC4, 0x8B, 0x3F, 0xD4, 0xE6, 0xAE,
  2639. 0x33, 0xC9, 0xFC, 0x07, 0xCB, 0x30, 0x8D, 0xB3, 0xB3, 0xC9, 0xD2, 0x0E,
  2640. 0xD6, 0x63, 0x9C, 0xCA, 0x70, 0x33, 0x08, 0x71, 0x7D, 0x4D, 0x9B, 0x00,
  2641. 0x9B, 0xC6, 0x68, 0x42, 0xAE, 0xCD, 0xA1, 0x2A, 0xE6, 0xA3, 0x80, 0xE6,
  2642. 0x28, 0x81, 0xFF, 0x2F, 0x2D, 0x82, 0xC6, 0x85, 0x28, 0xAA, 0x60, 0x56,
  2643. 0x58, 0x3A, 0x48, 0xF0,
  2644. /* b */
  2645. 0x7C, 0xBB, 0xBC, 0xF9, 0x44, 0x1C, 0xFA, 0xB7, 0x6E, 0x18, 0x90, 0xE4,
  2646. 0x68, 0x84, 0xEA, 0xE3, 0x21, 0xF7, 0x0C, 0x0B, 0xCB, 0x49, 0x81, 0x52,
  2647. 0x78, 0x97, 0x50, 0x4B, 0xEC, 0x3E, 0x36, 0xA6, 0x2B, 0xCD, 0xFA, 0x23,
  2648. 0x04, 0x97, 0x65, 0x40, 0xF6, 0x45, 0x00, 0x85, 0xF2, 0xDA, 0xE1, 0x45,
  2649. 0xC2, 0x25, 0x53, 0xB4, 0x65, 0x76, 0x36, 0x89, 0x18, 0x0E, 0xA2, 0x57,
  2650. 0x18, 0x67, 0x42, 0x3E,
  2651. /* x */
  2652. 0x64, 0x0E, 0xCE, 0x5C, 0x12, 0x78, 0x87, 0x17, 0xB9, 0xC1, 0xBA, 0x06,
  2653. 0xCB, 0xC2, 0xA6, 0xFE, 0xBA, 0x85, 0x84, 0x24, 0x58, 0xC5, 0x6D, 0xDE,
  2654. 0x9D, 0xB1, 0x75, 0x8D, 0x39, 0xC0, 0x31, 0x3D, 0x82, 0xBA, 0x51, 0x73,
  2655. 0x5C, 0xDB, 0x3E, 0xA4, 0x99, 0xAA, 0x77, 0xA7, 0xD6, 0x94, 0x3A, 0x64,
  2656. 0xF7, 0xA3, 0xF2, 0x5F, 0xE2, 0x6F, 0x06, 0xB5, 0x1B, 0xAA, 0x26, 0x96,
  2657. 0xFA, 0x90, 0x35, 0xDA,
  2658. /* y */
  2659. 0x5B, 0x53, 0x4B, 0xD5, 0x95, 0xF5, 0xAF, 0x0F, 0xA2, 0xC8, 0x92, 0x37,
  2660. 0x6C, 0x84, 0xAC, 0xE1, 0xBB, 0x4E, 0x30, 0x19, 0xB7, 0x16, 0x34, 0xC0,
  2661. 0x11, 0x31, 0x15, 0x9C, 0xAE, 0x03, 0xCE, 0xE9, 0xD9, 0x93, 0x21, 0x84,
  2662. 0xBE, 0xEF, 0x21, 0x6B, 0xD7, 0x1D, 0xF2, 0xDA, 0xDF, 0x86, 0xA6, 0x27,
  2663. 0x30, 0x6E, 0xCF, 0xF9, 0x6D, 0xBB, 0x8B, 0xAC, 0xE1, 0x98, 0xB6, 0x1E,
  2664. 0x00, 0xF8, 0xB3, 0x32,
  2665. /* order */
  2666. 0xAA, 0xDD, 0x9D, 0xB8, 0xDB, 0xE9, 0xC4, 0x8B, 0x3F, 0xD4, 0xE6, 0xAE,
  2667. 0x33, 0xC9, 0xFC, 0x07, 0xCB, 0x30, 0x8D, 0xB3, 0xB3, 0xC9, 0xD2, 0x0E,
  2668. 0xD6, 0x63, 0x9C, 0xCA, 0x70, 0x33, 0x08, 0x70, 0x55, 0x3E, 0x5C, 0x41,
  2669. 0x4C, 0xA9, 0x26, 0x19, 0x41, 0x86, 0x61, 0x19, 0x7F, 0xAC, 0x10, 0x47,
  2670. 0x1D, 0xB1, 0xD3, 0x81, 0x08, 0x5D, 0xDA, 0xDD, 0xB5, 0x87, 0x96, 0x82,
  2671. 0x9C, 0xA9, 0x00, 0x69
  2672. }
  2673. };
  2674. #ifndef OPENSSL_NO_SM2
  2675. static const struct {
  2676. EC_CURVE_DATA h;
  2677. unsigned char data[0 + 32 * 6];
  2678. } _EC_sm2p256v1 = {
  2679. {
  2680. NID_X9_62_prime_field, 0, 32, 1
  2681. },
  2682. {
  2683. /* no seed */
  2684. /* p */
  2685. 0xff, 0xff, 0xff, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
  2686. 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00,
  2687. 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
  2688. /* a */
  2689. 0xff, 0xff, 0xff, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
  2690. 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00,
  2691. 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc,
  2692. /* b */
  2693. 0x28, 0xe9, 0xfa, 0x9e, 0x9d, 0x9f, 0x5e, 0x34, 0x4d, 0x5a, 0x9e, 0x4b,
  2694. 0xcf, 0x65, 0x09, 0xa7, 0xf3, 0x97, 0x89, 0xf5, 0x15, 0xab, 0x8f, 0x92,
  2695. 0xdd, 0xbc, 0xbd, 0x41, 0x4d, 0x94, 0x0e, 0x93,
  2696. /* x */
  2697. 0x32, 0xc4, 0xae, 0x2c, 0x1f, 0x19, 0x81, 0x19, 0x5f, 0x99, 0x04, 0x46,
  2698. 0x6a, 0x39, 0xc9, 0x94, 0x8f, 0xe3, 0x0b, 0xbf, 0xf2, 0x66, 0x0b, 0xe1,
  2699. 0x71, 0x5a, 0x45, 0x89, 0x33, 0x4c, 0x74, 0xc7,
  2700. /* y */
  2701. 0xbc, 0x37, 0x36, 0xa2, 0xf4, 0xf6, 0x77, 0x9c, 0x59, 0xbd, 0xce, 0xe3,
  2702. 0x6b, 0x69, 0x21, 0x53, 0xd0, 0xa9, 0x87, 0x7c, 0xc6, 0x2a, 0x47, 0x40,
  2703. 0x02, 0xdf, 0x32, 0xe5, 0x21, 0x39, 0xf0, 0xa0,
  2704. /* order */
  2705. 0xff, 0xff, 0xff, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
  2706. 0xff, 0xff, 0xff, 0xff, 0x72, 0x03, 0xdf, 0x6b, 0x21, 0xc6, 0x05, 0x2b,
  2707. 0x53, 0xbb, 0xf4, 0x09, 0x39, 0xd5, 0x41, 0x23,
  2708. }
  2709. };
  2710. #endif /* OPENSSL_NO_SM2 */
  2711. typedef struct _ec_list_element_st {
  2712. int nid;
  2713. const EC_CURVE_DATA *data;
  2714. const EC_METHOD *(*meth) (void);
  2715. const char *comment;
  2716. } ec_list_element;
  2717. static const ec_list_element curve_list[] = {
  2718. /* prime field curves */
  2719. /* secg curves */
  2720. {NID_secp112r1, &_EC_SECG_PRIME_112R1.h, 0,
  2721. "SECG/WTLS curve over a 112 bit prime field"},
  2722. {NID_secp112r2, &_EC_SECG_PRIME_112R2.h, 0,
  2723. "SECG curve over a 112 bit prime field"},
  2724. {NID_secp128r1, &_EC_SECG_PRIME_128R1.h, 0,
  2725. "SECG curve over a 128 bit prime field"},
  2726. {NID_secp128r2, &_EC_SECG_PRIME_128R2.h, 0,
  2727. "SECG curve over a 128 bit prime field"},
  2728. {NID_secp160k1, &_EC_SECG_PRIME_160K1.h, 0,
  2729. "SECG curve over a 160 bit prime field"},
  2730. {NID_secp160r1, &_EC_SECG_PRIME_160R1.h, 0,
  2731. "SECG curve over a 160 bit prime field"},
  2732. {NID_secp160r2, &_EC_SECG_PRIME_160R2.h, 0,
  2733. "SECG/WTLS curve over a 160 bit prime field"},
  2734. /* SECG secp192r1 is the same as X9.62 prime192v1 and hence omitted */
  2735. {NID_secp192k1, &_EC_SECG_PRIME_192K1.h, 0,
  2736. "SECG curve over a 192 bit prime field"},
  2737. {NID_secp224k1, &_EC_SECG_PRIME_224K1.h, 0,
  2738. "SECG curve over a 224 bit prime field"},
  2739. #ifndef OPENSSL_NO_EC_NISTP_64_GCC_128
  2740. {NID_secp224r1, &_EC_NIST_PRIME_224.h, EC_GFp_nistp224_method,
  2741. "NIST/SECG curve over a 224 bit prime field"},
  2742. #else
  2743. {NID_secp224r1, &_EC_NIST_PRIME_224.h, 0,
  2744. "NIST/SECG curve over a 224 bit prime field"},
  2745. #endif
  2746. {NID_secp256k1, &_EC_SECG_PRIME_256K1.h, 0,
  2747. "SECG curve over a 256 bit prime field"},
  2748. /* SECG secp256r1 is the same as X9.62 prime256v1 and hence omitted */
  2749. {NID_secp384r1, &_EC_NIST_PRIME_384.h, 0,
  2750. "NIST/SECG curve over a 384 bit prime field"},
  2751. #ifndef OPENSSL_NO_EC_NISTP_64_GCC_128
  2752. {NID_secp521r1, &_EC_NIST_PRIME_521.h, EC_GFp_nistp521_method,
  2753. "NIST/SECG curve over a 521 bit prime field"},
  2754. #else
  2755. {NID_secp521r1, &_EC_NIST_PRIME_521.h, 0,
  2756. "NIST/SECG curve over a 521 bit prime field"},
  2757. #endif
  2758. /* X9.62 curves */
  2759. {NID_X9_62_prime192v1, &_EC_NIST_PRIME_192.h, 0,
  2760. "NIST/X9.62/SECG curve over a 192 bit prime field"},
  2761. {NID_X9_62_prime192v2, &_EC_X9_62_PRIME_192V2.h, 0,
  2762. "X9.62 curve over a 192 bit prime field"},
  2763. {NID_X9_62_prime192v3, &_EC_X9_62_PRIME_192V3.h, 0,
  2764. "X9.62 curve over a 192 bit prime field"},
  2765. {NID_X9_62_prime239v1, &_EC_X9_62_PRIME_239V1.h, 0,
  2766. "X9.62 curve over a 239 bit prime field"},
  2767. {NID_X9_62_prime239v2, &_EC_X9_62_PRIME_239V2.h, 0,
  2768. "X9.62 curve over a 239 bit prime field"},
  2769. {NID_X9_62_prime239v3, &_EC_X9_62_PRIME_239V3.h, 0,
  2770. "X9.62 curve over a 239 bit prime field"},
  2771. {NID_X9_62_prime256v1, &_EC_X9_62_PRIME_256V1.h,
  2772. #if defined(ECP_NISTZ256_ASM)
  2773. EC_GFp_nistz256_method,
  2774. #elif !defined(OPENSSL_NO_EC_NISTP_64_GCC_128)
  2775. EC_GFp_nistp256_method,
  2776. #else
  2777. 0,
  2778. #endif
  2779. "X9.62/SECG curve over a 256 bit prime field"},
  2780. #ifndef OPENSSL_NO_EC2M
  2781. /* characteristic two field curves */
  2782. /* NIST/SECG curves */
  2783. {NID_sect113r1, &_EC_SECG_CHAR2_113R1.h, 0,
  2784. "SECG curve over a 113 bit binary field"},
  2785. {NID_sect113r2, &_EC_SECG_CHAR2_113R2.h, 0,
  2786. "SECG curve over a 113 bit binary field"},
  2787. {NID_sect131r1, &_EC_SECG_CHAR2_131R1.h, 0,
  2788. "SECG/WTLS curve over a 131 bit binary field"},
  2789. {NID_sect131r2, &_EC_SECG_CHAR2_131R2.h, 0,
  2790. "SECG curve over a 131 bit binary field"},
  2791. {NID_sect163k1, &_EC_NIST_CHAR2_163K.h, 0,
  2792. "NIST/SECG/WTLS curve over a 163 bit binary field"},
  2793. {NID_sect163r1, &_EC_SECG_CHAR2_163R1.h, 0,
  2794. "SECG curve over a 163 bit binary field"},
  2795. {NID_sect163r2, &_EC_NIST_CHAR2_163B.h, 0,
  2796. "NIST/SECG curve over a 163 bit binary field"},
  2797. {NID_sect193r1, &_EC_SECG_CHAR2_193R1.h, 0,
  2798. "SECG curve over a 193 bit binary field"},
  2799. {NID_sect193r2, &_EC_SECG_CHAR2_193R2.h, 0,
  2800. "SECG curve over a 193 bit binary field"},
  2801. {NID_sect233k1, &_EC_NIST_CHAR2_233K.h, 0,
  2802. "NIST/SECG/WTLS curve over a 233 bit binary field"},
  2803. {NID_sect233r1, &_EC_NIST_CHAR2_233B.h, 0,
  2804. "NIST/SECG/WTLS curve over a 233 bit binary field"},
  2805. {NID_sect239k1, &_EC_SECG_CHAR2_239K1.h, 0,
  2806. "SECG curve over a 239 bit binary field"},
  2807. {NID_sect283k1, &_EC_NIST_CHAR2_283K.h, 0,
  2808. "NIST/SECG curve over a 283 bit binary field"},
  2809. {NID_sect283r1, &_EC_NIST_CHAR2_283B.h, 0,
  2810. "NIST/SECG curve over a 283 bit binary field"},
  2811. {NID_sect409k1, &_EC_NIST_CHAR2_409K.h, 0,
  2812. "NIST/SECG curve over a 409 bit binary field"},
  2813. {NID_sect409r1, &_EC_NIST_CHAR2_409B.h, 0,
  2814. "NIST/SECG curve over a 409 bit binary field"},
  2815. {NID_sect571k1, &_EC_NIST_CHAR2_571K.h, 0,
  2816. "NIST/SECG curve over a 571 bit binary field"},
  2817. {NID_sect571r1, &_EC_NIST_CHAR2_571B.h, 0,
  2818. "NIST/SECG curve over a 571 bit binary field"},
  2819. /* X9.62 curves */
  2820. {NID_X9_62_c2pnb163v1, &_EC_X9_62_CHAR2_163V1.h, 0,
  2821. "X9.62 curve over a 163 bit binary field"},
  2822. {NID_X9_62_c2pnb163v2, &_EC_X9_62_CHAR2_163V2.h, 0,
  2823. "X9.62 curve over a 163 bit binary field"},
  2824. {NID_X9_62_c2pnb163v3, &_EC_X9_62_CHAR2_163V3.h, 0,
  2825. "X9.62 curve over a 163 bit binary field"},
  2826. {NID_X9_62_c2pnb176v1, &_EC_X9_62_CHAR2_176V1.h, 0,
  2827. "X9.62 curve over a 176 bit binary field"},
  2828. {NID_X9_62_c2tnb191v1, &_EC_X9_62_CHAR2_191V1.h, 0,
  2829. "X9.62 curve over a 191 bit binary field"},
  2830. {NID_X9_62_c2tnb191v2, &_EC_X9_62_CHAR2_191V2.h, 0,
  2831. "X9.62 curve over a 191 bit binary field"},
  2832. {NID_X9_62_c2tnb191v3, &_EC_X9_62_CHAR2_191V3.h, 0,
  2833. "X9.62 curve over a 191 bit binary field"},
  2834. {NID_X9_62_c2pnb208w1, &_EC_X9_62_CHAR2_208W1.h, 0,
  2835. "X9.62 curve over a 208 bit binary field"},
  2836. {NID_X9_62_c2tnb239v1, &_EC_X9_62_CHAR2_239V1.h, 0,
  2837. "X9.62 curve over a 239 bit binary field"},
  2838. {NID_X9_62_c2tnb239v2, &_EC_X9_62_CHAR2_239V2.h, 0,
  2839. "X9.62 curve over a 239 bit binary field"},
  2840. {NID_X9_62_c2tnb239v3, &_EC_X9_62_CHAR2_239V3.h, 0,
  2841. "X9.62 curve over a 239 bit binary field"},
  2842. {NID_X9_62_c2pnb272w1, &_EC_X9_62_CHAR2_272W1.h, 0,
  2843. "X9.62 curve over a 272 bit binary field"},
  2844. {NID_X9_62_c2pnb304w1, &_EC_X9_62_CHAR2_304W1.h, 0,
  2845. "X9.62 curve over a 304 bit binary field"},
  2846. {NID_X9_62_c2tnb359v1, &_EC_X9_62_CHAR2_359V1.h, 0,
  2847. "X9.62 curve over a 359 bit binary field"},
  2848. {NID_X9_62_c2pnb368w1, &_EC_X9_62_CHAR2_368W1.h, 0,
  2849. "X9.62 curve over a 368 bit binary field"},
  2850. {NID_X9_62_c2tnb431r1, &_EC_X9_62_CHAR2_431R1.h, 0,
  2851. "X9.62 curve over a 431 bit binary field"},
  2852. /*
  2853. * the WAP/WTLS curves [unlike SECG, spec has its own OIDs for curves
  2854. * from X9.62]
  2855. */
  2856. {NID_wap_wsg_idm_ecid_wtls1, &_EC_WTLS_1.h, 0,
  2857. "WTLS curve over a 113 bit binary field"},
  2858. {NID_wap_wsg_idm_ecid_wtls3, &_EC_NIST_CHAR2_163K.h, 0,
  2859. "NIST/SECG/WTLS curve over a 163 bit binary field"},
  2860. {NID_wap_wsg_idm_ecid_wtls4, &_EC_SECG_CHAR2_113R1.h, 0,
  2861. "SECG curve over a 113 bit binary field"},
  2862. {NID_wap_wsg_idm_ecid_wtls5, &_EC_X9_62_CHAR2_163V1.h, 0,
  2863. "X9.62 curve over a 163 bit binary field"},
  2864. #endif
  2865. {NID_wap_wsg_idm_ecid_wtls6, &_EC_SECG_PRIME_112R1.h, 0,
  2866. "SECG/WTLS curve over a 112 bit prime field"},
  2867. {NID_wap_wsg_idm_ecid_wtls7, &_EC_SECG_PRIME_160R2.h, 0,
  2868. "SECG/WTLS curve over a 160 bit prime field"},
  2869. {NID_wap_wsg_idm_ecid_wtls8, &_EC_WTLS_8.h, 0,
  2870. "WTLS curve over a 112 bit prime field"},
  2871. {NID_wap_wsg_idm_ecid_wtls9, &_EC_WTLS_9.h, 0,
  2872. "WTLS curve over a 160 bit prime field"},
  2873. #ifndef OPENSSL_NO_EC2M
  2874. {NID_wap_wsg_idm_ecid_wtls10, &_EC_NIST_CHAR2_233K.h, 0,
  2875. "NIST/SECG/WTLS curve over a 233 bit binary field"},
  2876. {NID_wap_wsg_idm_ecid_wtls11, &_EC_NIST_CHAR2_233B.h, 0,
  2877. "NIST/SECG/WTLS curve over a 233 bit binary field"},
  2878. #endif
  2879. {NID_wap_wsg_idm_ecid_wtls12, &_EC_WTLS_12.h, 0,
  2880. "WTLS curve over a 224 bit prime field"},
  2881. #ifndef OPENSSL_NO_EC2M
  2882. /* IPSec curves */
  2883. {NID_ipsec3, &_EC_IPSEC_155_ID3.h, 0,
  2884. "\n\tIPSec/IKE/Oakley curve #3 over a 155 bit binary field.\n"
  2885. "\tNot suitable for ECDSA.\n\tQuestionable extension field!"},
  2886. {NID_ipsec4, &_EC_IPSEC_185_ID4.h, 0,
  2887. "\n\tIPSec/IKE/Oakley curve #4 over a 185 bit binary field.\n"
  2888. "\tNot suitable for ECDSA.\n\tQuestionable extension field!"},
  2889. #endif
  2890. /* brainpool curves */
  2891. {NID_brainpoolP160r1, &_EC_brainpoolP160r1.h, 0,
  2892. "RFC 5639 curve over a 160 bit prime field"},
  2893. {NID_brainpoolP160t1, &_EC_brainpoolP160t1.h, 0,
  2894. "RFC 5639 curve over a 160 bit prime field"},
  2895. {NID_brainpoolP192r1, &_EC_brainpoolP192r1.h, 0,
  2896. "RFC 5639 curve over a 192 bit prime field"},
  2897. {NID_brainpoolP192t1, &_EC_brainpoolP192t1.h, 0,
  2898. "RFC 5639 curve over a 192 bit prime field"},
  2899. {NID_brainpoolP224r1, &_EC_brainpoolP224r1.h, 0,
  2900. "RFC 5639 curve over a 224 bit prime field"},
  2901. {NID_brainpoolP224t1, &_EC_brainpoolP224t1.h, 0,
  2902. "RFC 5639 curve over a 224 bit prime field"},
  2903. {NID_brainpoolP256r1, &_EC_brainpoolP256r1.h, 0,
  2904. "RFC 5639 curve over a 256 bit prime field"},
  2905. {NID_brainpoolP256t1, &_EC_brainpoolP256t1.h, 0,
  2906. "RFC 5639 curve over a 256 bit prime field"},
  2907. {NID_brainpoolP320r1, &_EC_brainpoolP320r1.h, 0,
  2908. "RFC 5639 curve over a 320 bit prime field"},
  2909. {NID_brainpoolP320t1, &_EC_brainpoolP320t1.h, 0,
  2910. "RFC 5639 curve over a 320 bit prime field"},
  2911. {NID_brainpoolP384r1, &_EC_brainpoolP384r1.h, 0,
  2912. "RFC 5639 curve over a 384 bit prime field"},
  2913. {NID_brainpoolP384t1, &_EC_brainpoolP384t1.h, 0,
  2914. "RFC 5639 curve over a 384 bit prime field"},
  2915. {NID_brainpoolP512r1, &_EC_brainpoolP512r1.h, 0,
  2916. "RFC 5639 curve over a 512 bit prime field"},
  2917. {NID_brainpoolP512t1, &_EC_brainpoolP512t1.h, 0,
  2918. "RFC 5639 curve over a 512 bit prime field"},
  2919. #ifndef OPENSSL_NO_SM2
  2920. {NID_sm2, &_EC_sm2p256v1.h, 0,
  2921. "SM2 curve over a 256 bit prime field"},
  2922. #endif
  2923. };
  2924. #define curve_list_length OSSL_NELEM(curve_list)
  2925. static EC_GROUP *ec_group_new_from_data(const ec_list_element curve)
  2926. {
  2927. EC_GROUP *group = NULL;
  2928. EC_POINT *P = NULL;
  2929. BN_CTX *ctx = NULL;
  2930. BIGNUM *p = NULL, *a = NULL, *b = NULL, *x = NULL, *y = NULL, *order =
  2931. NULL;
  2932. int ok = 0;
  2933. int seed_len, param_len;
  2934. const EC_METHOD *meth;
  2935. const EC_CURVE_DATA *data;
  2936. const unsigned char *params;
  2937. /* If no curve data curve method must handle everything */
  2938. if (curve.data == NULL)
  2939. return EC_GROUP_new(curve.meth != NULL ? curve.meth() : NULL);
  2940. if ((ctx = BN_CTX_new()) == NULL) {
  2941. ECerr(EC_F_EC_GROUP_NEW_FROM_DATA, ERR_R_MALLOC_FAILURE);
  2942. goto err;
  2943. }
  2944. data = curve.data;
  2945. seed_len = data->seed_len;
  2946. param_len = data->param_len;
  2947. params = (const unsigned char *)(data + 1); /* skip header */
  2948. params += seed_len; /* skip seed */
  2949. if ((p = BN_bin2bn(params + 0 * param_len, param_len, NULL)) == NULL
  2950. || (a = BN_bin2bn(params + 1 * param_len, param_len, NULL)) == NULL
  2951. || (b = BN_bin2bn(params + 2 * param_len, param_len, NULL)) == NULL) {
  2952. ECerr(EC_F_EC_GROUP_NEW_FROM_DATA, ERR_R_BN_LIB);
  2953. goto err;
  2954. }
  2955. if (curve.meth != 0) {
  2956. meth = curve.meth();
  2957. if (((group = EC_GROUP_new(meth)) == NULL) ||
  2958. (!(group->meth->group_set_curve(group, p, a, b, ctx)))) {
  2959. ECerr(EC_F_EC_GROUP_NEW_FROM_DATA, ERR_R_EC_LIB);
  2960. goto err;
  2961. }
  2962. } else if (data->field_type == NID_X9_62_prime_field) {
  2963. if ((group = EC_GROUP_new_curve_GFp(p, a, b, ctx)) == NULL) {
  2964. ECerr(EC_F_EC_GROUP_NEW_FROM_DATA, ERR_R_EC_LIB);
  2965. goto err;
  2966. }
  2967. }
  2968. #ifndef OPENSSL_NO_EC2M
  2969. else { /* field_type ==
  2970. * NID_X9_62_characteristic_two_field */
  2971. if ((group = EC_GROUP_new_curve_GF2m(p, a, b, ctx)) == NULL) {
  2972. ECerr(EC_F_EC_GROUP_NEW_FROM_DATA, ERR_R_EC_LIB);
  2973. goto err;
  2974. }
  2975. }
  2976. #endif
  2977. EC_GROUP_set_curve_name(group, curve.nid);
  2978. if ((P = EC_POINT_new(group)) == NULL) {
  2979. ECerr(EC_F_EC_GROUP_NEW_FROM_DATA, ERR_R_EC_LIB);
  2980. goto err;
  2981. }
  2982. if ((x = BN_bin2bn(params + 3 * param_len, param_len, NULL)) == NULL
  2983. || (y = BN_bin2bn(params + 4 * param_len, param_len, NULL)) == NULL) {
  2984. ECerr(EC_F_EC_GROUP_NEW_FROM_DATA, ERR_R_BN_LIB);
  2985. goto err;
  2986. }
  2987. if (!EC_POINT_set_affine_coordinates(group, P, x, y, ctx)) {
  2988. ECerr(EC_F_EC_GROUP_NEW_FROM_DATA, ERR_R_EC_LIB);
  2989. goto err;
  2990. }
  2991. if ((order = BN_bin2bn(params + 5 * param_len, param_len, NULL)) == NULL
  2992. || !BN_set_word(x, (BN_ULONG)data->cofactor)) {
  2993. ECerr(EC_F_EC_GROUP_NEW_FROM_DATA, ERR_R_BN_LIB);
  2994. goto err;
  2995. }
  2996. if (!EC_GROUP_set_generator(group, P, order, x)) {
  2997. ECerr(EC_F_EC_GROUP_NEW_FROM_DATA, ERR_R_EC_LIB);
  2998. goto err;
  2999. }
  3000. if (seed_len) {
  3001. if (!EC_GROUP_set_seed(group, params - seed_len, seed_len)) {
  3002. ECerr(EC_F_EC_GROUP_NEW_FROM_DATA, ERR_R_EC_LIB);
  3003. goto err;
  3004. }
  3005. }
  3006. ok = 1;
  3007. err:
  3008. if (!ok) {
  3009. EC_GROUP_free(group);
  3010. group = NULL;
  3011. }
  3012. EC_POINT_free(P);
  3013. BN_CTX_free(ctx);
  3014. BN_free(p);
  3015. BN_free(a);
  3016. BN_free(b);
  3017. BN_free(order);
  3018. BN_free(x);
  3019. BN_free(y);
  3020. return group;
  3021. }
  3022. EC_GROUP *EC_GROUP_new_by_curve_name(int nid)
  3023. {
  3024. size_t i;
  3025. EC_GROUP *ret = NULL;
  3026. if (nid <= 0)
  3027. return NULL;
  3028. for (i = 0; i < curve_list_length; i++)
  3029. if (curve_list[i].nid == nid) {
  3030. ret = ec_group_new_from_data(curve_list[i]);
  3031. break;
  3032. }
  3033. if (ret == NULL) {
  3034. ECerr(EC_F_EC_GROUP_NEW_BY_CURVE_NAME, EC_R_UNKNOWN_GROUP);
  3035. return NULL;
  3036. }
  3037. return ret;
  3038. }
  3039. size_t EC_get_builtin_curves(EC_builtin_curve *r, size_t nitems)
  3040. {
  3041. size_t i, min;
  3042. if (r == NULL || nitems == 0)
  3043. return curve_list_length;
  3044. min = nitems < curve_list_length ? nitems : curve_list_length;
  3045. for (i = 0; i < min; i++) {
  3046. r[i].nid = curve_list[i].nid;
  3047. r[i].comment = curve_list[i].comment;
  3048. }
  3049. return curve_list_length;
  3050. }
  3051. /* Functions to translate between common NIST curve names and NIDs */
  3052. typedef struct {
  3053. const char *name; /* NIST Name of curve */
  3054. int nid; /* Curve NID */
  3055. } EC_NIST_NAME;
  3056. static EC_NIST_NAME nist_curves[] = {
  3057. {"B-163", NID_sect163r2},
  3058. {"B-233", NID_sect233r1},
  3059. {"B-283", NID_sect283r1},
  3060. {"B-409", NID_sect409r1},
  3061. {"B-571", NID_sect571r1},
  3062. {"K-163", NID_sect163k1},
  3063. {"K-233", NID_sect233k1},
  3064. {"K-283", NID_sect283k1},
  3065. {"K-409", NID_sect409k1},
  3066. {"K-571", NID_sect571k1},
  3067. {"P-192", NID_X9_62_prime192v1},
  3068. {"P-224", NID_secp224r1},
  3069. {"P-256", NID_X9_62_prime256v1},
  3070. {"P-384", NID_secp384r1},
  3071. {"P-521", NID_secp521r1}
  3072. };
  3073. const char *EC_curve_nid2nist(int nid)
  3074. {
  3075. size_t i;
  3076. for (i = 0; i < OSSL_NELEM(nist_curves); i++) {
  3077. if (nist_curves[i].nid == nid)
  3078. return nist_curves[i].name;
  3079. }
  3080. return NULL;
  3081. }
  3082. int EC_curve_nist2nid(const char *name)
  3083. {
  3084. size_t i;
  3085. for (i = 0; i < OSSL_NELEM(nist_curves); i++) {
  3086. if (strcmp(nist_curves[i].name, name) == 0)
  3087. return nist_curves[i].nid;
  3088. }
  3089. return NID_undef;
  3090. }
  3091. #define NUM_BN_FIELDS 6
  3092. /*
  3093. * Validates EC domain parameter data for known named curves.
  3094. * This can be used when a curve is loaded explicitly (without a curve
  3095. * name) or to validate that domain parameters have not been modified.
  3096. *
  3097. * Returns: The nid associated with the found named curve, or NID_undef
  3098. * if not found. If there was an error it returns -1.
  3099. */
  3100. int ec_curve_nid_from_params(const EC_GROUP *group, BN_CTX *ctx)
  3101. {
  3102. int ret = -1, nid, len, field_type, param_len;
  3103. size_t i, seed_len;
  3104. const unsigned char *seed, *params_seed, *params;
  3105. unsigned char *param_bytes = NULL;
  3106. const EC_CURVE_DATA *data;
  3107. const EC_POINT *generator = NULL;
  3108. const EC_METHOD *meth;
  3109. const BIGNUM *cofactor = NULL;
  3110. /* An array of BIGNUMs for (p, a, b, x, y, order) */
  3111. BIGNUM *bn[NUM_BN_FIELDS] = {NULL, NULL, NULL, NULL, NULL, NULL};
  3112. meth = EC_GROUP_method_of(group);
  3113. if (meth == NULL)
  3114. return -1;
  3115. /* Use the optional named curve nid as a search field */
  3116. nid = EC_GROUP_get_curve_name(group);
  3117. field_type = EC_METHOD_get_field_type(meth);
  3118. seed_len = EC_GROUP_get_seed_len(group);
  3119. seed = EC_GROUP_get0_seed(group);
  3120. cofactor = EC_GROUP_get0_cofactor(group);
  3121. BN_CTX_start(ctx);
  3122. /*
  3123. * The built-in curves contains data fields (p, a, b, x, y, order) that are
  3124. * all zero-padded to be the same size. The size of the padding is
  3125. * determined by either the number of bytes in the field modulus (p) or the
  3126. * EC group order, whichever is larger.
  3127. */
  3128. param_len = BN_num_bytes(group->order);
  3129. len = BN_num_bytes(group->field);
  3130. if (len > param_len)
  3131. param_len = len;
  3132. /* Allocate space to store the padded data for (p, a, b, x, y, order) */
  3133. param_bytes = OPENSSL_malloc(param_len * NUM_BN_FIELDS);
  3134. if (param_bytes == NULL)
  3135. goto end;
  3136. /* Create the bignums */
  3137. for (i = 0; i < NUM_BN_FIELDS; ++i) {
  3138. if ((bn[i] = BN_CTX_get(ctx)) == NULL)
  3139. goto end;
  3140. }
  3141. /*
  3142. * Fill in the bn array with the same values as the internal curves
  3143. * i.e. the values are p, a, b, x, y, order.
  3144. */
  3145. /* Get p, a & b */
  3146. if (!(EC_GROUP_get_curve(group, bn[0], bn[1], bn[2], ctx)
  3147. && ((generator = EC_GROUP_get0_generator(group)) != NULL)
  3148. /* Get x & y */
  3149. && EC_POINT_get_affine_coordinates(group, generator, bn[3], bn[4], ctx)
  3150. /* Get order */
  3151. && EC_GROUP_get_order(group, bn[5], ctx)))
  3152. goto end;
  3153. /*
  3154. * Convert the bignum array to bytes that are joined together to form
  3155. * a single buffer that contains data for all fields.
  3156. * (p, a, b, x, y, order) are all zero padded to be the same size.
  3157. */
  3158. for (i = 0; i < NUM_BN_FIELDS; ++i) {
  3159. if (BN_bn2binpad(bn[i], &param_bytes[i*param_len], param_len) <= 0)
  3160. goto end;
  3161. }
  3162. for (i = 0; i < curve_list_length; i++) {
  3163. const ec_list_element curve = curve_list[i];
  3164. data = curve.data;
  3165. /* Get the raw order byte data */
  3166. params_seed = (const unsigned char *)(data + 1); /* skip header */
  3167. params = params_seed + data->seed_len;
  3168. /* Look for unique fields in the fixed curve data */
  3169. if (data->field_type == field_type
  3170. && param_len == data->param_len
  3171. && (nid <= 0 || nid == curve.nid)
  3172. /* check the optional cofactor (ignore if its zero) */
  3173. && (BN_is_zero(cofactor)
  3174. || BN_is_word(cofactor, (const BN_ULONG)curve.data->cofactor))
  3175. /* Check the optional seed (ignore if its not set) */
  3176. && (data->seed_len == 0 || seed_len == 0
  3177. || ((size_t)data->seed_len == seed_len
  3178. && memcmp(params_seed, seed, seed_len) == 0))
  3179. /* Check that the groups params match the built-in curve params */
  3180. && memcmp(param_bytes, params, param_len * NUM_BN_FIELDS)
  3181. == 0) {
  3182. ret = curve.nid;
  3183. goto end;
  3184. }
  3185. }
  3186. /* Gets here if the group was not found */
  3187. ret = NID_undef;
  3188. end:
  3189. OPENSSL_free(param_bytes);
  3190. BN_CTX_end(ctx);
  3191. return ret;
  3192. }