2
0

ec_curve.c 142 KB

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