ec_curve.c 142 KB

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