openssl-0.9.8j-avr32-asm-optimizations.patch.avr32 214 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355
  1. Index: openssl-0.9.8g/apps/ca.c
  2. ===================================================================
  3. --- openssl-0.9.8g.orig/apps/ca.c 2008-09-24 11:00:04.000000000 +0200
  4. +++ openssl-0.9.8g/apps/ca.c 2008-09-24 11:01:01.000000000 +0200
  5. @@ -834,7 +834,7 @@
  6. BIO_printf(bio_err,"there needs to be defined a directory for new certificate to be placed in\n");
  7. goto err;
  8. }
  9. -#ifndef OPENSSL_SYS_VMS
  10. +#if !(defined(OPENSSL_SYS_VMS) || defined(OPENSSL_SYS_NEWLIB))
  11. /* outdir is a directory spec, but access() for VMS demands a
  12. filename. In any case, stat(), below, will catch the problem
  13. if outdir is not a directory spec, and the fopen() or open()
  14. Index: openssl-0.9.8g/apps/Makefile
  15. ===================================================================
  16. --- openssl-0.9.8g.orig/apps/Makefile 2008-09-24 11:00:04.000000000 +0200
  17. +++ openssl-0.9.8g/apps/Makefile 2008-09-24 11:01:01.000000000 +0200
  18. @@ -313,18 +313,19 @@
  19. dsa.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h
  20. dsa.o: ../include/openssl/bn.h ../include/openssl/buffer.h
  21. dsa.o: ../include/openssl/conf.h ../include/openssl/crypto.h
  22. -dsa.o: ../include/openssl/dsa.h ../include/openssl/e_os2.h
  23. -dsa.o: ../include/openssl/ec.h ../include/openssl/ecdh.h
  24. -dsa.o: ../include/openssl/ecdsa.h ../include/openssl/engine.h
  25. -dsa.o: ../include/openssl/err.h ../include/openssl/evp.h
  26. -dsa.o: ../include/openssl/lhash.h ../include/openssl/obj_mac.h
  27. -dsa.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h
  28. -dsa.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h
  29. -dsa.o: ../include/openssl/pem.h ../include/openssl/pem2.h
  30. -dsa.o: ../include/openssl/pkcs7.h ../include/openssl/safestack.h
  31. -dsa.o: ../include/openssl/sha.h ../include/openssl/stack.h
  32. -dsa.o: ../include/openssl/symhacks.h ../include/openssl/txt_db.h
  33. -dsa.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h apps.h dsa.c
  34. +dsa.o: ../include/openssl/dh.h ../include/openssl/dsa.h
  35. +dsa.o: ../include/openssl/e_os2.h ../include/openssl/ec.h
  36. +dsa.o: ../include/openssl/ecdh.h ../include/openssl/ecdsa.h
  37. +dsa.o: ../include/openssl/engine.h ../include/openssl/err.h
  38. +dsa.o: ../include/openssl/evp.h ../include/openssl/lhash.h
  39. +dsa.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h
  40. +dsa.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
  41. +dsa.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h
  42. +dsa.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h
  43. +dsa.o: ../include/openssl/safestack.h ../include/openssl/sha.h
  44. +dsa.o: ../include/openssl/stack.h ../include/openssl/symhacks.h
  45. +dsa.o: ../include/openssl/txt_db.h ../include/openssl/x509.h
  46. +dsa.o: ../include/openssl/x509_vfy.h apps.h dsa.c
  47. dsaparam.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h
  48. dsaparam.o: ../include/openssl/bn.h ../include/openssl/buffer.h
  49. dsaparam.o: ../include/openssl/conf.h ../include/openssl/crypto.h
  50. @@ -337,11 +338,9 @@
  51. dsaparam.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
  52. dsaparam.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h
  53. dsaparam.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h
  54. -dsaparam.o: ../include/openssl/rand.h ../include/openssl/rsa.h
  55. dsaparam.o: ../include/openssl/safestack.h ../include/openssl/sha.h
  56. -dsaparam.o: ../include/openssl/stack.h ../include/openssl/store.h
  57. -dsaparam.o: ../include/openssl/symhacks.h ../include/openssl/txt_db.h
  58. -dsaparam.o: ../include/openssl/ui.h ../include/openssl/x509.h
  59. +dsaparam.o: ../include/openssl/stack.h ../include/openssl/symhacks.h
  60. +dsaparam.o: ../include/openssl/txt_db.h ../include/openssl/x509.h
  61. dsaparam.o: ../include/openssl/x509_vfy.h apps.h dsaparam.c
  62. ec.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h
  63. ec.o: ../include/openssl/buffer.h ../include/openssl/conf.h
  64. @@ -430,41 +429,38 @@
  65. gendh.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h
  66. gendh.o: ../include/openssl/bn.h ../include/openssl/buffer.h
  67. gendh.o: ../include/openssl/conf.h ../include/openssl/crypto.h
  68. -gendh.o: ../include/openssl/dh.h ../include/openssl/dsa.h
  69. -gendh.o: ../include/openssl/e_os2.h ../include/openssl/ec.h
  70. -gendh.o: ../include/openssl/ecdh.h ../include/openssl/ecdsa.h
  71. -gendh.o: ../include/openssl/engine.h ../include/openssl/err.h
  72. -gendh.o: ../include/openssl/evp.h ../include/openssl/lhash.h
  73. -gendh.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h
  74. -gendh.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
  75. -gendh.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h
  76. -gendh.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h
  77. -gendh.o: ../include/openssl/rand.h ../include/openssl/rsa.h
  78. +gendh.o: ../include/openssl/dh.h ../include/openssl/e_os2.h
  79. +gendh.o: ../include/openssl/ec.h ../include/openssl/ecdh.h
  80. +gendh.o: ../include/openssl/ecdsa.h ../include/openssl/engine.h
  81. +gendh.o: ../include/openssl/err.h ../include/openssl/evp.h
  82. +gendh.o: ../include/openssl/lhash.h ../include/openssl/obj_mac.h
  83. +gendh.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h
  84. +gendh.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h
  85. +gendh.o: ../include/openssl/pem.h ../include/openssl/pem2.h
  86. +gendh.o: ../include/openssl/pkcs7.h ../include/openssl/rand.h
  87. gendh.o: ../include/openssl/safestack.h ../include/openssl/sha.h
  88. -gendh.o: ../include/openssl/stack.h ../include/openssl/store.h
  89. -gendh.o: ../include/openssl/symhacks.h ../include/openssl/txt_db.h
  90. -gendh.o: ../include/openssl/ui.h ../include/openssl/x509.h
  91. +gendh.o: ../include/openssl/stack.h ../include/openssl/symhacks.h
  92. +gendh.o: ../include/openssl/txt_db.h ../include/openssl/x509.h
  93. gendh.o: ../include/openssl/x509_vfy.h apps.h gendh.c
  94. gendsa.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h
  95. gendsa.o: ../include/openssl/bn.h ../include/openssl/buffer.h
  96. gendsa.o: ../include/openssl/conf.h ../include/openssl/crypto.h
  97. -gendsa.o: ../include/openssl/dsa.h ../include/openssl/e_os2.h
  98. -gendsa.o: ../include/openssl/ec.h ../include/openssl/ecdh.h
  99. -gendsa.o: ../include/openssl/ecdsa.h ../include/openssl/engine.h
  100. -gendsa.o: ../include/openssl/err.h ../include/openssl/evp.h
  101. -gendsa.o: ../include/openssl/lhash.h ../include/openssl/obj_mac.h
  102. -gendsa.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h
  103. -gendsa.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h
  104. -gendsa.o: ../include/openssl/pem.h ../include/openssl/pem2.h
  105. -gendsa.o: ../include/openssl/pkcs7.h ../include/openssl/safestack.h
  106. -gendsa.o: ../include/openssl/sha.h ../include/openssl/stack.h
  107. -gendsa.o: ../include/openssl/symhacks.h ../include/openssl/txt_db.h
  108. -gendsa.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h apps.h
  109. -gendsa.o: gendsa.c
  110. +gendsa.o: ../include/openssl/dh.h ../include/openssl/dsa.h
  111. +gendsa.o: ../include/openssl/e_os2.h ../include/openssl/ec.h
  112. +gendsa.o: ../include/openssl/ecdh.h ../include/openssl/ecdsa.h
  113. +gendsa.o: ../include/openssl/engine.h ../include/openssl/err.h
  114. +gendsa.o: ../include/openssl/evp.h ../include/openssl/lhash.h
  115. +gendsa.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h
  116. +gendsa.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
  117. +gendsa.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h
  118. +gendsa.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h
  119. +gendsa.o: ../include/openssl/safestack.h ../include/openssl/sha.h
  120. +gendsa.o: ../include/openssl/stack.h ../include/openssl/symhacks.h
  121. +gendsa.o: ../include/openssl/txt_db.h ../include/openssl/x509.h
  122. +gendsa.o: ../include/openssl/x509_vfy.h apps.h gendsa.c
  123. genrsa.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h
  124. genrsa.o: ../include/openssl/bn.h ../include/openssl/buffer.h
  125. genrsa.o: ../include/openssl/conf.h ../include/openssl/crypto.h
  126. -genrsa.o: ../include/openssl/dh.h ../include/openssl/dsa.h
  127. genrsa.o: ../include/openssl/e_os2.h ../include/openssl/ec.h
  128. genrsa.o: ../include/openssl/ecdh.h ../include/openssl/ecdsa.h
  129. genrsa.o: ../include/openssl/engine.h ../include/openssl/err.h
  130. @@ -475,9 +471,8 @@
  131. genrsa.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h
  132. genrsa.o: ../include/openssl/rand.h ../include/openssl/rsa.h
  133. genrsa.o: ../include/openssl/safestack.h ../include/openssl/sha.h
  134. -genrsa.o: ../include/openssl/stack.h ../include/openssl/store.h
  135. -genrsa.o: ../include/openssl/symhacks.h ../include/openssl/txt_db.h
  136. -genrsa.o: ../include/openssl/ui.h ../include/openssl/x509.h
  137. +genrsa.o: ../include/openssl/stack.h ../include/openssl/symhacks.h
  138. +genrsa.o: ../include/openssl/txt_db.h ../include/openssl/x509.h
  139. genrsa.o: ../include/openssl/x509_vfy.h apps.h genrsa.c
  140. nseq.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h
  141. nseq.o: ../include/openssl/buffer.h ../include/openssl/conf.h
  142. @@ -634,12 +629,11 @@
  143. req.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
  144. req.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h
  145. req.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h
  146. -req.o: ../include/openssl/rand.h ../include/openssl/rsa.h
  147. -req.o: ../include/openssl/safestack.h ../include/openssl/sha.h
  148. -req.o: ../include/openssl/stack.h ../include/openssl/store.h
  149. +req.o: ../include/openssl/rsa.h ../include/openssl/safestack.h
  150. +req.o: ../include/openssl/sha.h ../include/openssl/stack.h
  151. req.o: ../include/openssl/symhacks.h ../include/openssl/txt_db.h
  152. -req.o: ../include/openssl/ui.h ../include/openssl/x509.h
  153. -req.o: ../include/openssl/x509_vfy.h ../include/openssl/x509v3.h apps.h req.c
  154. +req.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h
  155. +req.o: ../include/openssl/x509v3.h apps.h req.c
  156. rsa.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h
  157. rsa.o: ../include/openssl/bn.h ../include/openssl/buffer.h
  158. rsa.o: ../include/openssl/conf.h ../include/openssl/crypto.h
  159. @@ -656,20 +650,21 @@
  160. rsa.o: ../include/openssl/symhacks.h ../include/openssl/txt_db.h
  161. rsa.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h apps.h rsa.c
  162. rsautl.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h
  163. -rsautl.o: ../include/openssl/buffer.h ../include/openssl/conf.h
  164. -rsautl.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
  165. -rsautl.o: ../include/openssl/ec.h ../include/openssl/ecdh.h
  166. -rsautl.o: ../include/openssl/ecdsa.h ../include/openssl/engine.h
  167. -rsautl.o: ../include/openssl/err.h ../include/openssl/evp.h
  168. -rsautl.o: ../include/openssl/lhash.h ../include/openssl/obj_mac.h
  169. -rsautl.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h
  170. -rsautl.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h
  171. -rsautl.o: ../include/openssl/pem.h ../include/openssl/pem2.h
  172. -rsautl.o: ../include/openssl/pkcs7.h ../include/openssl/rsa.h
  173. -rsautl.o: ../include/openssl/safestack.h ../include/openssl/sha.h
  174. -rsautl.o: ../include/openssl/stack.h ../include/openssl/symhacks.h
  175. -rsautl.o: ../include/openssl/txt_db.h ../include/openssl/x509.h
  176. -rsautl.o: ../include/openssl/x509_vfy.h apps.h rsautl.c
  177. +rsautl.o: ../include/openssl/bn.h ../include/openssl/buffer.h
  178. +rsautl.o: ../include/openssl/conf.h ../include/openssl/crypto.h
  179. +rsautl.o: ../include/openssl/e_os2.h ../include/openssl/ec.h
  180. +rsautl.o: ../include/openssl/ecdh.h ../include/openssl/ecdsa.h
  181. +rsautl.o: ../include/openssl/engine.h ../include/openssl/err.h
  182. +rsautl.o: ../include/openssl/evp.h ../include/openssl/lhash.h
  183. +rsautl.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h
  184. +rsautl.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
  185. +rsautl.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h
  186. +rsautl.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h
  187. +rsautl.o: ../include/openssl/rsa.h ../include/openssl/safestack.h
  188. +rsautl.o: ../include/openssl/sha.h ../include/openssl/stack.h
  189. +rsautl.o: ../include/openssl/symhacks.h ../include/openssl/txt_db.h
  190. +rsautl.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h apps.h
  191. +rsautl.o: rsautl.c
  192. s_cb.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h
  193. s_cb.o: ../include/openssl/bn.h ../include/openssl/buffer.h
  194. s_cb.o: ../include/openssl/comp.h ../include/openssl/conf.h
  195. @@ -711,29 +706,8 @@
  196. s_client.o: ../include/openssl/tls1.h ../include/openssl/txt_db.h
  197. s_client.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h apps.h
  198. s_client.o: s_apps.h s_client.c timeouts.h
  199. -s_server.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h
  200. -s_server.o: ../include/openssl/bn.h ../include/openssl/buffer.h
  201. -s_server.o: ../include/openssl/comp.h ../include/openssl/conf.h
  202. -s_server.o: ../include/openssl/crypto.h ../include/openssl/dh.h
  203. -s_server.o: ../include/openssl/dsa.h ../include/openssl/dtls1.h
  204. -s_server.o: ../include/openssl/e_os2.h ../include/openssl/ec.h
  205. -s_server.o: ../include/openssl/ecdh.h ../include/openssl/ecdsa.h
  206. -s_server.o: ../include/openssl/engine.h ../include/openssl/err.h
  207. -s_server.o: ../include/openssl/evp.h ../include/openssl/kssl.h
  208. -s_server.o: ../include/openssl/lhash.h ../include/openssl/obj_mac.h
  209. -s_server.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h
  210. -s_server.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h
  211. -s_server.o: ../include/openssl/pem.h ../include/openssl/pem2.h
  212. -s_server.o: ../include/openssl/pkcs7.h ../include/openssl/pq_compat.h
  213. -s_server.o: ../include/openssl/pqueue.h ../include/openssl/rand.h
  214. -s_server.o: ../include/openssl/rsa.h ../include/openssl/safestack.h
  215. -s_server.o: ../include/openssl/sha.h ../include/openssl/ssl.h
  216. -s_server.o: ../include/openssl/ssl2.h ../include/openssl/ssl23.h
  217. -s_server.o: ../include/openssl/ssl3.h ../include/openssl/stack.h
  218. -s_server.o: ../include/openssl/store.h ../include/openssl/symhacks.h
  219. -s_server.o: ../include/openssl/tls1.h ../include/openssl/txt_db.h
  220. -s_server.o: ../include/openssl/ui.h ../include/openssl/x509.h
  221. -s_server.o: ../include/openssl/x509_vfy.h apps.h s_apps.h s_server.c timeouts.h
  222. +s_server.o: ../include/openssl/e_os2.h ../include/openssl/opensslconf.h
  223. +s_server.o: s_server.c
  224. s_socket.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h
  225. s_socket.o: ../include/openssl/bn.h ../include/openssl/buffer.h
  226. s_socket.o: ../include/openssl/comp.h ../include/openssl/conf.h
  227. @@ -814,24 +788,25 @@
  228. speed.o: ../include/openssl/bn.h ../include/openssl/buffer.h
  229. speed.o: ../include/openssl/cast.h ../include/openssl/conf.h
  230. speed.o: ../include/openssl/crypto.h ../include/openssl/des.h
  231. -speed.o: ../include/openssl/des_old.h ../include/openssl/dsa.h
  232. -speed.o: ../include/openssl/e_os2.h ../include/openssl/ec.h
  233. -speed.o: ../include/openssl/ecdh.h ../include/openssl/ecdsa.h
  234. -speed.o: ../include/openssl/engine.h ../include/openssl/err.h
  235. -speed.o: ../include/openssl/evp.h ../include/openssl/hmac.h
  236. -speed.o: ../include/openssl/idea.h ../include/openssl/lhash.h
  237. -speed.o: ../include/openssl/md2.h ../include/openssl/md4.h
  238. -speed.o: ../include/openssl/md5.h ../include/openssl/obj_mac.h
  239. -speed.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h
  240. -speed.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h
  241. -speed.o: ../include/openssl/pkcs7.h ../include/openssl/rand.h
  242. -speed.o: ../include/openssl/rc2.h ../include/openssl/rc4.h
  243. -speed.o: ../include/openssl/ripemd.h ../include/openssl/rsa.h
  244. -speed.o: ../include/openssl/safestack.h ../include/openssl/sha.h
  245. -speed.o: ../include/openssl/stack.h ../include/openssl/symhacks.h
  246. -speed.o: ../include/openssl/txt_db.h ../include/openssl/ui.h
  247. -speed.o: ../include/openssl/ui_compat.h ../include/openssl/x509.h
  248. -speed.o: ../include/openssl/x509_vfy.h apps.h speed.c testdsa.h testrsa.h
  249. +speed.o: ../include/openssl/des_old.h ../include/openssl/dh.h
  250. +speed.o: ../include/openssl/dsa.h ../include/openssl/e_os2.h
  251. +speed.o: ../include/openssl/ec.h ../include/openssl/ecdh.h
  252. +speed.o: ../include/openssl/ecdsa.h ../include/openssl/engine.h
  253. +speed.o: ../include/openssl/err.h ../include/openssl/evp.h
  254. +speed.o: ../include/openssl/hmac.h ../include/openssl/idea.h
  255. +speed.o: ../include/openssl/lhash.h ../include/openssl/md2.h
  256. +speed.o: ../include/openssl/md4.h ../include/openssl/md5.h
  257. +speed.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h
  258. +speed.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
  259. +speed.o: ../include/openssl/ossl_typ.h ../include/openssl/pkcs7.h
  260. +speed.o: ../include/openssl/rand.h ../include/openssl/rc2.h
  261. +speed.o: ../include/openssl/rc4.h ../include/openssl/ripemd.h
  262. +speed.o: ../include/openssl/rsa.h ../include/openssl/safestack.h
  263. +speed.o: ../include/openssl/sha.h ../include/openssl/stack.h
  264. +speed.o: ../include/openssl/symhacks.h ../include/openssl/txt_db.h
  265. +speed.o: ../include/openssl/ui.h ../include/openssl/ui_compat.h
  266. +speed.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h apps.h speed.c
  267. +speed.o: testdsa.h testrsa.h
  268. spkac.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h
  269. spkac.o: ../include/openssl/buffer.h ../include/openssl/conf.h
  270. spkac.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
  271. @@ -882,16 +857,17 @@
  272. x509.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h
  273. x509.o: ../include/openssl/bn.h ../include/openssl/buffer.h
  274. x509.o: ../include/openssl/conf.h ../include/openssl/crypto.h
  275. -x509.o: ../include/openssl/dsa.h ../include/openssl/e_os2.h
  276. -x509.o: ../include/openssl/ec.h ../include/openssl/ecdh.h
  277. -x509.o: ../include/openssl/ecdsa.h ../include/openssl/engine.h
  278. -x509.o: ../include/openssl/err.h ../include/openssl/evp.h
  279. -x509.o: ../include/openssl/lhash.h ../include/openssl/obj_mac.h
  280. -x509.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h
  281. -x509.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h
  282. -x509.o: ../include/openssl/pem.h ../include/openssl/pem2.h
  283. -x509.o: ../include/openssl/pkcs7.h ../include/openssl/rsa.h
  284. -x509.o: ../include/openssl/safestack.h ../include/openssl/sha.h
  285. -x509.o: ../include/openssl/stack.h ../include/openssl/symhacks.h
  286. -x509.o: ../include/openssl/txt_db.h ../include/openssl/x509.h
  287. -x509.o: ../include/openssl/x509_vfy.h ../include/openssl/x509v3.h apps.h x509.c
  288. +x509.o: ../include/openssl/dh.h ../include/openssl/dsa.h
  289. +x509.o: ../include/openssl/e_os2.h ../include/openssl/ec.h
  290. +x509.o: ../include/openssl/ecdh.h ../include/openssl/ecdsa.h
  291. +x509.o: ../include/openssl/engine.h ../include/openssl/err.h
  292. +x509.o: ../include/openssl/evp.h ../include/openssl/lhash.h
  293. +x509.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h
  294. +x509.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
  295. +x509.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h
  296. +x509.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h
  297. +x509.o: ../include/openssl/rsa.h ../include/openssl/safestack.h
  298. +x509.o: ../include/openssl/sha.h ../include/openssl/stack.h
  299. +x509.o: ../include/openssl/symhacks.h ../include/openssl/txt_db.h
  300. +x509.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h
  301. +x509.o: ../include/openssl/x509v3.h apps.h x509.c
  302. Index: openssl-0.9.8g/apps/s_client.c
  303. ===================================================================
  304. --- openssl-0.9.8g.orig/apps/s_client.c 2008-09-24 11:00:04.000000000 +0200
  305. +++ openssl-0.9.8g/apps/s_client.c 2008-09-24 11:01:01.000000000 +0200
  306. @@ -137,6 +137,8 @@
  307. #include "s_apps.h"
  308. #include "timeouts.h"
  309. +#ifndef OPENSSL_SYS_NEWLIB
  310. +
  311. #ifdef OPENSSL_SYS_WINCE
  312. /* Windows CE incorrectly defines fileno as returning void*, so to avoid problems below... */
  313. #ifdef fileno
  314. @@ -1430,3 +1432,4 @@
  315. (void)BIO_flush(bio);
  316. }
  317. +#endif
  318. Index: openssl-0.9.8g/apps/speed.c
  319. ===================================================================
  320. --- openssl-0.9.8g.orig/apps/speed.c 2008-09-24 11:00:04.000000000 +0200
  321. +++ openssl-0.9.8g/apps/speed.c 2008-09-24 11:01:01.000000000 +0200
  322. @@ -237,6 +237,11 @@
  323. */
  324. /* The following if from times(3) man page. It may need to be changed */
  325. +#ifdef OPENSSL_SYS_NEWLIB
  326. +#define HZ 1000000.0
  327. +#endif
  328. +
  329. +
  330. #ifndef HZ
  331. # if defined(_SC_CLK_TCK) \
  332. && (!defined(OPENSSL_SYS_VMS) || __CTRL_VER >= 70000000)
  333. @@ -254,7 +259,7 @@
  334. # endif
  335. #endif
  336. -#if !defined(OPENSSL_SYS_VMS) && !defined(OPENSSL_SYS_WINDOWS) && !defined(OPENSSL_SYS_MACINTOSH_CLASSIC) && !defined(OPENSSL_SYS_OS2) && !defined(OPENSSL_SYS_NETWARE)
  337. +# if !defined(OPENSSL_SYS_NEWLIB) && !defined(OPENSSL_SYS_VMS) && !defined(OPENSSL_SYS_WINDOWS) && !defined(OPENSSL_SYS_MACINTOSH_CLASSIC) && !defined(OPENSSL_SYS_OS2) && !defined(OPENSSL_SYS_NETWARE)
  338. # define HAVE_FORK 1
  339. #endif
  340. @@ -307,6 +312,10 @@
  341. static int rnd_fake = 0;
  342. #endif
  343. +#ifdef OPENSSL_SYS_NEWLIB
  344. +#undef SIGALRM
  345. +#endif
  346. +
  347. #ifdef SIGALRM
  348. #if defined(__STDC__) || defined(sgi) || defined(_AIX)
  349. #define SIGRETTYPE void
  350. @@ -2675,6 +2684,10 @@
  351. OPENSSL_EXIT(mret);
  352. }
  353. +#ifdef OPENSSL_SYS_NEWLIB
  354. +#undef SIGALRM
  355. +#endif
  356. +
  357. static void print_message(const char *s, long num, int length)
  358. {
  359. #ifdef SIGALRM
  360. Index: openssl-0.9.8g/apps/s_server.c
  361. ===================================================================
  362. --- openssl-0.9.8g.orig/apps/s_server.c 2008-09-24 11:00:04.000000000 +0200
  363. +++ openssl-0.9.8g/apps/s_server.c 2008-09-24 11:01:01.000000000 +0200
  364. @@ -127,6 +127,7 @@
  365. #include <sys/stat.h>
  366. #include <openssl/e_os2.h>
  367. +#ifndef OPENSSL_SYS_NEWLIB
  368. #ifdef OPENSSL_NO_STDIO
  369. #define APPS_WIN16
  370. #endif
  371. @@ -2287,3 +2288,5 @@
  372. return 0;
  373. return 1;
  374. }
  375. +
  376. +#endif
  377. Index: openssl-0.9.8g/apps/s_time.c
  378. ===================================================================
  379. --- openssl-0.9.8g.orig/apps/s_time.c 2008-09-24 11:00:04.000000000 +0200
  380. +++ openssl-0.9.8g/apps/s_time.c 2008-09-24 11:01:01.000000000 +0200
  381. @@ -117,6 +117,8 @@
  382. /* The following if from times(3) man page. It may need to be changed
  383. */
  384. +#ifndef OPENSSL_SYS_NEWLIB
  385. +
  386. #ifndef HZ
  387. # ifdef _SC_CLK_TCK
  388. # define HZ ((double)sysconf(_SC_CLK_TCK))
  389. @@ -732,4 +734,5 @@
  390. return serverCon;
  391. }
  392. +#endif
  393. Index: openssl-0.9.8g/bench/dummy_rand.c
  394. ===================================================================
  395. --- /dev/null 1970-01-01 00:00:00.000000000 +0000
  396. +++ openssl-0.9.8g/bench/dummy_rand.c 2008-09-24 11:01:01.000000000 +0200
  397. @@ -0,0 +1,55 @@
  398. +#include <openssl/rand.h>
  399. +#include <stdlib.h>
  400. +
  401. +static void dummy_rand_cleanup(void);
  402. +static void dummy_rand_seed(const void *buf, int num);
  403. +static void dummy_rand_add(const void *buf, int num, double add_entropy);
  404. +static int dummy_rand_bytes(unsigned char *buf, int num);
  405. +static int dummy_rand_pseudo_bytes(unsigned char *buf, int num);
  406. +static int dummy_rand_status(void);
  407. +
  408. +RAND_METHOD rand_dummy_meth={
  409. + dummy_rand_seed,
  410. + dummy_rand_bytes,
  411. + dummy_rand_cleanup,
  412. + dummy_rand_add,
  413. + dummy_rand_pseudo_bytes,
  414. + dummy_rand_status
  415. + };
  416. +
  417. +RAND_METHOD *RAND_dummy(void)
  418. +{
  419. + return(&rand_dummy_meth);
  420. +}
  421. +
  422. +static void dummy_rand_cleanup(void)
  423. +{
  424. +}
  425. +
  426. +static void dummy_rand_add(const void *buf, int num, double add)
  427. +{
  428. +}
  429. +
  430. +static void dummy_rand_seed(const void *buf, int num)
  431. +{
  432. +}
  433. +
  434. +static int dummy_rand_bytes(unsigned char *buf, int num)
  435. +{
  436. + int i;
  437. + for (i=0; i < num; i++)
  438. + buf[i] = (unsigned char)rand();
  439. + return 1;
  440. +}
  441. +
  442. +/* pseudo-random bytes that are guaranteed to be unique but not
  443. + unpredictable */
  444. +static int dummy_rand_pseudo_bytes(unsigned char *buf, int num)
  445. +{
  446. + return dummy_rand_bytes(buf, num);
  447. +}
  448. +
  449. +static int dummy_rand_status(void)
  450. +{
  451. + return 1;
  452. +}
  453. Index: openssl-0.9.8g/bench/Makefile
  454. ===================================================================
  455. --- /dev/null 1970-01-01 00:00:00.000000000 +0000
  456. +++ openssl-0.9.8g/bench/Makefile 2008-09-24 11:01:01.000000000 +0200
  457. @@ -0,0 +1,139 @@
  458. +#
  459. +# bench/Makefile
  460. +#
  461. +
  462. +DIR= bench
  463. +TOP= ..
  464. +CC= cc
  465. +INCLUDES= -I$(TOP) -I../include -I../apps
  466. +CFLAG= -g -static
  467. +MAKEFILE= Makefile
  468. +PERL= perl
  469. +RM= rm -f
  470. +
  471. +PEX_LIBS=
  472. +EX_LIBS=
  473. +EXE_EXT=
  474. +
  475. +SHLIB_TARGET=
  476. +
  477. +CFLAGS= -DMONOLITH $(INCLUDES) $(CFLAG)
  478. +
  479. +GENERAL=Makefile
  480. +
  481. +DLIBCRYPTO=../libcrypto.a
  482. +LIBCRYPTO=-L.. -lcrypto
  483. +
  484. +
  485. +EXE= speed-avr32
  486. +
  487. +E_EXE= speed-avr32
  488. +
  489. +
  490. +E_OBJ= speed-avr32.o dummy_rand.o
  491. +
  492. +E_SRC= speed-avr32.c dummy_rand.c
  493. +
  494. +SRC=$(E_SRC)
  495. +
  496. +HEADER=
  497. +
  498. +ALL= $(GENERAL) $(SRC) $(HEADER)
  499. +
  500. +top:
  501. + @(cd ..; $(MAKE) DIRS=$(DIR) all)
  502. +
  503. +all: exe
  504. +
  505. +exe: $(EXE)
  506. +
  507. +
  508. +files:
  509. + $(PERL) $(TOP)/util/files.pl Makefile >> $(TOP)/MINFO
  510. +
  511. +install:
  512. +
  513. +tags:
  514. + ctags $(SRC)
  515. +
  516. +tests:
  517. +
  518. +links:
  519. +
  520. +lint:
  521. + lint -DLINT $(INCLUDES) $(SRC)>fluff
  522. +
  523. +depend:
  524. + @if [ -z "$(THIS)" ]; then \
  525. + $(MAKE) -f $(TOP)/Makefile reflect THIS=$@; \
  526. + else \
  527. + $(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(SRC); \
  528. + fi
  529. +
  530. +dclean:
  531. + $(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new
  532. + mv -f Makefile.new $(MAKEFILE)
  533. +
  534. +clean:
  535. + rm -f *.o *.obj lib tags core .pure .nfs* *.old *.bak fluff $(EXE)
  536. +
  537. +
  538. +$(DLIBCRYPTO):
  539. + (cd ..; $(MAKE) DIRS=crypto all)
  540. +
  541. +$(EXE): $(E_OBJ) $(DLIBCRYPTO) Makefile
  542. + $(RM) $(EXE)
  543. + shlib_target=; if [ -n "$(SHARED_LIBS)" ]; then \
  544. + shlib_target="$(SHLIB_TARGET)"; \
  545. + fi; \
  546. + LIBRARIES="$(LIBKRB5) $(LIBCRYPTO)" ; \
  547. + $(MAKE) -f $(TOP)/Makefile.shared -e \
  548. + APPNAME=$(EXE) OBJECTS="$(E_OBJ)" \
  549. + LIBDEPS="$(PEX_LIBS) $$LIBRARIES $(EX_LIBS)" \
  550. + link_app.$${shlib_target}
  551. +
  552. +
  553. +
  554. +CFLAGS += -D__FLASH_WS__
  555. +CFLAGS += -D__SETUP_OSC__
  556. +CFLAGS += -DHZ=66000000
  557. +CFLAGS += -DOPENSSL_NO_MD2 -DOPENSSL_NO_MD4
  558. +CFLAGS += -DOPENSSL_NO_MD5 -DOPENSSL_NO_MDC2 -DOPENSSL_NO_SHA
  559. +CFLAGS += -DOPENSSL_NO_RIPEMD -DOPENSSL_NO_CAMELLIA -DOPENSSL_NO_HMAC
  560. +CFLAGS += -DOPENSSL_NO_SHA -DOPENSSL_NO_RC4 -DOPENSSL_NO_RC5 -DOPENSSL_NO_RC2
  561. +CFLAGS += -DOPENSSL_NO_IDEA -DOPENSSL_NO_SEED -DOPENSSL_NO_BF
  562. +CFLAGS += -DOPENSSL_NO_CAST -DOPENSSL_NO_DSA -DOPENSSL_NO_ECDSA
  563. +CFLAGS += -DOPENSSL_NO_ENGINE -DRSA_NULL
  564. +CFLAGS += -DOPENSSL_NO_ECDH -DOPENSSL_NO_EC
  565. +#CFLAGS += -DOPENSSL_NO_DES
  566. +#CFLAGS += -DOPENSSL_NO_AES
  567. +#CFLAGS += -DOPENSSL_NO_RSA
  568. +
  569. +
  570. +# DO NOT DELETE THIS LINE -- make depend depends on it.
  571. +
  572. +dummy_rand.o: ../include/openssl/e_os2.h ../include/openssl/opensslconf.h
  573. +dummy_rand.o: ../include/openssl/ossl_typ.h ../include/openssl/rand.h
  574. +dummy_rand.o: dummy_rand.c
  575. +speed-avr32.o: ../apps/./testdsa.h ../apps/./testrsa.h ../include/openssl/aes.h
  576. +speed-avr32.o: ../include/openssl/asn1.h ../include/openssl/bio.h
  577. +speed-avr32.o: ../include/openssl/blowfish.h ../include/openssl/bn.h
  578. +speed-avr32.o: ../include/openssl/buffer.h ../include/openssl/cast.h
  579. +speed-avr32.o: ../include/openssl/crypto.h ../include/openssl/des.h
  580. +speed-avr32.o: ../include/openssl/des_old.h ../include/openssl/dsa.h
  581. +speed-avr32.o: ../include/openssl/e_os2.h ../include/openssl/ec.h
  582. +speed-avr32.o: ../include/openssl/ecdh.h ../include/openssl/ecdsa.h
  583. +speed-avr32.o: ../include/openssl/err.h ../include/openssl/evp.h
  584. +speed-avr32.o: ../include/openssl/hmac.h ../include/openssl/idea.h
  585. +speed-avr32.o: ../include/openssl/lhash.h ../include/openssl/md2.h
  586. +speed-avr32.o: ../include/openssl/md4.h ../include/openssl/md5.h
  587. +speed-avr32.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h
  588. +speed-avr32.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
  589. +speed-avr32.o: ../include/openssl/ossl_typ.h ../include/openssl/pkcs7.h
  590. +speed-avr32.o: ../include/openssl/rand.h ../include/openssl/rc2.h
  591. +speed-avr32.o: ../include/openssl/rc4.h ../include/openssl/ripemd.h
  592. +speed-avr32.o: ../include/openssl/rsa.h ../include/openssl/safestack.h
  593. +speed-avr32.o: ../include/openssl/sha.h ../include/openssl/stack.h
  594. +speed-avr32.o: ../include/openssl/symhacks.h ../include/openssl/ui.h
  595. +speed-avr32.o: ../include/openssl/ui_compat.h ../include/openssl/x509.h
  596. +speed-avr32.o: ../include/openssl/x509_vfy.h speed-avr32.c
  597. Index: openssl-0.9.8g/bench/speed-avr32.c
  598. ===================================================================
  599. --- /dev/null 1970-01-01 00:00:00.000000000 +0000
  600. +++ openssl-0.9.8g/bench/speed-avr32.c 2008-09-24 11:01:01.000000000 +0200
  601. @@ -0,0 +1,2966 @@
  602. +/* apps/speed.c -*- mode:C; c-file-style: "eay" -*- */
  603. +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
  604. + * All rights reserved.
  605. + *
  606. + * This package is an SSL implementation written
  607. + * by Eric Young (eay@cryptsoft.com).
  608. + * The implementation was written so as to conform with Netscapes SSL.
  609. + *
  610. + * This library is free for commercial and non-commercial use as long as
  611. + * the following conditions are aheared to. The following conditions
  612. + * apply to all code found in this distribution, be it the RC4, RSA,
  613. + * lhash, DES, etc., code; not just the SSL code. The SSL documentation
  614. + * included with this distribution is covered by the same copyright terms
  615. + * except that the holder is Tim Hudson (tjh@cryptsoft.com).
  616. + *
  617. + * Copyright remains Eric Young's, and as such any Copyright notices in
  618. + * the code are not to be removed.
  619. + * If this package is used in a product, Eric Young should be given attribution
  620. + * as the author of the parts of the library used.
  621. + * This can be in the form of a textual message at program startup or
  622. + * in documentation (online or textual) provided with the package.
  623. + *
  624. + * Redistribution and use in source and binary forms, with or without
  625. + * modification, are permitted provided that the following conditions
  626. + * are met:
  627. + * 1. Redistributions of source code must retain the copyright
  628. + * notice, this list of conditions and the following disclaimer.
  629. + * 2. Redistributions in binary form must reproduce the above copyright
  630. + * notice, this list of conditions and the following disclaimer in the
  631. + * documentation and/or other materials provided with the distribution.
  632. + * 3. All advertising materials mentioning features or use of this software
  633. + * must display the following acknowledgement:
  634. + * "This product includes cryptographic software written by
  635. + * Eric Young (eay@cryptsoft.com)"
  636. + * The word 'cryptographic' can be left out if the rouines from the library
  637. + * being used are not cryptographic related :-).
  638. + * 4. If you include any Windows specific code (or a derivative thereof) from
  639. + * the apps directory (application code) you must include an acknowledgement:
  640. + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
  641. + *
  642. + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
  643. + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  644. + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  645. + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
  646. + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  647. + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  648. + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  649. + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  650. + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  651. + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  652. + * SUCH DAMAGE.
  653. + *
  654. + * The licence and distribution terms for any publically available version or
  655. + * derivative of this code cannot be changed. i.e. this code cannot simply be
  656. + * copied and put under another distribution licence
  657. + * [including the GNU Public Licence.]
  658. + */
  659. +/* ====================================================================
  660. + * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED.
  661. + *
  662. + * Portions of the attached software ("Contribution") are developed by
  663. + * SUN MICROSYSTEMS, INC., and are contributed to the OpenSSL project.
  664. + *
  665. + * The Contribution is licensed pursuant to the OpenSSL open source
  666. + * license provided above.
  667. + *
  668. + * The ECDH and ECDSA speed test software is originally written by
  669. + * Sumit Gupta of Sun Microsystems Laboratories.
  670. + *
  671. + */
  672. +
  673. +/* most of this code has been pilfered from my libdes speed.c program */
  674. +
  675. +
  676. +#undef SECONDS
  677. +#define SECONDS 3
  678. +#define RSA_SECONDS 10
  679. +#define DSA_SECONDS 10
  680. +#define ECDSA_SECONDS 10
  681. +#define ECDH_SECONDS 10
  682. +
  683. +
  684. +#include <stdio.h>
  685. +#include <stdlib.h>
  686. +
  687. +#include <string.h>
  688. +#include <math.h>
  689. +//#include "apps.h"
  690. +#define MAIN main
  691. +#ifdef OPENSSL_NO_STDIO
  692. +#define APPS_WIN16
  693. +#endif
  694. +#include <openssl/crypto.h>
  695. +#include <openssl/rand.h>
  696. +#include <openssl/err.h>
  697. +#include <openssl/evp.h>
  698. +#include <openssl/objects.h>
  699. +#if !defined(OPENSSL_SYS_MSDOS)
  700. +#include OPENSSL_UNISTD
  701. +#endif
  702. +
  703. +#ifndef OPENSSL_SYS_NETWARE
  704. +#include <signal.h>
  705. +#endif
  706. +
  707. +#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(OPENSSL_SYS_MACOSX)
  708. +# define USE_TOD
  709. +#elif !defined(OPENSSL_SYS_MSDOS) && !defined(OPENSSL_SYS_VXWORKS) && (!defined(OPENSSL_SYS_VMS) || defined(__DECC))
  710. +# define TIMES
  711. +#endif
  712. +#if !defined(OPENSSL_SYS_NEWLIB) && !defined(_UNICOS) && !defined(__OpenBSD__) && !defined(sgi) && !defined(__FreeBSD__) && !(defined(__bsdi) || defined(__bsdi__)) && !defined(_AIX) && !defined(OPENSSL_SYS_MPE) && !defined(__NetBSD__) && !defined(OPENSSL_SYS_VXWORKS) /* FIXME */
  713. +# define TIMEB
  714. +#endif
  715. +
  716. +#if defined(OPENSSL_SYS_NETWARE)
  717. +#undef TIMES
  718. +#undef TIMEB
  719. +#include <time.h>
  720. +#endif
  721. +
  722. +#ifndef _IRIX
  723. +# include <time.h>
  724. +#endif
  725. +#ifdef TIMES
  726. +# include <sys/types.h>
  727. +# include <sys/times.h>
  728. +#endif
  729. +#ifdef USE_TOD
  730. +# include <sys/time.h>
  731. +# include <sys/resource.h>
  732. +#endif
  733. +
  734. +/* Depending on the VMS version, the tms structure is perhaps defined.
  735. + The __TMS macro will show if it was. If it wasn't defined, we should
  736. + undefine TIMES, since that tells the rest of the program how things
  737. + should be handled. -- Richard Levitte */
  738. +#if defined(OPENSSL_SYS_VMS_DECC) && !defined(__TMS)
  739. +#undef TIMES
  740. +#endif
  741. +
  742. +#ifdef TIMEB
  743. +#include <sys/timeb.h>
  744. +#endif
  745. +
  746. +#if !defined(TIMES) && !defined(TIMEB) && !defined(USE_TOD) && !defined(OPENSSL_SYS_VXWORKS) && !defined(OPENSSL_SYS_NETWARE)
  747. +#error "It seems neither struct tms nor struct timeb is supported in this platform!"
  748. +#endif
  749. +
  750. +#if defined(sun) || defined(__ultrix)
  751. +#define _POSIX_SOURCE
  752. +#include <limits.h>
  753. +#include <sys/param.h>
  754. +#endif
  755. +
  756. +#include <openssl/bn.h>
  757. +#ifndef OPENSSL_NO_DES
  758. +#include <openssl/des.h>
  759. +#endif
  760. +#ifndef OPENSSL_NO_AES
  761. +#include <openssl/aes.h>
  762. +#endif
  763. +#ifndef OPENSSL_NO_CAMELLIA
  764. +#include <openssl/camellia.h>
  765. +#endif
  766. +#ifndef OPENSSL_NO_MD2
  767. +#include <openssl/md2.h>
  768. +#endif
  769. +#ifndef OPENSSL_NO_MDC2
  770. +#include <openssl/mdc2.h>
  771. +#endif
  772. +#ifndef OPENSSL_NO_MD4
  773. +#include <openssl/md4.h>
  774. +#endif
  775. +#ifndef OPENSSL_NO_MD5
  776. +#include <openssl/md5.h>
  777. +#endif
  778. +#ifndef OPENSSL_NO_HMAC
  779. +#include <openssl/hmac.h>
  780. +#endif
  781. +#include <openssl/evp.h>
  782. +#ifndef OPENSSL_NO_SHA
  783. +#include <openssl/sha.h>
  784. +#endif
  785. +#ifndef OPENSSL_NO_RIPEMD
  786. +#include <openssl/ripemd.h>
  787. +#endif
  788. +#ifndef OPENSSL_NO_RC4
  789. +#include <openssl/rc4.h>
  790. +#endif
  791. +#ifndef OPENSSL_NO_RC5
  792. +#include <openssl/rc5.h>
  793. +#endif
  794. +#ifndef OPENSSL_NO_RC2
  795. +#include <openssl/rc2.h>
  796. +#endif
  797. +#ifndef OPENSSL_NO_IDEA
  798. +#include <openssl/idea.h>
  799. +#endif
  800. +#ifndef OPENSSL_NO_SEED
  801. +#include <openssl/seed.h>
  802. +#endif
  803. +#ifndef OPENSSL_NO_BF
  804. +#include <openssl/blowfish.h>
  805. +#endif
  806. +#ifndef OPENSSL_NO_CAST
  807. +#include <openssl/cast.h>
  808. +#endif
  809. +#ifndef OPENSSL_NO_RSA
  810. +#include <openssl/rsa.h>
  811. +#include "./testrsa.h"
  812. +#endif
  813. +#include <openssl/x509.h>
  814. +#ifndef OPENSSL_NO_DSA
  815. +#include <openssl/dsa.h>
  816. +#include "./testdsa.h"
  817. +#endif
  818. +#ifndef OPENSSL_NO_ECDSA
  819. +#include <openssl/ecdsa.h>
  820. +#endif
  821. +#ifndef OPENSSL_NO_ECDH
  822. +#include <openssl/ecdh.h>
  823. +#endif
  824. +
  825. +/*
  826. + * The following "HZ" timing stuff should be sync'd up with the code in
  827. + * crypto/tmdiff.[ch]. That appears to try to do the same job, though I think
  828. + * this code is more up to date than libcrypto's so there may be features to
  829. + * migrate over first. This is used in two places further down AFAICS.
  830. + * The point is that nothing in openssl actually *uses* that tmdiff stuff, so
  831. + * either speed.c should be using it or it should go because it's obviously not
  832. + * useful enough. Anyone want to do a janitorial job on this?
  833. + */
  834. +
  835. +/* The following if from times(3) man page. It may need to be changed */
  836. +
  837. +#undef BIO_flush
  838. +#undef BIO_printf
  839. +#define BIO_flush fflush
  840. +#define BIO_printf fprintf
  841. +#define bio_err stderr
  842. +
  843. +//#define fprintf(...) /* */
  844. +//#define printf(...) /* */
  845. +
  846. +#ifndef HZ
  847. +# if defined(_SC_CLK_TCK) \
  848. + && (!defined(OPENSSL_SYS_VMS) || __CTRL_VER >= 70000000)
  849. +# define HZ sysconf(_SC_CLK_TCK)
  850. +# else
  851. +# ifndef CLK_TCK
  852. +# ifndef _BSD_CLK_TCK_ /* FreeBSD hack */
  853. +# define HZ 100.0
  854. +# else /* _BSD_CLK_TCK_ */
  855. +# define HZ ((double)_BSD_CLK_TCK_)
  856. +# endif
  857. +# else /* CLK_TCK */
  858. +# define HZ ((double)CLK_TCK)
  859. +# endif
  860. +# endif
  861. +#endif
  862. +
  863. +# if !defined(OPENSSL_SYS_NEWLIB) && !defined(OPENSSL_SYS_VMS) && !defined(OPENSSL_SYS_WINDOWS) && !defined(OPENSSL_SYS_MACINTOSH_CLASSIC) && !defined(OPENSSL_SYS_OS2) && !defined(OPENSSL_SYS_NETWARE)
  864. +# define HAVE_FORK 1
  865. +#endif
  866. +
  867. +#undef BUFSIZE
  868. +#define BUFSIZE ((long)1024*8+1)
  869. +int run=0;
  870. +
  871. +static char ftime_used = 0, times_used = 0, gettimeofday_used = 0, getrusage_used = 0;
  872. +static int mr=0;
  873. +static int usertime=1;
  874. +
  875. +static double Time_F(int s);
  876. +static void print_message(const char *s,long num,int length);
  877. +static void pkey_print_message(const char *str, const char *str2,
  878. + long num, int bits, int sec);
  879. +static void print_result(int alg,int run_no,int count,double time_used);
  880. +#ifdef HAVE_FORK
  881. +static int do_multi(int multi);
  882. +#endif
  883. +
  884. +#define ALGOR_NUM 28
  885. +#define SIZE_NUM 5
  886. +#define RSA_NUM 4
  887. +#define DSA_NUM 3
  888. +
  889. +#define EC_NUM 16
  890. +#define MAX_ECDH_SIZE 256
  891. +
  892. +static const char *names[ALGOR_NUM]={
  893. + "md2","mdc2","md4","md5","hmac(md5)","sha1","rmd160","rc4",
  894. + "des cbc","des ede3","idea cbc","seed cbc",
  895. + "rc2 cbc","rc5-32/12 cbc","blowfish cbc","cast cbc",
  896. + "aes-128 cbc","aes-192 cbc","aes-256 cbc",
  897. + "camellia-128 cbc","camellia-192 cbc","camellia-256 cbc",
  898. + "evp","sha256","sha512",
  899. + "aes-128 ige","aes-192 ige","aes-256 ige"};
  900. +static double results[ALGOR_NUM][SIZE_NUM];
  901. +static int lengths[SIZE_NUM]={16,64,256,1024,8*1024};
  902. +static double rsa_results[RSA_NUM][2];
  903. +static double dsa_results[DSA_NUM][2];
  904. +#ifndef OPENSSL_NO_ECDSA
  905. +static double ecdsa_results[EC_NUM][2];
  906. +#endif
  907. +#ifndef OPENSSL_NO_ECDH
  908. +static double ecdh_results[EC_NUM][1];
  909. +#endif
  910. +
  911. +#if 1 /*defined(OPENSSL_NO_DSA) && !(defined(OPENSSL_NO_ECDSA) && defined(OPENSSL_NO_ECDH))*/
  912. +static const char rnd_seed[] = "string to make the random number generator think it has entropy";
  913. +static int rnd_fake = 0;
  914. +#endif
  915. +
  916. +#ifdef OPENSSL_SYS_NEWLIB
  917. +#undef SIGALRM
  918. +#endif
  919. +
  920. +#ifdef SIGALRM
  921. +#if defined(__STDC__) || defined(sgi) || defined(_AIX)
  922. +#define SIGRETTYPE void
  923. +#else
  924. +#define SIGRETTYPE int
  925. +#endif
  926. +
  927. +static SIGRETTYPE sig_done(int sig);
  928. +static SIGRETTYPE sig_done(int sig)
  929. + {
  930. + signal(SIGALRM,sig_done);
  931. + run=0;
  932. +#ifdef LINT
  933. + sig=sig;
  934. +#endif
  935. + }
  936. +#endif
  937. +
  938. +#define START 0
  939. +#define STOP 1
  940. +
  941. +#if defined(OPENSSL_SYS_NETWARE) || defined(OPENSSL_SYS_NEWLIB)
  942. +
  943. + /* for NetWare the best we can do is use clock() which returns the
  944. + * time, in hundredths of a second, since the NLM began executing
  945. + */
  946. +static double Time_F(int s)
  947. + {
  948. + double ret;
  949. +
  950. + static clock_t tstart,tend;
  951. +
  952. + if (s == START)
  953. + {
  954. + tstart=clock();
  955. + return(0);
  956. + }
  957. + else
  958. + {
  959. + tend=clock();
  960. + ret=(double)((double)(tend)-(double)(tstart))/(double)HZ;
  961. + return((ret < 0.001)?0.001:ret);
  962. + }
  963. + }
  964. +
  965. +#else
  966. +
  967. +static double Time_F(int s)
  968. + {
  969. + double ret;
  970. +
  971. +#ifdef USE_TOD
  972. + if(usertime)
  973. + {
  974. + static struct rusage tstart,tend;
  975. +
  976. + getrusage_used = 1;
  977. + if (s == START)
  978. + {
  979. + getrusage(RUSAGE_SELF,&tstart);
  980. + return(0);
  981. + }
  982. + else
  983. + {
  984. + long i;
  985. +
  986. + getrusage(RUSAGE_SELF,&tend);
  987. + i=(long)tend.ru_utime.tv_usec-(long)tstart.ru_utime.tv_usec;
  988. + ret=((double)(tend.ru_utime.tv_sec-tstart.ru_utime.tv_sec))
  989. + +((double)i)/1000000.0;
  990. + return((ret < 0.001)?0.001:ret);
  991. + }
  992. + }
  993. + else
  994. + {
  995. + static struct timeval tstart,tend;
  996. + long i;
  997. +
  998. + gettimeofday_used = 1;
  999. + if (s == START)
  1000. + {
  1001. + gettimeofday(&tstart,NULL);
  1002. + return(0);
  1003. + }
  1004. + else
  1005. + {
  1006. + gettimeofday(&tend,NULL);
  1007. + i=(long)tend.tv_usec-(long)tstart.tv_usec;
  1008. + ret=((double)(tend.tv_sec-tstart.tv_sec))+((double)i)/1000000.0;
  1009. + return((ret < 0.001)?0.001:ret);
  1010. + }
  1011. + }
  1012. +#else /* ndef USE_TOD */
  1013. +
  1014. +# ifdef TIMES
  1015. + if (usertime)
  1016. + {
  1017. + static struct tms tstart,tend;
  1018. +
  1019. + times_used = 1;
  1020. + if (s == START)
  1021. + {
  1022. + times(&tstart);
  1023. + return(0);
  1024. + }
  1025. + else
  1026. + {
  1027. + times(&tend);
  1028. + ret = HZ;
  1029. + ret=(double)(tend.tms_utime-tstart.tms_utime) / ret;
  1030. + return((ret < 1e-3)?1e-3:ret);
  1031. + }
  1032. + }
  1033. +# endif /* times() */
  1034. +# if defined(TIMES) && defined(TIMEB)
  1035. + else
  1036. +# endif
  1037. +# ifdef OPENSSL_SYS_VXWORKS
  1038. + {
  1039. + static unsigned long tick_start, tick_end;
  1040. +
  1041. + if( s == START )
  1042. + {
  1043. + tick_start = tickGet();
  1044. + return 0;
  1045. + }
  1046. + else
  1047. + {
  1048. + tick_end = tickGet();
  1049. + ret = (double)(tick_end - tick_start) / (double)sysClkRateGet();
  1050. + return((ret < 0.001)?0.001:ret);
  1051. + }
  1052. + }
  1053. +# elif defined(TIMEB)
  1054. + {
  1055. + static struct timeb tstart,tend;
  1056. + long i;
  1057. +
  1058. + ftime_used = 1;
  1059. + if (s == START)
  1060. + {
  1061. + ftime(&tstart);
  1062. + return(0);
  1063. + }
  1064. + else
  1065. + {
  1066. + ftime(&tend);
  1067. + i=(long)tend.millitm-(long)tstart.millitm;
  1068. + ret=((double)(tend.time-tstart.time))+((double)i)/1000.0;
  1069. + return((ret < 0.001)?0.001:ret);
  1070. + }
  1071. + }
  1072. +# endif
  1073. +#endif
  1074. + }
  1075. +#endif /* if defined(OPENSSL_SYS_NETWARE) */
  1076. +
  1077. +
  1078. +#ifndef OPENSSL_NO_ECDH
  1079. +static const int KDF1_SHA1_len = 20;
  1080. +static void *KDF1_SHA1(const void *in, size_t inlen, void *out, size_t *outlen)
  1081. + {
  1082. +#ifndef OPENSSL_NO_SHA
  1083. + if (*outlen < SHA_DIGEST_LENGTH)
  1084. + return NULL;
  1085. + else
  1086. + *outlen = SHA_DIGEST_LENGTH;
  1087. + return SHA1(in, inlen, out);
  1088. +#else
  1089. + return NULL;
  1090. +#endif /* OPENSSL_NO_SHA */
  1091. + }
  1092. +#endif /* OPENSSL_NO_ECDH */
  1093. +
  1094. +extern RAND_METHOD rand_dummy_meth;
  1095. +
  1096. +int MAIN(int, char **);
  1097. +
  1098. +int MAIN(int argc, char **argv)
  1099. + {
  1100. +#ifndef OPENSSL_NO_ENGINE
  1101. + ENGINE *e = NULL;
  1102. +#endif
  1103. + unsigned char *buf=NULL,*buf2=NULL;
  1104. + int mret=1;
  1105. + long count=5000,save_count=0;
  1106. + int i,j,k;
  1107. +#if !defined(OPENSSL_NO_RSA) || !defined(OPENSSL_NO_DSA)
  1108. + long rsa_count;
  1109. +#endif
  1110. +#ifndef OPENSSL_NO_RSA
  1111. + unsigned rsa_num;
  1112. +#endif
  1113. + unsigned char md[EVP_MAX_MD_SIZE];
  1114. +#ifndef OPENSSL_NO_MD2
  1115. + unsigned char md2[MD2_DIGEST_LENGTH];
  1116. +#endif
  1117. +#ifndef OPENSSL_NO_MDC2
  1118. + unsigned char mdc2[MDC2_DIGEST_LENGTH];
  1119. +#endif
  1120. +#ifndef OPENSSL_NO_MD4
  1121. + unsigned char md4[MD4_DIGEST_LENGTH];
  1122. +#endif
  1123. +#ifndef OPENSSL_NO_MD5
  1124. + unsigned char md5[MD5_DIGEST_LENGTH];
  1125. + unsigned char hmac[MD5_DIGEST_LENGTH];
  1126. +#endif
  1127. +#ifndef OPENSSL_NO_SHA
  1128. + unsigned char sha[SHA_DIGEST_LENGTH];
  1129. +#ifndef OPENSSL_NO_SHA256
  1130. + unsigned char sha256[SHA256_DIGEST_LENGTH];
  1131. +#endif
  1132. +#ifndef OPENSSL_NO_SHA512
  1133. + unsigned char sha512[SHA512_DIGEST_LENGTH];
  1134. +#endif
  1135. +#endif
  1136. +#ifndef OPENSSL_NO_RIPEMD
  1137. + unsigned char rmd160[RIPEMD160_DIGEST_LENGTH];
  1138. +#endif
  1139. +#ifndef OPENSSL_NO_RC4
  1140. + RC4_KEY rc4_ks;
  1141. +#endif
  1142. +#ifndef OPENSSL_NO_RC5
  1143. + RC5_32_KEY rc5_ks;
  1144. +#endif
  1145. +#ifndef OPENSSL_NO_RC2
  1146. + RC2_KEY rc2_ks;
  1147. +#endif
  1148. +#ifndef OPENSSL_NO_IDEA
  1149. + IDEA_KEY_SCHEDULE idea_ks;
  1150. +#endif
  1151. +#ifndef OPENSSL_NO_SEED
  1152. + SEED_KEY_SCHEDULE seed_ks;
  1153. +#endif
  1154. +#ifndef OPENSSL_NO_BF
  1155. + BF_KEY bf_ks;
  1156. +#endif
  1157. +#ifndef OPENSSL_NO_CAST
  1158. + CAST_KEY cast_ks;
  1159. +#endif
  1160. + static const unsigned char key16[16]=
  1161. + {0x12,0x34,0x56,0x78,0x9a,0xbc,0xde,0xf0,
  1162. + 0x34,0x56,0x78,0x9a,0xbc,0xde,0xf0,0x12};
  1163. +#ifndef OPENSSL_NO_AES
  1164. + static const unsigned char key24[24]=
  1165. + {0x12,0x34,0x56,0x78,0x9a,0xbc,0xde,0xf0,
  1166. + 0x34,0x56,0x78,0x9a,0xbc,0xde,0xf0,0x12,
  1167. + 0x56,0x78,0x9a,0xbc,0xde,0xf0,0x12,0x34};
  1168. + static const unsigned char key32[32]=
  1169. + {0x12,0x34,0x56,0x78,0x9a,0xbc,0xde,0xf0,
  1170. + 0x34,0x56,0x78,0x9a,0xbc,0xde,0xf0,0x12,
  1171. + 0x56,0x78,0x9a,0xbc,0xde,0xf0,0x12,0x34,
  1172. + 0x78,0x9a,0xbc,0xde,0xf0,0x12,0x34,0x56};
  1173. +#endif
  1174. +#ifndef OPENSSL_NO_CAMELLIA
  1175. + static const unsigned char ckey24[24]=
  1176. + {0x12,0x34,0x56,0x78,0x9a,0xbc,0xde,0xf0,
  1177. + 0x34,0x56,0x78,0x9a,0xbc,0xde,0xf0,0x12,
  1178. + 0x56,0x78,0x9a,0xbc,0xde,0xf0,0x12,0x34};
  1179. + static const unsigned char ckey32[32]=
  1180. + {0x12,0x34,0x56,0x78,0x9a,0xbc,0xde,0xf0,
  1181. + 0x34,0x56,0x78,0x9a,0xbc,0xde,0xf0,0x12,
  1182. + 0x56,0x78,0x9a,0xbc,0xde,0xf0,0x12,0x34,
  1183. + 0x78,0x9a,0xbc,0xde,0xf0,0x12,0x34,0x56};
  1184. +#endif
  1185. +#ifndef OPENSSL_NO_AES
  1186. +#define MAX_BLOCK_SIZE 128
  1187. +#else
  1188. +#define MAX_BLOCK_SIZE 64
  1189. +#endif
  1190. + unsigned char DES_iv[8];
  1191. + unsigned char iv[MAX_BLOCK_SIZE/8];
  1192. +#ifndef OPENSSL_NO_DES
  1193. + DES_cblock *buf_as_des_cblock = NULL;
  1194. + static DES_cblock key ={0x12,0x34,0x56,0x78,0x9a,0xbc,0xde,0xf0};
  1195. + static DES_cblock key2={0x34,0x56,0x78,0x9a,0xbc,0xde,0xf0,0x12};
  1196. + static DES_cblock key3={0x56,0x78,0x9a,0xbc,0xde,0xf0,0x12,0x34};
  1197. + DES_key_schedule sch;
  1198. + DES_key_schedule sch2;
  1199. + DES_key_schedule sch3;
  1200. +#endif
  1201. +#ifndef OPENSSL_NO_AES
  1202. + AES_KEY aes_ks1, aes_ks2, aes_ks3;
  1203. +#endif
  1204. +#ifndef OPENSSL_NO_CAMELLIA
  1205. + CAMELLIA_KEY camellia_ks1, camellia_ks2, camellia_ks3;
  1206. +#endif
  1207. +#define D_MD2 0
  1208. +#define D_MDC2 1
  1209. +#define D_MD4 2
  1210. +#define D_MD5 3
  1211. +#define D_HMAC 4
  1212. +#define D_SHA1 5
  1213. +#define D_RMD160 6
  1214. +#define D_RC4 7
  1215. +#define D_CBC_DES 8
  1216. +#define D_EDE3_DES 9
  1217. +#define D_CBC_IDEA 10
  1218. +#define D_CBC_SEED 11
  1219. +#define D_CBC_RC2 12
  1220. +#define D_CBC_RC5 13
  1221. +#define D_CBC_BF 14
  1222. +#define D_CBC_CAST 15
  1223. +#define D_CBC_128_AES 16
  1224. +#define D_CBC_192_AES 17
  1225. +#define D_CBC_256_AES 18
  1226. +#define D_CBC_128_CML 19
  1227. +#define D_CBC_192_CML 20
  1228. +#define D_CBC_256_CML 21
  1229. +#define D_EVP 22
  1230. +#define D_SHA256 23
  1231. +#define D_SHA512 24
  1232. +#define D_IGE_128_AES 25
  1233. +#define D_IGE_192_AES 26
  1234. +#define D_IGE_256_AES 27
  1235. + double d=0.0;
  1236. + long c[ALGOR_NUM][SIZE_NUM];
  1237. +#define R_DSA_512 0
  1238. +#define R_DSA_1024 1
  1239. +#define R_DSA_2048 2
  1240. +#define R_RSA_512 0
  1241. +#define R_RSA_1024 1
  1242. +#define R_RSA_2048 2
  1243. +#define R_RSA_4096 3
  1244. +
  1245. +#define R_EC_P160 0
  1246. +#define R_EC_P192 1
  1247. +#define R_EC_P224 2
  1248. +#define R_EC_P256 3
  1249. +#define R_EC_P384 4
  1250. +#define R_EC_P521 5
  1251. +#define R_EC_K163 6
  1252. +#define R_EC_K233 7
  1253. +#define R_EC_K283 8
  1254. +#define R_EC_K409 9
  1255. +#define R_EC_K571 10
  1256. +#define R_EC_B163 11
  1257. +#define R_EC_B233 12
  1258. +#define R_EC_B283 13
  1259. +#define R_EC_B409 14
  1260. +#define R_EC_B571 15
  1261. +
  1262. +#ifndef OPENSSL_NO_RSA
  1263. + RSA *rsa_key[RSA_NUM];
  1264. + long rsa_c[RSA_NUM][2];
  1265. + static unsigned int rsa_bits[RSA_NUM]={512,1024,2048,4096};
  1266. + static unsigned char *rsa_data[RSA_NUM] =
  1267. + {test512,test1024,test2048,0/*test4096*/};
  1268. + static int rsa_data_length[RSA_NUM]={
  1269. + sizeof(test512),sizeof(test1024),
  1270. + sizeof(test2048),sizeof(test4096)};
  1271. +#endif
  1272. +#ifndef OPENSSL_NO_DSA
  1273. + DSA *dsa_key[DSA_NUM];
  1274. + long dsa_c[DSA_NUM][2];
  1275. + static unsigned int dsa_bits[DSA_NUM]={512,1024,2048};
  1276. +#endif
  1277. +#ifndef OPENSSL_NO_EC
  1278. + /* We only test over the following curves as they are representative,
  1279. + * To add tests over more curves, simply add the curve NID
  1280. + * and curve name to the following arrays and increase the
  1281. + * EC_NUM value accordingly.
  1282. + */
  1283. + static unsigned int test_curves[EC_NUM] =
  1284. + {
  1285. + /* Prime Curves */
  1286. + NID_secp160r1,
  1287. + NID_X9_62_prime192v1,
  1288. + NID_secp224r1,
  1289. + NID_X9_62_prime256v1,
  1290. + NID_secp384r1,
  1291. + NID_secp521r1,
  1292. + /* Binary Curves */
  1293. + NID_sect163k1,
  1294. + NID_sect233k1,
  1295. + NID_sect283k1,
  1296. + NID_sect409k1,
  1297. + NID_sect571k1,
  1298. + NID_sect163r2,
  1299. + NID_sect233r1,
  1300. + NID_sect283r1,
  1301. + NID_sect409r1,
  1302. + NID_sect571r1
  1303. + };
  1304. + static const char * test_curves_names[EC_NUM] =
  1305. + {
  1306. + /* Prime Curves */
  1307. + "secp160r1",
  1308. + "nistp192",
  1309. + "nistp224",
  1310. + "nistp256",
  1311. + "nistp384",
  1312. + "nistp521",
  1313. + /* Binary Curves */
  1314. + "nistk163",
  1315. + "nistk233",
  1316. + "nistk283",
  1317. + "nistk409",
  1318. + "nistk571",
  1319. + "nistb163",
  1320. + "nistb233",
  1321. + "nistb283",
  1322. + "nistb409",
  1323. + "nistb571"
  1324. + };
  1325. + static int test_curves_bits[EC_NUM] =
  1326. + {
  1327. + 160, 192, 224, 256, 384, 521,
  1328. + 163, 233, 283, 409, 571,
  1329. + 163, 233, 283, 409, 571
  1330. + };
  1331. +
  1332. +#endif
  1333. +
  1334. +#ifndef OPENSSL_NO_ECDSA
  1335. + unsigned char ecdsasig[256];
  1336. + unsigned int ecdsasiglen;
  1337. + EC_KEY *ecdsa[EC_NUM];
  1338. + long ecdsa_c[EC_NUM][2];
  1339. +#endif
  1340. +
  1341. +#ifndef OPENSSL_NO_ECDH
  1342. + EC_KEY *ecdh_a[EC_NUM], *ecdh_b[EC_NUM];
  1343. + unsigned char secret_a[MAX_ECDH_SIZE], secret_b[MAX_ECDH_SIZE];
  1344. + int secret_size_a, secret_size_b;
  1345. + int ecdh_checks = 0;
  1346. + int secret_idx = 0;
  1347. + long ecdh_c[EC_NUM][2];
  1348. +#endif
  1349. +
  1350. + int rsa_doit[RSA_NUM];
  1351. + int dsa_doit[DSA_NUM];
  1352. +#ifndef OPENSSL_NO_ECDSA
  1353. + int ecdsa_doit[EC_NUM];
  1354. +#endif
  1355. +#ifndef OPENSSL_NO_ECDH
  1356. + int ecdh_doit[EC_NUM];
  1357. +#endif
  1358. + int doit[ALGOR_NUM];
  1359. + int pr_header=0;
  1360. + const EVP_CIPHER *evp_cipher=NULL;
  1361. + const EVP_MD *evp_md=NULL;
  1362. + int decrypt=0;
  1363. +#ifdef HAVE_FORK
  1364. + int multi=0;
  1365. +#endif
  1366. +
  1367. +#ifndef TIMES
  1368. + usertime=-1;
  1369. +#endif
  1370. +
  1371. + //apps_startup();
  1372. + memset(results, 0, sizeof(results));
  1373. +#ifndef OPENSSL_NO_DSA
  1374. + memset(dsa_key,0,sizeof(dsa_key));
  1375. +#endif
  1376. +#ifndef OPENSSL_NO_ECDSA
  1377. + for (i=0; i<EC_NUM; i++) ecdsa[i] = NULL;
  1378. +#endif
  1379. +#ifndef OPENSSL_NO_ECDH
  1380. + for (i=0; i<EC_NUM; i++)
  1381. + {
  1382. + ecdh_a[i] = NULL;
  1383. + ecdh_b[i] = NULL;
  1384. + }
  1385. +#endif
  1386. +
  1387. +
  1388. + //if (bio_err == NULL)
  1389. + // if ((bio_err=BIO_new(BIO_s_file())) != NULL)
  1390. + // BIO_set_fp(bio_err,stderr,BIO_NOCLOSE|BIO_FP_TEXT);
  1391. +
  1392. + //if (!load_config(bio_err, NULL))
  1393. + // goto end;
  1394. +
  1395. +#ifndef OPENSSL_NO_RSA
  1396. + memset(rsa_key,0,sizeof(rsa_key));
  1397. + for (i=0; i<RSA_NUM; i++)
  1398. + rsa_key[i]=NULL;
  1399. +#endif
  1400. +
  1401. +
  1402. + if ((buf=(unsigned char *)/*OPENSSL_*/malloc((int)BUFSIZE)) == NULL)
  1403. + {
  1404. + fprintf(stderr, "out of memory");
  1405. + //BIO_printf(bio_err,"out of memory\n");
  1406. + goto end;
  1407. + }
  1408. +#ifndef OPENSSL_NO_DES
  1409. + buf_as_des_cblock = (DES_cblock *)buf;
  1410. +#endif
  1411. + if ((buf2=(unsigned char *)/*OPENSSL_*/malloc((int)BUFSIZE)) == NULL)
  1412. + {
  1413. + fprintf(stderr, "out of memory");
  1414. + //BIO_printf(bio_err,"out of memory\n");
  1415. + goto end;
  1416. + }
  1417. +
  1418. + memset(c,0,sizeof(c));
  1419. + memset(DES_iv,0,sizeof(DES_iv));
  1420. + memset(iv,0,sizeof(iv));
  1421. +
  1422. + for (i=0; i<ALGOR_NUM; i++)
  1423. + doit[i]=0;
  1424. + for (i=0; i<RSA_NUM; i++)
  1425. + rsa_doit[i]=0;
  1426. + for (i=0; i<DSA_NUM; i++)
  1427. + dsa_doit[i]=0;
  1428. +#ifndef OPENSSL_NO_ECDSA
  1429. + for (i=0; i<EC_NUM; i++)
  1430. + ecdsa_doit[i]=0;
  1431. +#endif
  1432. +#ifndef OPENSSL_NO_ECDH
  1433. + for (i=0; i<EC_NUM; i++)
  1434. + ecdh_doit[i]=0;
  1435. +#endif
  1436. +
  1437. +
  1438. + j=0;
  1439. + argc--;
  1440. + argv++;
  1441. + while (argc)
  1442. + {
  1443. + if ((argc > 0) && (strcmp(*argv,"-elapsed") == 0))
  1444. + {
  1445. + usertime = 0;
  1446. + j--; /* Otherwise, -elapsed gets confused with
  1447. + an algorithm. */
  1448. + }
  1449. + else /*if ((argc > 0) && (strcmp(*argv,"-evp") == 0))
  1450. + {
  1451. + argc--;
  1452. + argv++;
  1453. + if(argc == 0)
  1454. + {
  1455. + BIO_printf(bio_err,"no EVP given\n");
  1456. + goto end;
  1457. + }
  1458. + evp_cipher=EVP_get_cipherbyname(*argv);
  1459. + if(!evp_cipher)
  1460. + {
  1461. + evp_md=EVP_get_digestbyname(*argv);
  1462. + }
  1463. + if(!evp_cipher && !evp_md)
  1464. + {
  1465. + BIO_printf(bio_err,"%s is an unknown cipher or digest\n",*argv);
  1466. + goto end;
  1467. + }
  1468. + doit[D_EVP]=1;
  1469. + }
  1470. + else */if (argc > 0 && !strcmp(*argv,"-decrypt"))
  1471. + {
  1472. + decrypt=1;
  1473. + j--; /* Otherwise, -elapsed gets confused with
  1474. + an algorithm. */
  1475. + }
  1476. +#ifndef OPENSSL_NO_ENGINE
  1477. + else if ((argc > 0) && (strcmp(*argv,"-engine") == 0))
  1478. + {
  1479. + argc--;
  1480. + argv++;
  1481. + if(argc == 0)
  1482. + {
  1483. + BIO_printf(bio_err,"no engine given\n");
  1484. + goto end;
  1485. + }
  1486. + e = setup_engine(bio_err, *argv, 0);
  1487. + /* j will be increased again further down. We just
  1488. + don't want speed to confuse an engine with an
  1489. + algorithm, especially when none is given (which
  1490. + means all of them should be run) */
  1491. + j--;
  1492. + }
  1493. +#endif
  1494. +#ifdef HAVE_FORK
  1495. + else if ((argc > 0) && (strcmp(*argv,"-multi") == 0))
  1496. + {
  1497. + argc--;
  1498. + argv++;
  1499. + if(argc == 0)
  1500. + {
  1501. + BIO_printf(bio_err,"no multi count given\n");
  1502. + goto end;
  1503. + }
  1504. + multi=atoi(argv[0]);
  1505. + if(multi <= 0)
  1506. + {
  1507. + BIO_printf(bio_err,"bad multi count\n");
  1508. + goto end;
  1509. + }
  1510. + j--; /* Otherwise, -mr gets confused with
  1511. + an algorithm. */
  1512. + }
  1513. +#endif
  1514. + else if (argc > 0 && !strcmp(*argv,"-mr"))
  1515. + {
  1516. + mr=1;
  1517. + j--; /* Otherwise, -mr gets confused with
  1518. + an algorithm. */
  1519. + }
  1520. + else
  1521. +#ifndef OPENSSL_NO_MD2
  1522. + if (strcmp(*argv,"md2") == 0) doit[D_MD2]=1;
  1523. + else
  1524. +#endif
  1525. +#ifndef OPENSSL_NO_MDC2
  1526. + if (strcmp(*argv,"mdc2") == 0) doit[D_MDC2]=1;
  1527. + else
  1528. +#endif
  1529. +#ifndef OPENSSL_NO_MD4
  1530. + if (strcmp(*argv,"md4") == 0) doit[D_MD4]=1;
  1531. + else
  1532. +#endif
  1533. +#ifndef OPENSSL_NO_MD5
  1534. + if (strcmp(*argv,"md5") == 0) doit[D_MD5]=1;
  1535. + else
  1536. +#endif
  1537. +#ifndef OPENSSL_NO_MD5
  1538. + if (strcmp(*argv,"hmac") == 0) doit[D_HMAC]=1;
  1539. + else
  1540. +#endif
  1541. +#ifndef OPENSSL_NO_SHA
  1542. + if (strcmp(*argv,"sha1") == 0) doit[D_SHA1]=1;
  1543. + else
  1544. + if (strcmp(*argv,"sha") == 0) doit[D_SHA1]=1,
  1545. + doit[D_SHA256]=1,
  1546. + doit[D_SHA512]=1;
  1547. + else
  1548. +#ifndef OPENSSL_NO_SHA256
  1549. + if (strcmp(*argv,"sha256") == 0) doit[D_SHA256]=1;
  1550. + else
  1551. +#endif
  1552. +#ifndef OPENSSL_NO_SHA512
  1553. + if (strcmp(*argv,"sha512") == 0) doit[D_SHA512]=1;
  1554. + else
  1555. +#endif
  1556. +#endif
  1557. +#ifndef OPENSSL_NO_RIPEMD
  1558. + if (strcmp(*argv,"ripemd") == 0) doit[D_RMD160]=1;
  1559. + else
  1560. + if (strcmp(*argv,"rmd160") == 0) doit[D_RMD160]=1;
  1561. + else
  1562. + if (strcmp(*argv,"ripemd160") == 0) doit[D_RMD160]=1;
  1563. + else
  1564. +#endif
  1565. +#ifndef OPENSSL_NO_RC4
  1566. + if (strcmp(*argv,"rc4") == 0) doit[D_RC4]=1;
  1567. + else
  1568. +#endif
  1569. +#ifndef OPENSSL_NO_DES
  1570. + if (strcmp(*argv,"des-cbc") == 0) doit[D_CBC_DES]=1;
  1571. + else if (strcmp(*argv,"des-ede3") == 0) doit[D_EDE3_DES]=1;
  1572. + else
  1573. +#endif
  1574. +#ifndef OPENSSL_NO_AES
  1575. + if (strcmp(*argv,"aes-128-cbc") == 0) doit[D_CBC_128_AES]=1;
  1576. + else if (strcmp(*argv,"aes-192-cbc") == 0) doit[D_CBC_192_AES]=1;
  1577. + else if (strcmp(*argv,"aes-256-cbc") == 0) doit[D_CBC_256_AES]=1;
  1578. + else if (strcmp(*argv,"aes-128-ige") == 0) doit[D_IGE_128_AES]=1;
  1579. + else if (strcmp(*argv,"aes-192-ige") == 0) doit[D_IGE_192_AES]=1;
  1580. + else if (strcmp(*argv,"aes-256-ige") == 0) doit[D_IGE_256_AES]=1;
  1581. + else
  1582. +#endif
  1583. +#ifndef OPENSSL_NO_CAMELLIA
  1584. + if (strcmp(*argv,"camellia-128-cbc") == 0) doit[D_CBC_128_CML]=1;
  1585. + else if (strcmp(*argv,"camellia-192-cbc") == 0) doit[D_CBC_192_CML]=1;
  1586. + else if (strcmp(*argv,"camellia-256-cbc") == 0) doit[D_CBC_256_CML]=1;
  1587. + else
  1588. +#endif
  1589. +#ifndef OPENSSL_NO_RSA
  1590. +#if 0 /* was: #ifdef RSAref */
  1591. + if (strcmp(*argv,"rsaref") == 0)
  1592. + {
  1593. + RSA_set_default_openssl_method(RSA_PKCS1_RSAref());
  1594. + j--;
  1595. + }
  1596. + else
  1597. +#endif
  1598. +#ifndef RSA_NULL
  1599. + if (strcmp(*argv,"openssl") == 0)
  1600. + {
  1601. + RSA_set_default_method(RSA_PKCS1_SSLeay());
  1602. + j--;
  1603. + }
  1604. + else
  1605. +#endif
  1606. +#endif /* !OPENSSL_NO_RSA */
  1607. + if (strcmp(*argv,"dsa512") == 0) dsa_doit[R_DSA_512]=2;
  1608. + else if (strcmp(*argv,"dsa1024") == 0) dsa_doit[R_DSA_1024]=2;
  1609. + else if (strcmp(*argv,"dsa2048") == 0) dsa_doit[R_DSA_2048]=2;
  1610. + else if (strcmp(*argv,"rsa512") == 0) rsa_doit[R_RSA_512]=2;
  1611. + else if (strcmp(*argv,"rsa1024") == 0) rsa_doit[R_RSA_1024]=2;
  1612. + else if (strcmp(*argv,"rsa2048") == 0) rsa_doit[R_RSA_2048]=2;
  1613. + else if (strcmp(*argv,"rsa4096") == 0) rsa_doit[R_RSA_4096]=2;
  1614. + else
  1615. +#ifndef OPENSSL_NO_RC2
  1616. + if (strcmp(*argv,"rc2-cbc") == 0) doit[D_CBC_RC2]=1;
  1617. + else if (strcmp(*argv,"rc2") == 0) doit[D_CBC_RC2]=1;
  1618. + else
  1619. +#endif
  1620. +#ifndef OPENSSL_NO_RC5
  1621. + if (strcmp(*argv,"rc5-cbc") == 0) doit[D_CBC_RC5]=1;
  1622. + else if (strcmp(*argv,"rc5") == 0) doit[D_CBC_RC5]=1;
  1623. + else
  1624. +#endif
  1625. +#ifndef OPENSSL_NO_IDEA
  1626. + if (strcmp(*argv,"idea-cbc") == 0) doit[D_CBC_IDEA]=1;
  1627. + else if (strcmp(*argv,"idea") == 0) doit[D_CBC_IDEA]=1;
  1628. + else
  1629. +#endif
  1630. +#ifndef OPENSSL_NO_SEED
  1631. + if (strcmp(*argv,"seed-cbc") == 0) doit[D_CBC_SEED]=1;
  1632. + else if (strcmp(*argv,"seed") == 0) doit[D_CBC_SEED]=1;
  1633. + else
  1634. +#endif
  1635. +#ifndef OPENSSL_NO_BF
  1636. + if (strcmp(*argv,"bf-cbc") == 0) doit[D_CBC_BF]=1;
  1637. + else if (strcmp(*argv,"blowfish") == 0) doit[D_CBC_BF]=1;
  1638. + else if (strcmp(*argv,"bf") == 0) doit[D_CBC_BF]=1;
  1639. + else
  1640. +#endif
  1641. +#ifndef OPENSSL_NO_CAST
  1642. + if (strcmp(*argv,"cast-cbc") == 0) doit[D_CBC_CAST]=1;
  1643. + else if (strcmp(*argv,"cast") == 0) doit[D_CBC_CAST]=1;
  1644. + else if (strcmp(*argv,"cast5") == 0) doit[D_CBC_CAST]=1;
  1645. + else
  1646. +#endif
  1647. +#ifndef OPENSSL_NO_DES
  1648. + if (strcmp(*argv,"des") == 0)
  1649. + {
  1650. + doit[D_CBC_DES]=1;
  1651. + doit[D_EDE3_DES]=1;
  1652. + }
  1653. + else
  1654. +#endif
  1655. +#ifndef OPENSSL_NO_AES
  1656. + if (strcmp(*argv,"aes") == 0)
  1657. + {
  1658. + doit[D_CBC_128_AES]=1;
  1659. + doit[D_CBC_192_AES]=1;
  1660. + doit[D_CBC_256_AES]=1;
  1661. + doit[D_IGE_128_AES]=1;
  1662. + doit[D_IGE_192_AES]=1;
  1663. + doit[D_IGE_256_AES]=1;
  1664. + }
  1665. + else
  1666. +#endif
  1667. +#ifndef OPENSSL_NO_CAMELLIA
  1668. + if (strcmp(*argv,"camellia") == 0)
  1669. + {
  1670. + doit[D_CBC_128_CML]=1;
  1671. + doit[D_CBC_192_CML]=1;
  1672. + doit[D_CBC_256_CML]=1;
  1673. + }
  1674. + else
  1675. +#endif
  1676. +#ifndef OPENSSL_NO_RSA
  1677. + if (strcmp(*argv,"rsa") == 0)
  1678. + {
  1679. + rsa_doit[R_RSA_512]=1;
  1680. + rsa_doit[R_RSA_1024]=1;
  1681. + rsa_doit[R_RSA_2048]=1;
  1682. + rsa_doit[R_RSA_4096]=1;
  1683. + }
  1684. + else
  1685. +#endif
  1686. +#ifndef OPENSSL_NO_DSA
  1687. + if (strcmp(*argv,"dsa") == 0)
  1688. + {
  1689. + dsa_doit[R_DSA_512]=1;
  1690. + dsa_doit[R_DSA_1024]=1;
  1691. + dsa_doit[R_DSA_2048]=1;
  1692. + }
  1693. + else
  1694. +#endif
  1695. +#ifndef OPENSSL_NO_ECDSA
  1696. + if (strcmp(*argv,"ecdsap160") == 0) ecdsa_doit[R_EC_P160]=2;
  1697. + else if (strcmp(*argv,"ecdsap192") == 0) ecdsa_doit[R_EC_P192]=2;
  1698. + else if (strcmp(*argv,"ecdsap224") == 0) ecdsa_doit[R_EC_P224]=2;
  1699. + else if (strcmp(*argv,"ecdsap256") == 0) ecdsa_doit[R_EC_P256]=2;
  1700. + else if (strcmp(*argv,"ecdsap384") == 0) ecdsa_doit[R_EC_P384]=2;
  1701. + else if (strcmp(*argv,"ecdsap521") == 0) ecdsa_doit[R_EC_P521]=2;
  1702. + else if (strcmp(*argv,"ecdsak163") == 0) ecdsa_doit[R_EC_K163]=2;
  1703. + else if (strcmp(*argv,"ecdsak233") == 0) ecdsa_doit[R_EC_K233]=2;
  1704. + else if (strcmp(*argv,"ecdsak283") == 0) ecdsa_doit[R_EC_K283]=2;
  1705. + else if (strcmp(*argv,"ecdsak409") == 0) ecdsa_doit[R_EC_K409]=2;
  1706. + else if (strcmp(*argv,"ecdsak571") == 0) ecdsa_doit[R_EC_K571]=2;
  1707. + else if (strcmp(*argv,"ecdsab163") == 0) ecdsa_doit[R_EC_B163]=2;
  1708. + else if (strcmp(*argv,"ecdsab233") == 0) ecdsa_doit[R_EC_B233]=2;
  1709. + else if (strcmp(*argv,"ecdsab283") == 0) ecdsa_doit[R_EC_B283]=2;
  1710. + else if (strcmp(*argv,"ecdsab409") == 0) ecdsa_doit[R_EC_B409]=2;
  1711. + else if (strcmp(*argv,"ecdsab571") == 0) ecdsa_doit[R_EC_B571]=2;
  1712. + else if (strcmp(*argv,"ecdsa") == 0)
  1713. + {
  1714. + for (i=0; i < EC_NUM; i++)
  1715. + ecdsa_doit[i]=1;
  1716. + }
  1717. + else
  1718. +#endif
  1719. +#ifndef OPENSSL_NO_ECDH
  1720. + if (strcmp(*argv,"ecdhp160") == 0) ecdh_doit[R_EC_P160]=2;
  1721. + else if (strcmp(*argv,"ecdhp192") == 0) ecdh_doit[R_EC_P192]=2;
  1722. + else if (strcmp(*argv,"ecdhp224") == 0) ecdh_doit[R_EC_P224]=2;
  1723. + else if (strcmp(*argv,"ecdhp256") == 0) ecdh_doit[R_EC_P256]=2;
  1724. + else if (strcmp(*argv,"ecdhp384") == 0) ecdh_doit[R_EC_P384]=2;
  1725. + else if (strcmp(*argv,"ecdhp521") == 0) ecdh_doit[R_EC_P521]=2;
  1726. + else if (strcmp(*argv,"ecdhk163") == 0) ecdh_doit[R_EC_K163]=2;
  1727. + else if (strcmp(*argv,"ecdhk233") == 0) ecdh_doit[R_EC_K233]=2;
  1728. + else if (strcmp(*argv,"ecdhk283") == 0) ecdh_doit[R_EC_K283]=2;
  1729. + else if (strcmp(*argv,"ecdhk409") == 0) ecdh_doit[R_EC_K409]=2;
  1730. + else if (strcmp(*argv,"ecdhk571") == 0) ecdh_doit[R_EC_K571]=2;
  1731. + else if (strcmp(*argv,"ecdhb163") == 0) ecdh_doit[R_EC_B163]=2;
  1732. + else if (strcmp(*argv,"ecdhb233") == 0) ecdh_doit[R_EC_B233]=2;
  1733. + else if (strcmp(*argv,"ecdhb283") == 0) ecdh_doit[R_EC_B283]=2;
  1734. + else if (strcmp(*argv,"ecdhb409") == 0) ecdh_doit[R_EC_B409]=2;
  1735. + else if (strcmp(*argv,"ecdhb571") == 0) ecdh_doit[R_EC_B571]=2;
  1736. + else if (strcmp(*argv,"ecdh") == 0)
  1737. + {
  1738. + for (i=0; i < EC_NUM; i++)
  1739. + ecdh_doit[i]=1;
  1740. + }
  1741. + else
  1742. +#endif
  1743. + {
  1744. + BIO_printf(bio_err,"Error: bad option or value\n");
  1745. + BIO_printf(bio_err,"\n");
  1746. + BIO_printf(bio_err,"Available values:\n");
  1747. +#ifndef OPENSSL_NO_MD2
  1748. + BIO_printf(bio_err,"md2 ");
  1749. +#endif
  1750. +#ifndef OPENSSL_NO_MDC2
  1751. + BIO_printf(bio_err,"mdc2 ");
  1752. +#endif
  1753. +#ifndef OPENSSL_NO_MD4
  1754. + BIO_printf(bio_err,"md4 ");
  1755. +#endif
  1756. +#ifndef OPENSSL_NO_MD5
  1757. + BIO_printf(bio_err,"md5 ");
  1758. +#ifndef OPENSSL_NO_HMAC
  1759. + BIO_printf(bio_err,"hmac ");
  1760. +#endif
  1761. +#endif
  1762. +#ifndef OPENSSL_NO_SHA1
  1763. + BIO_printf(bio_err,"sha1 ");
  1764. +#endif
  1765. +#ifndef OPENSSL_NO_SHA256
  1766. + BIO_printf(bio_err,"sha256 ");
  1767. +#endif
  1768. +#ifndef OPENSSL_NO_SHA512
  1769. + BIO_printf(bio_err,"sha512 ");
  1770. +#endif
  1771. +#ifndef OPENSSL_NO_RIPEMD160
  1772. + BIO_printf(bio_err,"rmd160");
  1773. +#endif
  1774. +#if !defined(OPENSSL_NO_MD2) || !defined(OPENSSL_NO_MDC2) || \
  1775. + !defined(OPENSSL_NO_MD4) || !defined(OPENSSL_NO_MD5) || \
  1776. + !defined(OPENSSL_NO_SHA1) || !defined(OPENSSL_NO_RIPEMD160)
  1777. + BIO_printf(bio_err,"\n");
  1778. +#endif
  1779. +
  1780. +#ifndef OPENSSL_NO_IDEA
  1781. + BIO_printf(bio_err,"idea-cbc ");
  1782. +#endif
  1783. +#ifndef OPENSSL_NO_SEED
  1784. + BIO_printf(bio_err,"seed-cbc ");
  1785. +#endif
  1786. +#ifndef OPENSSL_NO_RC2
  1787. + BIO_printf(bio_err,"rc2-cbc ");
  1788. +#endif
  1789. +#ifndef OPENSSL_NO_RC5
  1790. + BIO_printf(bio_err,"rc5-cbc ");
  1791. +#endif
  1792. +#ifndef OPENSSL_NO_BF
  1793. + BIO_printf(bio_err,"bf-cbc");
  1794. +#endif
  1795. +#if !defined(OPENSSL_NO_IDEA) || !defined(OPENSSL_NO_SEED) || !defined(OPENSSL_NO_RC2) || \
  1796. + !defined(OPENSSL_NO_BF) || !defined(OPENSSL_NO_RC5)
  1797. + BIO_printf(bio_err,"\n");
  1798. +#endif
  1799. +#ifndef OPENSSL_NO_DES
  1800. + BIO_printf(bio_err,"des-cbc des-ede3 ");
  1801. +#endif
  1802. +#ifndef OPENSSL_NO_AES
  1803. + BIO_printf(bio_err,"aes-128-cbc aes-192-cbc aes-256-cbc ");
  1804. + BIO_printf(bio_err,"aes-128-ige aes-192-ige aes-256-ige ");
  1805. +#endif
  1806. +#ifndef OPENSSL_NO_CAMELLIA
  1807. + BIO_printf(bio_err,"\n");
  1808. + BIO_printf(bio_err,"camellia-128-cbc camellia-192-cbc camellia-256-cbc ");
  1809. +#endif
  1810. +#ifndef OPENSSL_NO_RC4
  1811. + BIO_printf(bio_err,"rc4");
  1812. +#endif
  1813. + BIO_printf(bio_err,"\n");
  1814. +
  1815. +#ifndef OPENSSL_NO_RSA
  1816. + BIO_printf(bio_err,"rsa512 rsa1024 rsa2048 rsa4096\n");
  1817. +#endif
  1818. +
  1819. +#ifndef OPENSSL_NO_DSA
  1820. + BIO_printf(bio_err,"dsa512 dsa1024 dsa2048\n");
  1821. +#endif
  1822. +#ifndef OPENSSL_NO_ECDSA
  1823. + BIO_printf(bio_err,"ecdsap160 ecdsap192 ecdsap224 ecdsap256 ecdsap384 ecdsap521\n");
  1824. + BIO_printf(bio_err,"ecdsak163 ecdsak233 ecdsak283 ecdsak409 ecdsak571\n");
  1825. + BIO_printf(bio_err,"ecdsab163 ecdsab233 ecdsab283 ecdsab409 ecdsab571\n");
  1826. + BIO_printf(bio_err,"ecdsa\n");
  1827. +#endif
  1828. +#ifndef OPENSSL_NO_ECDH
  1829. + BIO_printf(bio_err,"ecdhp160 ecdhp192 ecdhp224 ecdhp256 ecdhp384 ecdhp521\n");
  1830. + BIO_printf(bio_err,"ecdhk163 ecdhk233 ecdhk283 ecdhk409 ecdhk571\n");
  1831. + BIO_printf(bio_err,"ecdhb163 ecdhb233 ecdhb283 ecdhb409 ecdhb571\n");
  1832. + BIO_printf(bio_err,"ecdh\n");
  1833. +#endif
  1834. +
  1835. +#ifndef OPENSSL_NO_IDEA
  1836. + BIO_printf(bio_err,"idea ");
  1837. +#endif
  1838. +#ifndef OPENSSL_NO_SEED
  1839. + BIO_printf(bio_err,"seed ");
  1840. +#endif
  1841. +#ifndef OPENSSL_NO_RC2
  1842. + BIO_printf(bio_err,"rc2 ");
  1843. +#endif
  1844. +#ifndef OPENSSL_NO_DES
  1845. + BIO_printf(bio_err,"des ");
  1846. +#endif
  1847. +#ifndef OPENSSL_NO_AES
  1848. + BIO_printf(bio_err,"aes ");
  1849. +#endif
  1850. +#ifndef OPENSSL_NO_CAMELLIA
  1851. + BIO_printf(bio_err,"camellia ");
  1852. +#endif
  1853. +#ifndef OPENSSL_NO_RSA
  1854. + BIO_printf(bio_err,"rsa ");
  1855. +#endif
  1856. +#ifndef OPENSSL_NO_BF
  1857. + BIO_printf(bio_err,"blowfish");
  1858. +#endif
  1859. +#if !defined(OPENSSL_NO_IDEA) || !defined(OPENSSL_NO_SEED) || \
  1860. + !defined(OPENSSL_NO_RC2) || !defined(OPENSSL_NO_DES) || \
  1861. + !defined(OPENSSL_NO_RSA) || !defined(OPENSSL_NO_BF) || \
  1862. + !defined(OPENSSL_NO_AES) || !defined(OPENSSL_NO_CAMELLIA)
  1863. + BIO_printf(bio_err,"\n");
  1864. +#endif
  1865. +
  1866. + BIO_printf(bio_err,"\n");
  1867. + BIO_printf(bio_err,"Available options:\n");
  1868. +#if defined(TIMES) || defined(USE_TOD)
  1869. + BIO_printf(bio_err,"-elapsed measure time in real time instead of CPU user time.\n");
  1870. +#endif
  1871. +#ifndef OPENSSL_NO_ENGINE
  1872. + BIO_printf(bio_err,"-engine e use engine e, possibly a hardware device.\n");
  1873. +#endif
  1874. + BIO_printf(bio_err,"-evp e use EVP e.\n");
  1875. + BIO_printf(bio_err,"-decrypt time decryption instead of encryption (only EVP).\n");
  1876. + BIO_printf(bio_err,"-mr produce machine readable output.\n");
  1877. +#ifdef HAVE_FORK
  1878. + BIO_printf(bio_err,"-multi n run n benchmarks in parallel.\n");
  1879. +#endif
  1880. + goto end;
  1881. + }
  1882. + argc--;
  1883. + argv++;
  1884. + j++;
  1885. + }
  1886. +
  1887. +#ifdef HAVE_FORK
  1888. + if(multi && do_multi(multi))
  1889. + goto show_res;
  1890. +#endif
  1891. +
  1892. + if (j == 0)
  1893. + {
  1894. + for (i=0; i<ALGOR_NUM; i++)
  1895. + {
  1896. + if (i != D_EVP)
  1897. + doit[i]=1;
  1898. + }
  1899. + for (i=0; i<RSA_NUM; i++)
  1900. + rsa_doit[i]=1;
  1901. + for (i=0; i<DSA_NUM; i++)
  1902. + dsa_doit[i]=1;
  1903. + }
  1904. + for (i=0; i<ALGOR_NUM; i++)
  1905. + if (doit[i]) pr_header++;
  1906. +
  1907. + if (usertime == 0 && !mr)
  1908. + BIO_printf(bio_err,"You have chosen to measure elapsed time instead of user CPU time.\n");
  1909. + if (usertime <= 0 && !mr)
  1910. + {
  1911. + BIO_printf(bio_err,"To get the most accurate results, try to run this\n");
  1912. + BIO_printf(bio_err,"program when this computer is idle.\n");
  1913. + }
  1914. +
  1915. +
  1916. +#ifndef OPENSSL_NO_DSA
  1917. + dsa_key[0]=get_dsa512();
  1918. + dsa_key[1]=get_dsa1024();
  1919. + dsa_key[2]=get_dsa2048();
  1920. +#endif
  1921. +
  1922. +#ifndef OPENSSL_NO_DES
  1923. + DES_set_key_unchecked(&key,&sch);
  1924. + DES_set_key_unchecked(&key2,&sch2);
  1925. + DES_set_key_unchecked(&key3,&sch3);
  1926. +#endif
  1927. +#ifndef OPENSSL_NO_AES
  1928. + AES_set_encrypt_key(key16,128,&aes_ks1);
  1929. + AES_set_encrypt_key(key24,192,&aes_ks2);
  1930. + AES_set_encrypt_key(key32,256,&aes_ks3);
  1931. +#endif
  1932. +#ifndef OPENSSL_NO_CAMELLIA
  1933. + Camellia_set_key(key16,128,&camellia_ks1);
  1934. + Camellia_set_key(ckey24,192,&camellia_ks2);
  1935. + Camellia_set_key(ckey32,256,&camellia_ks3);
  1936. +#endif
  1937. +#ifndef OPENSSL_NO_IDEA
  1938. + idea_set_encrypt_key(key16,&idea_ks);
  1939. +#endif
  1940. +#ifndef OPENSSL_NO_SEED
  1941. + SEED_set_key(key16,&seed_ks);
  1942. +#endif
  1943. +#ifndef OPENSSL_NO_RC4
  1944. + RC4_set_key(&rc4_ks,16,key16);
  1945. +#endif
  1946. +#ifndef OPENSSL_NO_RC2
  1947. + RC2_set_key(&rc2_ks,16,key16,128);
  1948. +#endif
  1949. +#ifndef OPENSSL_NO_RC5
  1950. + RC5_32_set_key(&rc5_ks,16,key16,12);
  1951. +#endif
  1952. +#ifndef OPENSSL_NO_BF
  1953. + BF_set_key(&bf_ks,16,key16);
  1954. +#endif
  1955. +#ifndef OPENSSL_NO_CAST
  1956. + CAST_set_key(&cast_ks,16,key16);
  1957. +#endif
  1958. +#ifndef OPENSSL_NO_RSA
  1959. + memset(rsa_c,0,sizeof(rsa_c));
  1960. +#endif
  1961. +#ifndef SIGALRM
  1962. +//#ifndef OPENSSL_NO_DES
  1963. +// BIO_printf(bio_err,"First we calculate the approximate speed ...\n");
  1964. +// count=10;
  1965. +// do {
  1966. +// long it;
  1967. +// count*=2;
  1968. +// Time_F(START);
  1969. +// for (it=count; it; it--)
  1970. +// DES_ecb_encrypt(buf_as_des_cblock,buf_as_des_cblock,
  1971. +// &sch,DES_ENCRYPT);
  1972. +// d=Time_F(STOP);
  1973. +// } while (d <3);
  1974. + save_count=count;
  1975. + c[D_MD2][0]=count/10;
  1976. + c[D_MDC2][0]=count/10;
  1977. + c[D_MD4][0]=count;
  1978. + c[D_MD5][0]=count;
  1979. + c[D_HMAC][0]=count;
  1980. + c[D_SHA1][0]=count;
  1981. + c[D_RMD160][0]=count;
  1982. + c[D_RC4][0]=count*5;
  1983. + c[D_CBC_DES][0]=count;
  1984. + c[D_EDE3_DES][0]=count/3;
  1985. + c[D_CBC_IDEA][0]=count;
  1986. + c[D_CBC_SEED][0]=count;
  1987. + c[D_CBC_RC2][0]=count;
  1988. + c[D_CBC_RC5][0]=count;
  1989. + c[D_CBC_BF][0]=count;
  1990. + c[D_CBC_CAST][0]=count;
  1991. + c[D_CBC_128_AES][0]=count;
  1992. + c[D_CBC_192_AES][0]=count;
  1993. + c[D_CBC_256_AES][0]=count;
  1994. + c[D_CBC_128_CML][0]=count;
  1995. + c[D_CBC_192_CML][0]=count;
  1996. + c[D_CBC_256_CML][0]=count;
  1997. + c[D_SHA256][0]=count;
  1998. + c[D_SHA512][0]=count;
  1999. + c[D_IGE_128_AES][0]=count;
  2000. + c[D_IGE_192_AES][0]=count;
  2001. + c[D_IGE_256_AES][0]=count;
  2002. +
  2003. + for (i=1; i<SIZE_NUM; i++)
  2004. + {
  2005. + c[D_MD2][i]=c[D_MD2][0]*4*lengths[0]/lengths[i];
  2006. + c[D_MDC2][i]=c[D_MDC2][0]*4*lengths[0]/lengths[i];
  2007. + c[D_MD4][i]=c[D_MD4][0]*4*lengths[0]/lengths[i];
  2008. + c[D_MD5][i]=c[D_MD5][0]*4*lengths[0]/lengths[i];
  2009. + c[D_HMAC][i]=c[D_HMAC][0]*4*lengths[0]/lengths[i];
  2010. + c[D_SHA1][i]=c[D_SHA1][0]*4*lengths[0]/lengths[i];
  2011. + c[D_RMD160][i]=c[D_RMD160][0]*4*lengths[0]/lengths[i];
  2012. + c[D_SHA256][i]=c[D_SHA256][0]*4*lengths[0]/lengths[i];
  2013. + c[D_SHA512][i]=c[D_SHA512][0]*4*lengths[0]/lengths[i];
  2014. + }
  2015. + for (i=1; i<SIZE_NUM; i++)
  2016. + {
  2017. + long l0,l1;
  2018. +
  2019. + l0=(long)lengths[i-1];
  2020. + l1=(long)lengths[i];
  2021. + c[D_RC4][i]=c[D_RC4][i-1]*l0/l1;
  2022. + c[D_CBC_DES][i]=c[D_CBC_DES][i-1]*l0/l1;
  2023. + c[D_EDE3_DES][i]=c[D_EDE3_DES][i-1]*l0/l1;
  2024. + c[D_CBC_IDEA][i]=c[D_CBC_IDEA][i-1]*l0/l1;
  2025. + c[D_CBC_SEED][i]=c[D_CBC_SEED][i-1]*l0/l1;
  2026. + c[D_CBC_RC2][i]=c[D_CBC_RC2][i-1]*l0/l1;
  2027. + c[D_CBC_RC5][i]=c[D_CBC_RC5][i-1]*l0/l1;
  2028. + c[D_CBC_BF][i]=c[D_CBC_BF][i-1]*l0/l1;
  2029. + c[D_CBC_CAST][i]=c[D_CBC_CAST][i-1]*l0/l1;
  2030. + c[D_CBC_128_AES][i]=c[D_CBC_128_AES][i-1]*l0/l1;
  2031. + c[D_CBC_192_AES][i]=c[D_CBC_192_AES][i-1]*l0/l1;
  2032. + c[D_CBC_256_AES][i]=c[D_CBC_256_AES][i-1]*l0/l1;
  2033. + c[D_CBC_128_CML][i]=c[D_CBC_128_CML][i-1]*l0/l1;
  2034. + c[D_CBC_192_CML][i]=c[D_CBC_192_CML][i-1]*l0/l1;
  2035. + c[D_CBC_256_CML][i]=c[D_CBC_256_CML][i-1]*l0/l1;
  2036. + c[D_IGE_128_AES][i]=c[D_IGE_128_AES][i-1]*l0/l1;
  2037. + c[D_IGE_192_AES][i]=c[D_IGE_192_AES][i-1]*l0/l1;
  2038. + c[D_IGE_256_AES][i]=c[D_IGE_256_AES][i-1]*l0/l1;
  2039. + }
  2040. +#ifndef OPENSSL_NO_RSA
  2041. + rsa_c[R_RSA_512][0]=count/2000;
  2042. + rsa_c[R_RSA_512][1]=count/400;
  2043. + for (i=1; i<RSA_NUM; i++)
  2044. + {
  2045. + rsa_c[i][0]=rsa_c[i-1][0]/8;
  2046. + rsa_c[i][1]=rsa_c[i-1][1]/4;
  2047. + /*if ((rsa_doit[i] <= 1) && (rsa_c[i][0] == 0))
  2048. + rsa_doit[i]=0;
  2049. + else
  2050. + {*/
  2051. + if (rsa_c[i][0] == 0)
  2052. + {
  2053. + rsa_c[i][0]=1;
  2054. + rsa_c[i][1]=20;
  2055. + }
  2056. + }
  2057. + /*}*/
  2058. +#endif
  2059. +
  2060. +#ifndef OPENSSL_NO_DSA
  2061. + dsa_c[R_DSA_512][0]=count/1000;
  2062. + dsa_c[R_DSA_512][1]=count/1000/2;
  2063. + for (i=1; i<DSA_NUM; i++)
  2064. + {
  2065. + dsa_c[i][0]=dsa_c[i-1][0]/4;
  2066. + dsa_c[i][1]=dsa_c[i-1][1]/4;
  2067. + if ((dsa_doit[i] <= 1) && (dsa_c[i][0] == 0))
  2068. + dsa_doit[i]=0;
  2069. + else
  2070. + {
  2071. + if (dsa_c[i] == 0)
  2072. + {
  2073. + dsa_c[i][0]=1;
  2074. + dsa_c[i][1]=1;
  2075. + }
  2076. + }
  2077. + }
  2078. +#endif
  2079. +
  2080. +#ifndef OPENSSL_NO_ECDSA
  2081. + ecdsa_c[R_EC_P160][0]=count/1000;
  2082. + ecdsa_c[R_EC_P160][1]=count/1000/2;
  2083. + for (i=R_EC_P192; i<=R_EC_P521; i++)
  2084. + {
  2085. + ecdsa_c[i][0]=ecdsa_c[i-1][0]/2;
  2086. + ecdsa_c[i][1]=ecdsa_c[i-1][1]/2;
  2087. + if ((ecdsa_doit[i] <= 1) && (ecdsa_c[i][0] == 0))
  2088. + ecdsa_doit[i]=0;
  2089. + else
  2090. + {
  2091. + if (ecdsa_c[i] == 0)
  2092. + {
  2093. + ecdsa_c[i][0]=1;
  2094. + ecdsa_c[i][1]=1;
  2095. + }
  2096. + }
  2097. + }
  2098. + ecdsa_c[R_EC_K163][0]=count/1000;
  2099. + ecdsa_c[R_EC_K163][1]=count/1000/2;
  2100. + for (i=R_EC_K233; i<=R_EC_K571; i++)
  2101. + {
  2102. + ecdsa_c[i][0]=ecdsa_c[i-1][0]/2;
  2103. + ecdsa_c[i][1]=ecdsa_c[i-1][1]/2;
  2104. + if ((ecdsa_doit[i] <= 1) && (ecdsa_c[i][0] == 0))
  2105. + ecdsa_doit[i]=0;
  2106. + else
  2107. + {
  2108. + if (ecdsa_c[i] == 0)
  2109. + {
  2110. + ecdsa_c[i][0]=1;
  2111. + ecdsa_c[i][1]=1;
  2112. + }
  2113. + }
  2114. + }
  2115. + ecdsa_c[R_EC_B163][0]=count/1000;
  2116. + ecdsa_c[R_EC_B163][1]=count/1000/2;
  2117. + for (i=R_EC_B233; i<=R_EC_B571; i++)
  2118. + {
  2119. + ecdsa_c[i][0]=ecdsa_c[i-1][0]/2;
  2120. + ecdsa_c[i][1]=ecdsa_c[i-1][1]/2;
  2121. + if ((ecdsa_doit[i] <= 1) && (ecdsa_c[i][0] == 0))
  2122. + ecdsa_doit[i]=0;
  2123. + else
  2124. + {
  2125. + if (ecdsa_c[i] == 0)
  2126. + {
  2127. + ecdsa_c[i][0]=1;
  2128. + ecdsa_c[i][1]=1;
  2129. + }
  2130. + }
  2131. + }
  2132. +#endif
  2133. +
  2134. +#ifndef OPENSSL_NO_ECDH
  2135. + ecdh_c[R_EC_P160][0]=count/1000;
  2136. + ecdh_c[R_EC_P160][1]=count/1000;
  2137. + for (i=R_EC_P192; i<=R_EC_P521; i++)
  2138. + {
  2139. + ecdh_c[i][0]=ecdh_c[i-1][0]/2;
  2140. + ecdh_c[i][1]=ecdh_c[i-1][1]/2;
  2141. + if ((ecdh_doit[i] <= 1) && (ecdh_c[i][0] == 0))
  2142. + ecdh_doit[i]=0;
  2143. + else
  2144. + {
  2145. + if (ecdh_c[i] == 0)
  2146. + {
  2147. + ecdh_c[i][0]=1;
  2148. + ecdh_c[i][1]=1;
  2149. + }
  2150. + }
  2151. + }
  2152. + ecdh_c[R_EC_K163][0]=count/1000;
  2153. + ecdh_c[R_EC_K163][1]=count/1000;
  2154. + for (i=R_EC_K233; i<=R_EC_K571; i++)
  2155. + {
  2156. + ecdh_c[i][0]=ecdh_c[i-1][0]/2;
  2157. + ecdh_c[i][1]=ecdh_c[i-1][1]/2;
  2158. + if ((ecdh_doit[i] <= 1) && (ecdh_c[i][0] == 0))
  2159. + ecdh_doit[i]=0;
  2160. + else
  2161. + {
  2162. + if (ecdh_c[i] == 0)
  2163. + {
  2164. + ecdh_c[i][0]=1;
  2165. + ecdh_c[i][1]=1;
  2166. + }
  2167. + }
  2168. + }
  2169. + ecdh_c[R_EC_B163][0]=count/1000;
  2170. + ecdh_c[R_EC_B163][1]=count/1000;
  2171. + for (i=R_EC_B233; i<=R_EC_B571; i++)
  2172. + {
  2173. + ecdh_c[i][0]=ecdh_c[i-1][0]/2;
  2174. + ecdh_c[i][1]=ecdh_c[i-1][1]/2;
  2175. + if ((ecdh_doit[i] <= 1) && (ecdh_c[i][0] == 0))
  2176. + ecdh_doit[i]=0;
  2177. + else
  2178. + {
  2179. + if (ecdh_c[i] == 0)
  2180. + {
  2181. + ecdh_c[i][0]=1;
  2182. + ecdh_c[i][1]=1;
  2183. + }
  2184. + }
  2185. + }
  2186. +#endif
  2187. +
  2188. +#define COND(d) (count < (d))
  2189. +#define COUNT(d) (d)
  2190. +//#else
  2191. +///* not worth fixing */
  2192. +//# error "You cannot disable DES on systems without SIGALRM."
  2193. +//#endif /* OPENSSL_NO_DES */
  2194. +#else
  2195. +#define COND(c) (run)
  2196. +#define COUNT(d) (count)
  2197. + signal(SIGALRM,sig_done);
  2198. +#endif /* SIGALRM */
  2199. +
  2200. +#ifndef OPENSSL_NO_MD2
  2201. + if (doit[D_MD2])
  2202. + {
  2203. + for (j=0; j<SIZE_NUM; j++)
  2204. + {
  2205. + print_message(names[D_MD2],c[D_MD2][j],lengths[j]);
  2206. + Time_F(START);
  2207. + for (count=0,run=1; COND(c[D_MD2][j]); count++)
  2208. + EVP_Digest(buf,(unsigned long)lengths[j],&(md2[0]),NULL,EVP_md2(),NULL);
  2209. + d=Time_F(STOP);
  2210. + print_result(D_MD2,j,count,d);
  2211. + }
  2212. + }
  2213. +#endif
  2214. +#ifndef OPENSSL_NO_MDC2
  2215. + if (doit[D_MDC2])
  2216. + {
  2217. + for (j=0; j<SIZE_NUM; j++)
  2218. + {
  2219. + print_message(names[D_MDC2],c[D_MDC2][j],lengths[j]);
  2220. + Time_F(START);
  2221. + for (count=0,run=1; COND(c[D_MDC2][j]); count++)
  2222. + EVP_Digest(buf,(unsigned long)lengths[j],&(mdc2[0]),NULL,EVP_mdc2(),NULL);
  2223. + d=Time_F(STOP);
  2224. + print_result(D_MDC2,j,count,d);
  2225. + }
  2226. + }
  2227. +#endif
  2228. +
  2229. +#ifndef OPENSSL_NO_MD4
  2230. + if (doit[D_MD4])
  2231. + {
  2232. + for (j=0; j<SIZE_NUM; j++)
  2233. + {
  2234. + print_message(names[D_MD4],c[D_MD4][j],lengths[j]);
  2235. + Time_F(START);
  2236. + for (count=0,run=1; COND(c[D_MD4][j]); count++)
  2237. + EVP_Digest(&(buf[0]),(unsigned long)lengths[j],&(md4[0]),NULL,EVP_md4(),NULL);
  2238. + d=Time_F(STOP);
  2239. + print_result(D_MD4,j,count,d);
  2240. + }
  2241. + }
  2242. +#endif
  2243. +
  2244. +#ifndef OPENSSL_NO_MD5
  2245. + if (doit[D_MD5])
  2246. + {
  2247. + for (j=0; j<SIZE_NUM; j++)
  2248. + {
  2249. + print_message(names[D_MD5],c[D_MD5][j],lengths[j]);
  2250. + Time_F(START);
  2251. + for (count=0,run=1; COND(c[D_MD5][j]); count++)
  2252. + EVP_Digest(&(buf[0]),(unsigned long)lengths[j],&(md5[0]),NULL,EVP_get_digestbyname("md5"),NULL);
  2253. + d=Time_F(STOP);
  2254. + print_result(D_MD5,j,count,d);
  2255. + }
  2256. + }
  2257. +#endif
  2258. +
  2259. +#if !defined(OPENSSL_NO_MD5) && !defined(OPENSSL_NO_HMAC)
  2260. + if (doit[D_HMAC])
  2261. + {
  2262. + HMAC_CTX hctx;
  2263. +
  2264. + HMAC_CTX_init(&hctx);
  2265. + HMAC_Init_ex(&hctx,(unsigned char *)"This is a key...",
  2266. + 16,EVP_md5(), NULL);
  2267. +
  2268. + for (j=0; j<SIZE_NUM; j++)
  2269. + {
  2270. + print_message(names[D_HMAC],c[D_HMAC][j],lengths[j]);
  2271. + Time_F(START);
  2272. + for (count=0,run=1; COND(c[D_HMAC][j]); count++)
  2273. + {
  2274. + HMAC_Init_ex(&hctx,NULL,0,NULL,NULL);
  2275. + HMAC_Update(&hctx,buf,lengths[j]);
  2276. + HMAC_Final(&hctx,&(hmac[0]),NULL);
  2277. + }
  2278. + d=Time_F(STOP);
  2279. + print_result(D_HMAC,j,count,d);
  2280. + }
  2281. + HMAC_CTX_cleanup(&hctx);
  2282. + }
  2283. +#endif
  2284. +#ifndef OPENSSL_NO_SHA
  2285. + if (doit[D_SHA1])
  2286. + {
  2287. + for (j=0; j<SIZE_NUM; j++)
  2288. + {
  2289. + print_message(names[D_SHA1],c[D_SHA1][j],lengths[j]);
  2290. + Time_F(START);
  2291. + for (count=0,run=1; COND(c[D_SHA1][j]); count++)
  2292. + EVP_Digest(buf,(unsigned long)lengths[j],&(sha[0]),NULL,EVP_sha1(),NULL);
  2293. + d=Time_F(STOP);
  2294. + print_result(D_SHA1,j,count,d);
  2295. + }
  2296. + }
  2297. +
  2298. +#ifndef OPENSSL_NO_SHA256
  2299. + if (doit[D_SHA256])
  2300. + {
  2301. + for (j=0; j<SIZE_NUM; j++)
  2302. + {
  2303. + print_message(names[D_SHA256],c[D_SHA256][j],lengths[j]);
  2304. + Time_F(START);
  2305. + for (count=0,run=1; COND(c[D_SHA256][j]); count++)
  2306. + SHA256(buf,lengths[j],sha256);
  2307. + d=Time_F(STOP);
  2308. + print_result(D_SHA256,j,count,d);
  2309. + }
  2310. + }
  2311. +#endif
  2312. +
  2313. +#ifndef OPENSSL_NO_SHA512
  2314. + if (doit[D_SHA512])
  2315. + {
  2316. + for (j=0; j<SIZE_NUM; j++)
  2317. + {
  2318. + print_message(names[D_SHA512],c[D_SHA512][j],lengths[j]);
  2319. + Time_F(START);
  2320. + for (count=0,run=1; COND(c[D_SHA512][j]); count++)
  2321. + SHA512(buf,lengths[j],sha512);
  2322. + d=Time_F(STOP);
  2323. + print_result(D_SHA512,j,count,d);
  2324. + }
  2325. + }
  2326. +#endif
  2327. +
  2328. +#endif
  2329. +#ifndef OPENSSL_NO_RIPEMD
  2330. + if (doit[D_RMD160])
  2331. + {
  2332. + for (j=0; j<SIZE_NUM; j++)
  2333. + {
  2334. + print_message(names[D_RMD160],c[D_RMD160][j],lengths[j]);
  2335. + Time_F(START);
  2336. + for (count=0,run=1; COND(c[D_RMD160][j]); count++)
  2337. + EVP_Digest(buf,(unsigned long)lengths[j],&(rmd160[0]),NULL,EVP_ripemd160(),NULL);
  2338. + d=Time_F(STOP);
  2339. + print_result(D_RMD160,j,count,d);
  2340. + }
  2341. + }
  2342. +#endif
  2343. +#ifndef OPENSSL_NO_RC4
  2344. + if (doit[D_RC4])
  2345. + {
  2346. + for (j=0; j<SIZE_NUM; j++)
  2347. + {
  2348. + print_message(names[D_RC4],c[D_RC4][j],lengths[j]);
  2349. + Time_F(START);
  2350. + for (count=0,run=1; COND(c[D_RC4][j]); count++)
  2351. + RC4(&rc4_ks,(unsigned int)lengths[j],
  2352. + buf,buf);
  2353. + d=Time_F(STOP);
  2354. + print_result(D_RC4,j,count,d);
  2355. + }
  2356. + }
  2357. +#endif
  2358. +#ifndef OPENSSL_NO_DES
  2359. + if (doit[D_CBC_DES])
  2360. + {
  2361. + for (j=0; j<SIZE_NUM; j++)
  2362. + {
  2363. + print_message(names[D_CBC_DES],c[D_CBC_DES][j],lengths[j]);
  2364. + Time_F(START);
  2365. + for (count=0,run=1; COND(c[D_CBC_DES][j]); count++)
  2366. + DES_ncbc_encrypt(buf,buf,lengths[j],&sch,
  2367. + &DES_iv,DES_ENCRYPT);
  2368. + d=Time_F(STOP);
  2369. + print_result(D_CBC_DES,j,count,d);
  2370. + }
  2371. + }
  2372. +
  2373. + if (doit[D_EDE3_DES])
  2374. + {
  2375. + for (j=0; j<SIZE_NUM; j++)
  2376. + {
  2377. + print_message(names[D_EDE3_DES],c[D_EDE3_DES][j],lengths[j]);
  2378. + Time_F(START);
  2379. + for (count=0,run=1; COND(c[D_EDE3_DES][j]); count++)
  2380. + DES_ede3_cbc_encrypt(buf,buf,lengths[j],
  2381. + &sch,&sch2,&sch3,
  2382. + &DES_iv,DES_ENCRYPT);
  2383. + d=Time_F(STOP);
  2384. + print_result(D_EDE3_DES,j,count,d);
  2385. + }
  2386. + }
  2387. +#endif
  2388. +#ifndef OPENSSL_NO_AES
  2389. + if (doit[D_CBC_128_AES])
  2390. + {
  2391. + for (j=0; j<SIZE_NUM; j++)
  2392. + {
  2393. + print_message(names[D_CBC_128_AES],c[D_CBC_128_AES][j],lengths[j]);
  2394. + Time_F(START);
  2395. + for (count=0,run=1; COND(c[D_CBC_128_AES][j]); count++)
  2396. + AES_cbc_encrypt(buf,buf,
  2397. + (unsigned long)lengths[j],&aes_ks1,
  2398. + iv,AES_ENCRYPT);
  2399. + d=Time_F(STOP);
  2400. + print_result(D_CBC_128_AES,j,count,d);
  2401. + }
  2402. + }
  2403. + if (doit[D_CBC_192_AES])
  2404. + {
  2405. + for (j=0; j<SIZE_NUM; j++)
  2406. + {
  2407. + print_message(names[D_CBC_192_AES],c[D_CBC_192_AES][j],lengths[j]);
  2408. + Time_F(START);
  2409. + for (count=0,run=1; COND(c[D_CBC_192_AES][j]); count++)
  2410. + AES_cbc_encrypt(buf,buf,
  2411. + (unsigned long)lengths[j],&aes_ks2,
  2412. + iv,AES_ENCRYPT);
  2413. + d=Time_F(STOP);
  2414. + print_result(D_CBC_192_AES,j,count,d);
  2415. + }
  2416. + }
  2417. + if (doit[D_CBC_256_AES])
  2418. + {
  2419. + for (j=0; j<SIZE_NUM; j++)
  2420. + {
  2421. + print_message(names[D_CBC_256_AES],c[D_CBC_256_AES][j],lengths[j]);
  2422. + Time_F(START);
  2423. + for (count=0,run=1; COND(c[D_CBC_256_AES][j]); count++)
  2424. + AES_cbc_encrypt(buf,buf,
  2425. + (unsigned long)lengths[j],&aes_ks3,
  2426. + iv,AES_ENCRYPT);
  2427. + d=Time_F(STOP);
  2428. + print_result(D_CBC_256_AES,j,count,d);
  2429. + }
  2430. + }
  2431. +
  2432. + if (doit[D_IGE_128_AES])
  2433. + {
  2434. + for (j=0; j<SIZE_NUM; j++)
  2435. + {
  2436. + print_message(names[D_IGE_128_AES],c[D_IGE_128_AES][j],lengths[j]);
  2437. + Time_F(START);
  2438. + for (count=0,run=1; COND(c[D_IGE_128_AES][j]); count++)
  2439. + AES_ige_encrypt(buf,buf2,
  2440. + (unsigned long)lengths[j],&aes_ks1,
  2441. + iv,AES_ENCRYPT);
  2442. + d=Time_F(STOP);
  2443. + print_result(D_IGE_128_AES,j,count,d);
  2444. + }
  2445. + }
  2446. + if (doit[D_IGE_192_AES])
  2447. + {
  2448. + for (j=0; j<SIZE_NUM; j++)
  2449. + {
  2450. + print_message(names[D_IGE_192_AES],c[D_IGE_192_AES][j],lengths[j]);
  2451. + Time_F(START);
  2452. + for (count=0,run=1; COND(c[D_IGE_192_AES][j]); count++)
  2453. + AES_ige_encrypt(buf,buf2,
  2454. + (unsigned long)lengths[j],&aes_ks2,
  2455. + iv,AES_ENCRYPT);
  2456. + d=Time_F(STOP);
  2457. + print_result(D_IGE_192_AES,j,count,d);
  2458. + }
  2459. + }
  2460. + if (doit[D_IGE_256_AES])
  2461. + {
  2462. + for (j=0; j<SIZE_NUM; j++)
  2463. + {
  2464. + print_message(names[D_IGE_256_AES],c[D_IGE_256_AES][j],lengths[j]);
  2465. + Time_F(START);
  2466. + for (count=0,run=1; COND(c[D_IGE_256_AES][j]); count++)
  2467. + AES_ige_encrypt(buf,buf2,
  2468. + (unsigned long)lengths[j],&aes_ks3,
  2469. + iv,AES_ENCRYPT);
  2470. + d=Time_F(STOP);
  2471. + print_result(D_IGE_256_AES,j,count,d);
  2472. + }
  2473. + }
  2474. +#endif
  2475. +#ifndef OPENSSL_NO_CAMELLIA
  2476. + if (doit[D_CBC_128_CML])
  2477. + {
  2478. + for (j=0; j<SIZE_NUM; j++)
  2479. + {
  2480. + print_message(names[D_CBC_128_CML],c[D_CBC_128_CML][j],lengths[j]);
  2481. + Time_F(START);
  2482. + for (count=0,run=1; COND(c[D_CBC_128_CML][j]); count++)
  2483. + Camellia_cbc_encrypt(buf,buf,
  2484. + (unsigned long)lengths[j],&camellia_ks1,
  2485. + iv,CAMELLIA_ENCRYPT);
  2486. + d=Time_F(STOP);
  2487. + print_result(D_CBC_128_CML,j,count,d);
  2488. + }
  2489. + }
  2490. + if (doit[D_CBC_192_CML])
  2491. + {
  2492. + for (j=0; j<SIZE_NUM; j++)
  2493. + {
  2494. + print_message(names[D_CBC_192_CML],c[D_CBC_192_CML][j],lengths[j]);
  2495. + Time_F(START);
  2496. + for (count=0,run=1; COND(c[D_CBC_192_CML][j]); count++)
  2497. + Camellia_cbc_encrypt(buf,buf,
  2498. + (unsigned long)lengths[j],&camellia_ks2,
  2499. + iv,CAMELLIA_ENCRYPT);
  2500. + d=Time_F(STOP);
  2501. + print_result(D_CBC_192_CML,j,count,d);
  2502. + }
  2503. + }
  2504. + if (doit[D_CBC_256_CML])
  2505. + {
  2506. + for (j=0; j<SIZE_NUM; j++)
  2507. + {
  2508. + print_message(names[D_CBC_256_CML],c[D_CBC_256_CML][j],lengths[j]);
  2509. + Time_F(START);
  2510. + for (count=0,run=1; COND(c[D_CBC_256_CML][j]); count++)
  2511. + Camellia_cbc_encrypt(buf,buf,
  2512. + (unsigned long)lengths[j],&camellia_ks3,
  2513. + iv,CAMELLIA_ENCRYPT);
  2514. + d=Time_F(STOP);
  2515. + print_result(D_CBC_256_CML,j,count,d);
  2516. + }
  2517. + }
  2518. +
  2519. +#endif
  2520. +#ifndef OPENSSL_NO_IDEA
  2521. + if (doit[D_CBC_IDEA])
  2522. + {
  2523. + for (j=0; j<SIZE_NUM; j++)
  2524. + {
  2525. + print_message(names[D_CBC_IDEA],c[D_CBC_IDEA][j],lengths[j]);
  2526. + Time_F(START);
  2527. + for (count=0,run=1; COND(c[D_CBC_IDEA][j]); count++)
  2528. + idea_cbc_encrypt(buf,buf,
  2529. + (unsigned long)lengths[j],&idea_ks,
  2530. + iv,IDEA_ENCRYPT);
  2531. + d=Time_F(STOP);
  2532. + print_result(D_CBC_IDEA,j,count,d);
  2533. + }
  2534. + }
  2535. +#endif
  2536. +#ifndef OPENSSL_NO_SEED
  2537. + if (doit[D_CBC_SEED])
  2538. + {
  2539. + for (j=0; j<SIZE_NUM; j++)
  2540. + {
  2541. + print_message(names[D_CBC_SEED],c[D_CBC_SEED][j],lengths[j]);
  2542. + Time_F(START);
  2543. + for (count=0,run=1; COND(c[D_CBC_SEED][j]); count++)
  2544. + SEED_cbc_encrypt(buf,buf,
  2545. + (unsigned long)lengths[j],&seed_ks,iv,1);
  2546. + d=Time_F(STOP);
  2547. + print_result(D_CBC_SEED,j,count,d);
  2548. + }
  2549. + }
  2550. +#endif
  2551. +#ifndef OPENSSL_NO_RC2
  2552. + if (doit[D_CBC_RC2])
  2553. + {
  2554. + for (j=0; j<SIZE_NUM; j++)
  2555. + {
  2556. + print_message(names[D_CBC_RC2],c[D_CBC_RC2][j],lengths[j]);
  2557. + Time_F(START);
  2558. + for (count=0,run=1; COND(c[D_CBC_RC2][j]); count++)
  2559. + RC2_cbc_encrypt(buf,buf,
  2560. + (unsigned long)lengths[j],&rc2_ks,
  2561. + iv,RC2_ENCRYPT);
  2562. + d=Time_F(STOP);
  2563. + print_result(D_CBC_RC2,j,count,d);
  2564. + }
  2565. + }
  2566. +#endif
  2567. +#ifndef OPENSSL_NO_RC5
  2568. + if (doit[D_CBC_RC5])
  2569. + {
  2570. + for (j=0; j<SIZE_NUM; j++)
  2571. + {
  2572. + print_message(names[D_CBC_RC5],c[D_CBC_RC5][j],lengths[j]);
  2573. + Time_F(START);
  2574. + for (count=0,run=1; COND(c[D_CBC_RC5][j]); count++)
  2575. + RC5_32_cbc_encrypt(buf,buf,
  2576. + (unsigned long)lengths[j],&rc5_ks,
  2577. + iv,RC5_ENCRYPT);
  2578. + d=Time_F(STOP);
  2579. + print_result(D_CBC_RC5,j,count,d);
  2580. + }
  2581. + }
  2582. +#endif
  2583. +#ifndef OPENSSL_NO_BF
  2584. + if (doit[D_CBC_BF])
  2585. + {
  2586. + for (j=0; j<SIZE_NUM; j++)
  2587. + {
  2588. + print_message(names[D_CBC_BF],c[D_CBC_BF][j],lengths[j]);
  2589. + Time_F(START);
  2590. + for (count=0,run=1; COND(c[D_CBC_BF][j]); count++)
  2591. + BF_cbc_encrypt(buf,buf,
  2592. + (unsigned long)lengths[j],&bf_ks,
  2593. + iv,BF_ENCRYPT);
  2594. + d=Time_F(STOP);
  2595. + print_result(D_CBC_BF,j,count,d);
  2596. + }
  2597. + }
  2598. +#endif
  2599. +#ifndef OPENSSL_NO_CAST
  2600. + if (doit[D_CBC_CAST])
  2601. + {
  2602. + for (j=0; j<SIZE_NUM; j++)
  2603. + {
  2604. + print_message(names[D_CBC_CAST],c[D_CBC_CAST][j],lengths[j]);
  2605. + Time_F(START);
  2606. + for (count=0,run=1; COND(c[D_CBC_CAST][j]); count++)
  2607. + CAST_cbc_encrypt(buf,buf,
  2608. + (unsigned long)lengths[j],&cast_ks,
  2609. + iv,CAST_ENCRYPT);
  2610. + d=Time_F(STOP);
  2611. + print_result(D_CBC_CAST,j,count,d);
  2612. + }
  2613. + }
  2614. +#endif
  2615. +
  2616. +
  2617. +// if (doit[D_EVP])
  2618. +// {
  2619. +// for (j=0; j<SIZE_NUM; j++)
  2620. +// {
  2621. +// if (evp_cipher)
  2622. +// {
  2623. +// EVP_CIPHER_CTX ctx;
  2624. +// int outl;
  2625. +//
  2626. +// names[D_EVP]=OBJ_nid2ln(evp_cipher->nid);
  2627. +// /* -O3 -fschedule-insns messes up an
  2628. +// * optimization here! names[D_EVP]
  2629. +// * somehow becomes NULL */
  2630. +// print_message(names[D_EVP],save_count,
  2631. +// lengths[j]);
  2632. +//
  2633. +// EVP_CIPHER_CTX_init(&ctx);
  2634. +// if(decrypt)
  2635. +// EVP_DecryptInit_ex(&ctx,evp_cipher,NULL,key16,iv);
  2636. +// else
  2637. +// EVP_EncryptInit_ex(&ctx,evp_cipher,NULL,key16,iv);
  2638. +// EVP_CIPHER_CTX_set_padding(&ctx, 0);
  2639. +//
  2640. +// Time_F(START);
  2641. +// if(decrypt)
  2642. +// for (count=0,run=1; COND(save_count*4*lengths[0]/lengths[j]); count++)
  2643. +// EVP_DecryptUpdate(&ctx,buf,&outl,buf,lengths[j]);
  2644. +// else
  2645. +// for (count=0,run=1; COND(save_count*4*lengths[0]/lengths[j]); count++)
  2646. +// EVP_EncryptUpdate(&ctx,buf,&outl,buf,lengths[j]);
  2647. +// if(decrypt)
  2648. +// EVP_DecryptFinal_ex(&ctx,buf,&outl);
  2649. +// else
  2650. +// EVP_EncryptFinal_ex(&ctx,buf,&outl);
  2651. +// d=Time_F(STOP);
  2652. +// EVP_CIPHER_CTX_cleanup(&ctx);
  2653. +// }
  2654. +// if (evp_md)
  2655. +// {
  2656. +// names[D_EVP]=OBJ_nid2ln(evp_md->type);
  2657. +// print_message(names[D_EVP],save_count,
  2658. +// lengths[j]);
  2659. +//
  2660. +// Time_F(START);
  2661. +// for (count=0,run=1; COND(save_count*4*lengths[0]/lengths[j]); count++)
  2662. +// EVP_Digest(buf,lengths[j],&(md[0]),NULL,evp_md,NULL);
  2663. +//
  2664. +// d=Time_F(STOP);
  2665. +// }
  2666. +// print_result(D_EVP,j,count,d);
  2667. +// }
  2668. +// }
  2669. +
  2670. + RAND_set_rand_method(&rand_dummy_meth);
  2671. +
  2672. + RAND_seed(rnd_seed, sizeof rnd_seed);
  2673. + RAND_pseudo_bytes(buf,36);
  2674. +#ifndef OPENSSL_NO_RSA
  2675. + for (j=0; j<RSA_NUM; j++)
  2676. + {
  2677. + int ret;
  2678. + const unsigned char *p;
  2679. +
  2680. + if (!rsa_doit[j]) continue;
  2681. +
  2682. + p=rsa_data[j];
  2683. + rsa_key[j]=d2i_RSAPrivateKey(NULL,&p,rsa_data_length[j]);
  2684. + rsa_key[j]->flags |= (RSA_FLAG_NO_CONSTTIME | RSA_FLAG_NO_BLINDING);
  2685. + if (rsa_key[j] == NULL)
  2686. + {
  2687. + BIO_printf(bio_err,"internal error loading RSA key number %d\n",j);
  2688. + goto end;
  2689. + }
  2690. + ret=RSA_sign(NID_md5_sha1, buf,36, buf2, &rsa_num, rsa_key[j]);
  2691. + if (ret == 0)
  2692. + {
  2693. + BIO_printf(bio_err,"RSA sign failure. No RSA sign will be done.\n");
  2694. + //ERR_print_errors(bio_err);
  2695. + rsa_count=1;
  2696. + }
  2697. + else
  2698. + {
  2699. + pkey_print_message("private","rsa",
  2700. + rsa_c[j][0],rsa_bits[j],
  2701. + RSA_SECONDS);
  2702. +/* RSA_blinding_on(rsa_key[j],NULL); */
  2703. + Time_F(START);
  2704. + for (count=0,run=1; COND(rsa_c[j][0]); count++)
  2705. + {
  2706. + ret=RSA_sign(NID_md5_sha1, buf,36, buf2,
  2707. + &rsa_num, rsa_key[j]);
  2708. + if (ret == 0)
  2709. + {
  2710. + BIO_printf(bio_err,
  2711. + "RSA sign failure\n");
  2712. + //ERR_print_errors(bio_err);
  2713. + count=1;
  2714. + break;
  2715. + }
  2716. + }
  2717. + d=Time_F(STOP);
  2718. + BIO_printf(bio_err,mr ? "+R1:%ld:%d:%.2f\n"
  2719. + : "%ld %d bit private RSA's in %.2fs\n",
  2720. + count,rsa_bits[j],d);
  2721. + rsa_results[j][0]=d/(double)count;
  2722. + rsa_count=count;
  2723. + }
  2724. +
  2725. +#if 1
  2726. + ret=RSA_verify(NID_md5_sha1, buf,36, buf2, rsa_num, rsa_key[j]);
  2727. + if (ret <= 0)
  2728. + {
  2729. + BIO_printf(bio_err,"RSA verify failure. No RSA verify will be done.\n");
  2730. + //ERR_print_errors(bio_err);
  2731. + rsa_doit[j] = 0;
  2732. + }
  2733. + else
  2734. + {
  2735. + pkey_print_message("public","rsa",
  2736. + rsa_c[j][1],rsa_bits[j],
  2737. + RSA_SECONDS);
  2738. + Time_F(START);
  2739. + for (count=0,run=1; COND(rsa_c[j][1]); count++)
  2740. + {
  2741. + ret=RSA_verify(NID_md5_sha1, buf,36, buf2,
  2742. + rsa_num, rsa_key[j]);
  2743. + if (ret == 0)
  2744. + {
  2745. + BIO_printf(bio_err,
  2746. + "RSA verify failure\n");
  2747. + //ERR_print_errors(bio_err);
  2748. + count=1;
  2749. + break;
  2750. + }
  2751. + }
  2752. + d=Time_F(STOP);
  2753. + BIO_printf(bio_err,mr ? "+R2:%ld:%d:%.2f\n"
  2754. + : "%ld %d bit public RSA's in %.2fs\n",
  2755. + count,rsa_bits[j],d);
  2756. + rsa_results[j][1]=d/(double)count;
  2757. + }
  2758. +#endif
  2759. +
  2760. +// if (rsa_count </*=*/ 1)
  2761. +// {
  2762. +// /* if longer than 10s, don't do any more */
  2763. +// for (j++; j<RSA_NUM; j++)
  2764. +// rsa_doit[j]=0;
  2765. +// }
  2766. + if (rsa_key[j] != NULL)
  2767. + RSA_free(rsa_key[j]);
  2768. +
  2769. + }
  2770. +#endif
  2771. +
  2772. + RAND_pseudo_bytes(buf,20);
  2773. +#ifndef OPENSSL_NO_DSA
  2774. + if (RAND_status() != 1)
  2775. + {
  2776. + RAND_seed(rnd_seed, sizeof rnd_seed);
  2777. + rnd_fake = 1;
  2778. + }
  2779. + for (j=0; j<DSA_NUM; j++)
  2780. + {
  2781. + unsigned int kk;
  2782. + int ret;
  2783. +
  2784. + if (!dsa_doit[j]) continue;
  2785. +/* DSA_generate_key(dsa_key[j]); */
  2786. +/* DSA_sign_setup(dsa_key[j],NULL); */
  2787. + ret=DSA_sign(EVP_PKEY_DSA,buf,20,buf2,
  2788. + &kk,dsa_key[j]);
  2789. + if (ret == 0)
  2790. + {
  2791. + BIO_printf(bio_err,"DSA sign failure. No DSA sign will be done.\n");
  2792. + ERR_print_errors(bio_err);
  2793. + rsa_count=1;
  2794. + }
  2795. + else
  2796. + {
  2797. + pkey_print_message("sign","dsa",
  2798. + dsa_c[j][0],dsa_bits[j],
  2799. + DSA_SECONDS);
  2800. + Time_F(START);
  2801. + for (count=0,run=1; COND(dsa_c[j][0]); count++)
  2802. + {
  2803. + ret=DSA_sign(EVP_PKEY_DSA,buf,20,buf2,
  2804. + &kk,dsa_key[j]);
  2805. + if (ret == 0)
  2806. + {
  2807. + BIO_printf(bio_err,
  2808. + "DSA sign failure\n");
  2809. + ERR_print_errors(bio_err);
  2810. + count=1;
  2811. + break;
  2812. + }
  2813. + }
  2814. + d=Time_F(STOP);
  2815. + BIO_printf(bio_err,mr ? "+R3:%ld:%d:%.2f\n"
  2816. + : "%ld %d bit DSA signs in %.2fs\n",
  2817. + count,dsa_bits[j],d);
  2818. + dsa_results[j][0]=d/(double)count;
  2819. + rsa_count=count;
  2820. + }
  2821. +
  2822. + ret=DSA_verify(EVP_PKEY_DSA,buf,20,buf2,
  2823. + kk,dsa_key[j]);
  2824. + if (ret <= 0)
  2825. + {
  2826. + BIO_printf(bio_err,"DSA verify failure. No DSA verify will be done.\n");
  2827. + ERR_print_errors(bio_err);
  2828. + dsa_doit[j] = 0;
  2829. + }
  2830. + else
  2831. + {
  2832. + pkey_print_message("verify","dsa",
  2833. + dsa_c[j][1],dsa_bits[j],
  2834. + DSA_SECONDS);
  2835. + Time_F(START);
  2836. + for (count=0,run=1; COND(dsa_c[j][1]); count++)
  2837. + {
  2838. + ret=DSA_verify(EVP_PKEY_DSA,buf,20,buf2,
  2839. + kk,dsa_key[j]);
  2840. + if (ret <= 0)
  2841. + {
  2842. + BIO_printf(bio_err,
  2843. + "DSA verify failure\n");
  2844. + ERR_print_errors(bio_err);
  2845. + count=1;
  2846. + break;
  2847. + }
  2848. + }
  2849. + d=Time_F(STOP);
  2850. + BIO_printf(bio_err,mr ? "+R4:%ld:%d:%.2f\n"
  2851. + : "%ld %d bit DSA verify in %.2fs\n",
  2852. + count,dsa_bits[j],d);
  2853. + dsa_results[j][1]=d/(double)count;
  2854. + }
  2855. +
  2856. + if (rsa_count <= 1)
  2857. + {
  2858. + /* if longer than 10s, don't do any more */
  2859. + for (j++; j<DSA_NUM; j++)
  2860. + dsa_doit[j]=0;
  2861. + }
  2862. + }
  2863. + if (rnd_fake) RAND_cleanup();
  2864. +#endif
  2865. +
  2866. +#ifndef OPENSSL_NO_ECDSA
  2867. + if (RAND_status() != 1)
  2868. + {
  2869. + RAND_seed(rnd_seed, sizeof rnd_seed);
  2870. + rnd_fake = 1;
  2871. + }
  2872. + for (j=0; j<EC_NUM; j++)
  2873. + {
  2874. + int ret;
  2875. +
  2876. + if (!ecdsa_doit[j]) continue; /* Ignore Curve */
  2877. + ecdsa[j] = EC_KEY_new_by_curve_name(test_curves[j]);
  2878. + if (ecdsa[j] == NULL)
  2879. + {
  2880. + BIO_printf(bio_err,"ECDSA failure.\n");
  2881. + ERR_print_errors(bio_err);
  2882. + rsa_count=1;
  2883. + }
  2884. + else
  2885. + {
  2886. +#if 1
  2887. + EC_KEY_precompute_mult(ecdsa[j], NULL);
  2888. +#endif
  2889. + /* Perform ECDSA signature test */
  2890. + EC_KEY_generate_key(ecdsa[j]);
  2891. + ret = ECDSA_sign(0, buf, 20, ecdsasig,
  2892. + &ecdsasiglen, ecdsa[j]);
  2893. + if (ret == 0)
  2894. + {
  2895. + BIO_printf(bio_err,"ECDSA sign failure. No ECDSA sign will be done.\n");
  2896. + ERR_print_errors(bio_err);
  2897. + rsa_count=1;
  2898. + }
  2899. + else
  2900. + {
  2901. + pkey_print_message("sign","ecdsa",
  2902. + ecdsa_c[j][0],
  2903. + test_curves_bits[j],
  2904. + ECDSA_SECONDS);
  2905. +
  2906. + Time_F(START);
  2907. + for (count=0,run=1; COND(ecdsa_c[j][0]);
  2908. + count++)
  2909. + {
  2910. + ret=ECDSA_sign(0, buf, 20,
  2911. + ecdsasig, &ecdsasiglen,
  2912. + ecdsa[j]);
  2913. + if (ret == 0)
  2914. + {
  2915. + BIO_printf(bio_err, "ECDSA sign failure\n");
  2916. + ERR_print_errors(bio_err);
  2917. + count=1;
  2918. + break;
  2919. + }
  2920. + }
  2921. + d=Time_F(STOP);
  2922. +
  2923. + BIO_printf(bio_err, mr ? "+R5:%ld:%d:%.2f\n" :
  2924. + "%ld %d bit ECDSA signs in %.2fs \n",
  2925. + count, test_curves_bits[j], d);
  2926. + ecdsa_results[j][0]=d/(double)count;
  2927. + rsa_count=count;
  2928. + }
  2929. +
  2930. + /* Perform ECDSA verification test */
  2931. + ret=ECDSA_verify(0, buf, 20, ecdsasig,
  2932. + ecdsasiglen, ecdsa[j]);
  2933. + if (ret != 1)
  2934. + {
  2935. + BIO_printf(bio_err,"ECDSA verify failure. No ECDSA verify will be done.\n");
  2936. + ERR_print_errors(bio_err);
  2937. + ecdsa_doit[j] = 0;
  2938. + }
  2939. + else
  2940. + {
  2941. + pkey_print_message("verify","ecdsa",
  2942. + ecdsa_c[j][1],
  2943. + test_curves_bits[j],
  2944. + ECDSA_SECONDS);
  2945. + Time_F(START);
  2946. + for (count=0,run=1; COND(ecdsa_c[j][1]); count++)
  2947. + {
  2948. + ret=ECDSA_verify(0, buf, 20, ecdsasig, ecdsasiglen, ecdsa[j]);
  2949. + if (ret != 1)
  2950. + {
  2951. + BIO_printf(bio_err, "ECDSA verify failure\n");
  2952. + ERR_print_errors(bio_err);
  2953. + count=1;
  2954. + break;
  2955. + }
  2956. + }
  2957. + d=Time_F(STOP);
  2958. + BIO_printf(bio_err, mr? "+R6:%ld:%d:%.2f\n"
  2959. + : "%ld %d bit ECDSA verify in %.2fs\n",
  2960. + count, test_curves_bits[j], d);
  2961. + ecdsa_results[j][1]=d/(double)count;
  2962. + }
  2963. +
  2964. + if (rsa_count <= 1)
  2965. + {
  2966. + /* if longer than 10s, don't do any more */
  2967. + for (j++; j<EC_NUM; j++)
  2968. + ecdsa_doit[j]=0;
  2969. + }
  2970. + }
  2971. + }
  2972. + if (rnd_fake) RAND_cleanup();
  2973. +#endif
  2974. +
  2975. +#ifndef OPENSSL_NO_ECDH
  2976. + if (RAND_status() != 1)
  2977. + {
  2978. + RAND_seed(rnd_seed, sizeof rnd_seed);
  2979. + rnd_fake = 1;
  2980. + }
  2981. + for (j=0; j<EC_NUM; j++)
  2982. + {
  2983. + if (!ecdh_doit[j]) continue;
  2984. + ecdh_a[j] = EC_KEY_new_by_curve_name(test_curves[j]);
  2985. + ecdh_b[j] = EC_KEY_new_by_curve_name(test_curves[j]);
  2986. + if ((ecdh_a[j] == NULL) || (ecdh_b[j] == NULL))
  2987. + {
  2988. + BIO_printf(bio_err,"ECDH failure.\n");
  2989. + //ERR_print_errors(bio_err);
  2990. + rsa_count=1;
  2991. + }
  2992. + else
  2993. + {
  2994. + /* generate two ECDH key pairs */
  2995. + if (!EC_KEY_generate_key(ecdh_a[j]) ||
  2996. + !EC_KEY_generate_key(ecdh_b[j]))
  2997. + {
  2998. + BIO_printf(bio_err,"ECDH key generation failure.\n");
  2999. + //ERR_print_errors(bio_err);
  3000. + rsa_count=1;
  3001. + }
  3002. + else
  3003. + {
  3004. + /* If field size is not more than 24 octets, then use SHA-1 hash of result;
  3005. + * otherwise, use result (see section 4.8 of draft-ietf-tls-ecc-03.txt).
  3006. + */
  3007. + int field_size, outlen;
  3008. + void *(*kdf)(const void *in, size_t inlen, void *out, size_t *xoutlen);
  3009. + field_size = EC_GROUP_get_degree(EC_KEY_get0_group(ecdh_a[j]));
  3010. + if (field_size <= 24 * 8)
  3011. + {
  3012. + outlen = KDF1_SHA1_len;
  3013. + kdf = KDF1_SHA1;
  3014. + }
  3015. + else
  3016. + {
  3017. + outlen = (field_size+7)/8;
  3018. + kdf = NULL;
  3019. + }
  3020. + secret_size_a = ECDH_compute_key(secret_a, outlen,
  3021. + EC_KEY_get0_public_key(ecdh_b[j]),
  3022. + ecdh_a[j], kdf);
  3023. + secret_size_b = ECDH_compute_key(secret_b, outlen,
  3024. + EC_KEY_get0_public_key(ecdh_a[j]),
  3025. + ecdh_b[j], kdf);
  3026. + if (secret_size_a != secret_size_b)
  3027. + ecdh_checks = 0;
  3028. + else
  3029. + ecdh_checks = 1;
  3030. +
  3031. + for (secret_idx = 0;
  3032. + (secret_idx < secret_size_a)
  3033. + && (ecdh_checks == 1);
  3034. + secret_idx++)
  3035. + {
  3036. + if (secret_a[secret_idx] != secret_b[secret_idx])
  3037. + ecdh_checks = 0;
  3038. + }
  3039. +
  3040. + if (ecdh_checks == 0)
  3041. + {
  3042. + BIO_printf(bio_err,"ECDH computations don't match.\n");
  3043. + //ERR_print_errors(bio_err);
  3044. + rsa_count=1;
  3045. + }
  3046. +
  3047. + pkey_print_message("","ecdh",
  3048. + ecdh_c[j][0],
  3049. + test_curves_bits[j],
  3050. + ECDH_SECONDS);
  3051. + Time_F(START);
  3052. + for (count=0,run=1; COND(ecdh_c[j][0]); count++)
  3053. + {
  3054. + ECDH_compute_key(secret_a, outlen,
  3055. + EC_KEY_get0_public_key(ecdh_b[j]),
  3056. + ecdh_a[j], kdf);
  3057. + }
  3058. + d=Time_F(STOP);
  3059. + BIO_printf(bio_err, mr ? "+R7:%ld:%d:%.2f\n" :"%ld %d-bit ECDH ops in %.2fs\n",
  3060. + count, test_curves_bits[j], d);
  3061. + ecdh_results[j][0]=d/(double)count;
  3062. + rsa_count=count;
  3063. + }
  3064. + }
  3065. +
  3066. +
  3067. + if (rsa_count </*=*/ 1)
  3068. + {
  3069. + /* if longer than 10s, don't do any more */
  3070. + for (j++; j<EC_NUM; j++)
  3071. + ecdh_doit[j]=0;
  3072. + }
  3073. + }
  3074. + if (rnd_fake) RAND_cleanup();
  3075. +#endif
  3076. +#ifdef HAVE_FORK
  3077. +show_res:
  3078. +#endif
  3079. + if(!mr)
  3080. + {
  3081. + fprintf(stdout,"%s\n",SSLeay_version(SSLEAY_VERSION));
  3082. + fprintf(stdout,"%s\n",SSLeay_version(SSLEAY_BUILT_ON));
  3083. + printf("options:");
  3084. + printf("%s ",BN_options());
  3085. +#ifndef OPENSSL_NO_MD2
  3086. + printf("%s ",MD2_options());
  3087. +#endif
  3088. +#ifndef OPENSSL_NO_RC4
  3089. + printf("%s ",RC4_options());
  3090. +#endif
  3091. +#ifndef OPENSSL_NO_DES
  3092. + printf("%s ",DES_options());
  3093. +#endif
  3094. +#ifndef OPENSSL_NO_AES
  3095. + printf("%s ",AES_options());
  3096. +#endif
  3097. +#ifndef OPENSSL_NO_IDEA
  3098. + printf("%s ",idea_options());
  3099. +#endif
  3100. +#ifndef OPENSSL_NO_BF
  3101. + printf("%s ",BF_options());
  3102. +#endif
  3103. + fprintf(stdout,"\n%s\n",SSLeay_version(SSLEAY_CFLAGS));
  3104. + printf("available timing options: ");
  3105. +#ifdef TIMES
  3106. + printf("TIMES ");
  3107. +#endif
  3108. +#ifdef TIMEB
  3109. + printf("TIMEB ");
  3110. +#endif
  3111. +#ifdef USE_TOD
  3112. + printf("USE_TOD ");
  3113. +#endif
  3114. +#ifdef HZ
  3115. +#define as_string(s) (#s)
  3116. + {
  3117. + double dbl = HZ;
  3118. + printf("HZ=%g", dbl);
  3119. + }
  3120. +# ifdef _SC_CLK_TCK
  3121. + printf(" [sysconf value]");
  3122. +# endif
  3123. +#endif
  3124. + printf("\n");
  3125. + printf("timing function used: %s%s%s%s%s%s%s\n",
  3126. + (ftime_used ? "ftime" : ""),
  3127. + (ftime_used + times_used > 1 ? "," : ""),
  3128. + (times_used ? "times" : ""),
  3129. + (ftime_used + times_used + gettimeofday_used > 1 ? "," : ""),
  3130. + (gettimeofday_used ? "gettimeofday" : ""),
  3131. + (ftime_used + times_used + gettimeofday_used + getrusage_used > 1 ? "," : ""),
  3132. + (getrusage_used ? "getrusage" : ""));
  3133. + }
  3134. +
  3135. + if (pr_header)
  3136. + {
  3137. + if(mr)
  3138. + fprintf(stdout,"+H");
  3139. + else
  3140. + {
  3141. + fprintf(stdout,"The 'numbers' are in 1000s of bytes per second processed.\n");
  3142. + fprintf(stdout,"type ");
  3143. + }
  3144. + for (j=0; j<SIZE_NUM; j++)
  3145. + fprintf(stdout,mr ? ":%d" : "%7d bytes",lengths[j]);
  3146. + fprintf(stdout,"\n");
  3147. + }
  3148. +
  3149. + for (k=0; k<ALGOR_NUM; k++)
  3150. + {
  3151. + if (!doit[k]) continue;
  3152. + if(mr)
  3153. + fprintf(stdout,"+F:%d:%s",k,names[k]);
  3154. + else
  3155. + fprintf(stdout,"%-13s",names[k]);
  3156. + for (j=0; j<SIZE_NUM; j++)
  3157. + {
  3158. + if (results[k][j] > 10000 && !mr)
  3159. + fprintf(stdout," %11.2fk",results[k][j]/1e3);
  3160. + else
  3161. + fprintf(stdout,mr ? ":%.2f" : " %11.2f ",results[k][j]);
  3162. + }
  3163. + fprintf(stdout,"\n");
  3164. + }
  3165. +#ifndef OPENSSL_NO_RSA
  3166. + j=1;
  3167. + for (k=0; k<RSA_NUM; k++)
  3168. + {
  3169. + if (!rsa_doit[k]) continue;
  3170. + if (j && !mr)
  3171. + {
  3172. + printf("%18ssign verify sign/s verify/s\n"," ");
  3173. + j=0;
  3174. + }
  3175. + if(mr)
  3176. + fprintf(stdout,"+F2:%u:%u:%f:%f\n",
  3177. + k,rsa_bits[k],rsa_results[k][0],
  3178. + rsa_results[k][1]);
  3179. + else
  3180. + fprintf(stdout,"rsa %4u bits %8.6fs %8.6fs %8.1f %8.1f\n",
  3181. + rsa_bits[k],rsa_results[k][0],rsa_results[k][1],
  3182. + 1.0/rsa_results[k][0],1.0/rsa_results[k][1]);
  3183. + }
  3184. +#endif
  3185. +#ifndef OPENSSL_NO_DSA
  3186. + j=1;
  3187. + for (k=0; k<DSA_NUM; k++)
  3188. + {
  3189. + if (!dsa_doit[k]) continue;
  3190. + if (j && !mr)
  3191. + {
  3192. + printf("%18ssign verify sign/s verify/s\n"," ");
  3193. + j=0;
  3194. + }
  3195. + if(mr)
  3196. + fprintf(stdout,"+F3:%u:%u:%f:%f\n",
  3197. + k,dsa_bits[k],dsa_results[k][0],dsa_results[k][1]);
  3198. + else
  3199. + fprintf(stdout,"dsa %4u bits %8.6fs %8.6fs %8.1f %8.1f\n",
  3200. + dsa_bits[k],dsa_results[k][0],dsa_results[k][1],
  3201. + 1.0/dsa_results[k][0],1.0/dsa_results[k][1]);
  3202. + }
  3203. +#endif
  3204. +#ifndef OPENSSL_NO_ECDSA
  3205. + j=1;
  3206. + for (k=0; k<EC_NUM; k++)
  3207. + {
  3208. + if (!ecdsa_doit[k]) continue;
  3209. + if (j && !mr)
  3210. + {
  3211. + printf("%30ssign verify sign/s verify/s\n"," ");
  3212. + j=0;
  3213. + }
  3214. +
  3215. + if (mr)
  3216. + fprintf(stdout,"+F4:%u:%u:%f:%f\n",
  3217. + k, test_curves_bits[k],
  3218. + ecdsa_results[k][0],ecdsa_results[k][1]);
  3219. + else
  3220. + fprintf(stdout,
  3221. + "%4u bit ecdsa (%s) %8.4fs %8.4fs %8.1f %8.1f\n",
  3222. + test_curves_bits[k],
  3223. + test_curves_names[k],
  3224. + ecdsa_results[k][0],ecdsa_results[k][1],
  3225. + 1.0/ecdsa_results[k][0],1.0/ecdsa_results[k][1]);
  3226. + }
  3227. +#endif
  3228. +
  3229. +
  3230. +#ifndef OPENSSL_NO_ECDH
  3231. + j=1;
  3232. + for (k=0; k<EC_NUM; k++)
  3233. + {
  3234. + if (!ecdh_doit[k]) continue;
  3235. + if (j && !mr)
  3236. + {
  3237. + printf("%30sop op/s\n"," ");
  3238. + j=0;
  3239. + }
  3240. + if (mr)
  3241. + fprintf(stdout,"+F5:%u:%u:%f:%f\n",
  3242. + k, test_curves_bits[k],
  3243. + ecdh_results[k][0], 1.0/ecdh_results[k][0]);
  3244. +
  3245. + else
  3246. + fprintf(stdout,"%4u bit ecdh (%s) %8.4fs %8.1f\n",
  3247. + test_curves_bits[k],
  3248. + test_curves_names[k],
  3249. + ecdh_results[k][0], 1.0/ecdh_results[k][0]);
  3250. + }
  3251. +#endif
  3252. +
  3253. + mret=0;
  3254. +
  3255. +end:
  3256. + //ERR_print_errors(bio_err);
  3257. + if (buf != NULL) /*OPENSSL_*/free(buf);
  3258. + if (buf2 != NULL) /*OPENSSL_*/free(buf2);
  3259. +#ifndef OPENSSL_NO_DSA
  3260. + for (i=0; i<DSA_NUM; i++)
  3261. + if (dsa_key[i] != NULL)
  3262. + DSA_free(dsa_key[i]);
  3263. +#endif
  3264. +
  3265. +#ifndef OPENSSL_NO_ECDSA
  3266. + for (i=0; i<EC_NUM; i++)
  3267. + if (ecdsa[i] != NULL)
  3268. + EC_KEY_free(ecdsa[i]);
  3269. +#endif
  3270. +#ifndef OPENSSL_NO_ECDH
  3271. + for (i=0; i<EC_NUM; i++)
  3272. + {
  3273. + if (ecdh_a[i] != NULL)
  3274. + EC_KEY_free(ecdh_a[i]);
  3275. + if (ecdh_b[i] != NULL)
  3276. + EC_KEY_free(ecdh_b[i]);
  3277. + }
  3278. +#endif
  3279. +
  3280. + //apps_shutdown();
  3281. + //OPENSSL_EXIT(mret);
  3282. + }
  3283. +
  3284. +#ifdef OPENSSL_SYS_NEWLIB
  3285. +#undef SIGALRM
  3286. +#endif
  3287. +
  3288. +static void print_message(const char *s, long num, int length)
  3289. + {
  3290. +#ifdef SIGALRM
  3291. + BIO_printf(bio_err,mr ? "+DT:%s:%d:%d\n"
  3292. + : "Doing %s for %ds on %d size blocks: ",s,SECONDS,length);
  3293. + (void)BIO_flush(bio_err);
  3294. + alarm(SECONDS);
  3295. +#else
  3296. + BIO_printf(bio_err,mr ? "+DN:%s:%ld:%d\n"
  3297. + : "Doing %s %ld times on %d size blocks: ",s,num,length);
  3298. + (void)BIO_flush(bio_err);
  3299. +#endif
  3300. +#ifdef LINT
  3301. + num=num;
  3302. +#endif
  3303. + }
  3304. +
  3305. +static void pkey_print_message(const char *str, const char *str2, long num,
  3306. + int bits, int tm)
  3307. + {
  3308. +#ifdef SIGALRM
  3309. + BIO_printf(bio_err,mr ? "+DTP:%d:%s:%s:%d\n"
  3310. + : "Doing %d bit %s %s's for %ds: ",bits,str,str2,tm);
  3311. + (void)BIO_flush(bio_err);
  3312. + alarm(RSA_SECONDS);
  3313. +#else
  3314. + BIO_printf(bio_err,mr ? "+DNP:%ld:%d:%s:%s\n"
  3315. + : "Doing %ld %d bit %s %s's: ",num,bits,str,str2);
  3316. + (void)BIO_flush(bio_err);
  3317. +#endif
  3318. +#ifdef LINT
  3319. + num=num;
  3320. +#endif
  3321. + }
  3322. +
  3323. +static void print_result(int alg,int run_no,int count,double time_used)
  3324. + {
  3325. + BIO_printf(bio_err,mr ? "+R:%d:%s:%f\n"
  3326. + : "%d %s's in %.2fs\n",count,names[alg],time_used);
  3327. + results[alg][run_no]=((double)count)/time_used*lengths[run_no];
  3328. + }
  3329. +
  3330. +#ifdef HAVE_FORK
  3331. +static char *sstrsep(char **string, const char *delim)
  3332. + {
  3333. + char isdelim[256];
  3334. + char *token = *string;
  3335. +
  3336. + if (**string == 0)
  3337. + return NULL;
  3338. +
  3339. + memset(isdelim, 0, sizeof isdelim);
  3340. + isdelim[0] = 1;
  3341. +
  3342. + while (*delim)
  3343. + {
  3344. + isdelim[(unsigned char)(*delim)] = 1;
  3345. + delim++;
  3346. + }
  3347. +
  3348. + while (!isdelim[(unsigned char)(**string)])
  3349. + {
  3350. + (*string)++;
  3351. + }
  3352. +
  3353. + if (**string)
  3354. + {
  3355. + **string = 0;
  3356. + (*string)++;
  3357. + }
  3358. +
  3359. + return token;
  3360. + }
  3361. +
  3362. +static int do_multi(int multi)
  3363. + {
  3364. + int n;
  3365. + int fd[2];
  3366. + int *fds;
  3367. + static char sep[]=":";
  3368. +
  3369. + fds=malloc(multi*sizeof *fds);
  3370. + for(n=0 ; n < multi ; ++n)
  3371. + {
  3372. + pipe(fd);
  3373. + if(fork())
  3374. + {
  3375. + close(fd[1]);
  3376. + fds[n]=fd[0];
  3377. + }
  3378. + else
  3379. + {
  3380. + close(fd[0]);
  3381. + close(1);
  3382. + dup(fd[1]);
  3383. + close(fd[1]);
  3384. + mr=1;
  3385. + usertime=0;
  3386. + return 0;
  3387. + }
  3388. + printf("Forked child %d\n",n);
  3389. + }
  3390. +
  3391. + /* for now, assume the pipe is long enough to take all the output */
  3392. + for(n=0 ; n < multi ; ++n)
  3393. + {
  3394. + FILE *f;
  3395. + char buf[1024];
  3396. + char *p;
  3397. +
  3398. + f=fdopen(fds[n],"r");
  3399. + while(fgets(buf,sizeof buf,f))
  3400. + {
  3401. + p=strchr(buf,'\n');
  3402. + if(p)
  3403. + *p='\0';
  3404. + if(buf[0] != '+')
  3405. + {
  3406. + fprintf(stderr,"Don't understand line '%s' from child %d\n",
  3407. + buf,n);
  3408. + continue;
  3409. + }
  3410. + printf("Got: %s from %d\n",buf,n);
  3411. + if(!strncmp(buf,"+F:",3))
  3412. + {
  3413. + int alg;
  3414. + int j;
  3415. +
  3416. + p=buf+3;
  3417. + alg=atoi(sstrsep(&p,sep));
  3418. + sstrsep(&p,sep);
  3419. + for(j=0 ; j < SIZE_NUM ; ++j)
  3420. + results[alg][j]+=atof(sstrsep(&p,sep));
  3421. + }
  3422. + else if(!strncmp(buf,"+F2:",4))
  3423. + {
  3424. + int k;
  3425. + double d;
  3426. +
  3427. + p=buf+4;
  3428. + k=atoi(sstrsep(&p,sep));
  3429. + sstrsep(&p,sep);
  3430. +
  3431. + d=atof(sstrsep(&p,sep));
  3432. + if(n)
  3433. + rsa_results[k][0]=1/(1/rsa_results[k][0]+1/d);
  3434. + else
  3435. + rsa_results[k][0]=d;
  3436. +
  3437. + d=atof(sstrsep(&p,sep));
  3438. + if(n)
  3439. + rsa_results[k][1]=1/(1/rsa_results[k][1]+1/d);
  3440. + else
  3441. + rsa_results[k][1]=d;
  3442. + }
  3443. + else if(!strncmp(buf,"+F2:",4))
  3444. + {
  3445. + int k;
  3446. + double d;
  3447. +
  3448. + p=buf+4;
  3449. + k=atoi(sstrsep(&p,sep));
  3450. + sstrsep(&p,sep);
  3451. +
  3452. + d=atof(sstrsep(&p,sep));
  3453. + if(n)
  3454. + rsa_results[k][0]=1/(1/rsa_results[k][0]+1/d);
  3455. + else
  3456. + rsa_results[k][0]=d;
  3457. +
  3458. + d=atof(sstrsep(&p,sep));
  3459. + if(n)
  3460. + rsa_results[k][1]=1/(1/rsa_results[k][1]+1/d);
  3461. + else
  3462. + rsa_results[k][1]=d;
  3463. + }
  3464. + else if(!strncmp(buf,"+F3:",4))
  3465. + {
  3466. + int k;
  3467. + double d;
  3468. +
  3469. + p=buf+4;
  3470. + k=atoi(sstrsep(&p,sep));
  3471. + sstrsep(&p,sep);
  3472. +
  3473. + d=atof(sstrsep(&p,sep));
  3474. + if(n)
  3475. + dsa_results[k][0]=1/(1/dsa_results[k][0]+1/d);
  3476. + else
  3477. + dsa_results[k][0]=d;
  3478. +
  3479. + d=atof(sstrsep(&p,sep));
  3480. + if(n)
  3481. + dsa_results[k][1]=1/(1/dsa_results[k][1]+1/d);
  3482. + else
  3483. + dsa_results[k][1]=d;
  3484. + }
  3485. +#ifndef OPENSSL_NO_ECDSA
  3486. + else if(!strncmp(buf,"+F4:",4))
  3487. + {
  3488. + int k;
  3489. + double d;
  3490. +
  3491. + p=buf+4;
  3492. + k=atoi(sstrsep(&p,sep));
  3493. + sstrsep(&p,sep);
  3494. +
  3495. + d=atof(sstrsep(&p,sep));
  3496. + if(n)
  3497. + ecdsa_results[k][0]=1/(1/ecdsa_results[k][0]+1/d);
  3498. + else
  3499. + ecdsa_results[k][0]=d;
  3500. +
  3501. + d=atof(sstrsep(&p,sep));
  3502. + if(n)
  3503. + ecdsa_results[k][1]=1/(1/ecdsa_results[k][1]+1/d);
  3504. + else
  3505. + ecdsa_results[k][1]=d;
  3506. + }
  3507. +#endif
  3508. +
  3509. +#ifndef OPENSSL_NO_ECDH
  3510. + else if(!strncmp(buf,"+F5:",4))
  3511. + {
  3512. + int k;
  3513. + double d;
  3514. +
  3515. + p=buf+4;
  3516. + k=atoi(sstrsep(&p,sep));
  3517. + sstrsep(&p,sep);
  3518. +
  3519. + d=atof(sstrsep(&p,sep));
  3520. + if(n)
  3521. + ecdh_results[k][0]=1/(1/ecdh_results[k][0]+1/d);
  3522. + else
  3523. + ecdh_results[k][0]=d;
  3524. +
  3525. + }
  3526. +#endif
  3527. +
  3528. + else if(!strncmp(buf,"+H:",3))
  3529. + {
  3530. + }
  3531. + else
  3532. + fprintf(stderr,"Unknown type '%s' from child %d\n",buf,n);
  3533. + }
  3534. + }
  3535. + return 1;
  3536. + }
  3537. +#endif
  3538. +
  3539. +#ifdef __AVR32__
  3540. +#include <avr32/io.h>
  3541. +
  3542. +int _init_startup (){
  3543. +#ifdef __SETUP_OSC__
  3544. + /* Setup OSC0. */
  3545. + AVR32_PM.oscctrl0 = 7;
  3546. +
  3547. + /* Set OSC0 as main clock. */
  3548. + AVR32_PM.mcctrl = ( AVR32_PM_MCCTRL_OSC0EN_MASK |
  3549. + (1 << AVR32_PM_MCCTRL_MCSEL_OFFSET) );
  3550. +#endif
  3551. +
  3552. +#ifdef __AVR32_UC__
  3553. + /* Set flashc master type to last default to save one cycle for
  3554. + each branch. */
  3555. + volatile avr32_hmatrix_scfg_t scfg = AVR32_HMATRIX.SCFG[0];
  3556. + scfg.defmstr_type =
  3557. + AVR32_HMATRIX_DEFMSTR_TYPE_LAST_DEFAULT;
  3558. + AVR32_HMATRIX.SCFG[0] = scfg;
  3559. +
  3560. + /* Set to one waitstate. */
  3561. +#ifdef __FLASH_WS__
  3562. + AVR32_FLASHC.fcr |= AVR32_FLASHC_FCR_FWS_MASK | 0x10000000;
  3563. +#endif
  3564. +#endif
  3565. +}
  3566. +#endif
  3567. +
  3568. Index: openssl-0.9.8g/Configure
  3569. ===================================================================
  3570. --- openssl-0.9.8g.orig/Configure 2008-09-24 11:00:04.000000000 +0200
  3571. +++ openssl-0.9.8g/Configure 2008-09-24 11:01:01.000000000 +0200
  3572. @@ -120,6 +120,7 @@
  3573. my $x86_64_asm="x86_64cpuid.o:x86_64-gcc.o::::md5-x86_64.o:::rc4-x86_64.o::";
  3574. my $ia64_asm=":bn-ia64.o::aes_core.o aes_cbc.o aes-ia64.o:::sha1-ia64.o sha256-ia64.o sha512-ia64.o::rc4-ia64.o::";
  3575. +my $avr32_asm="::asm/des-avr32.o asm/des_cbc.o fcrypt_b.o:aes_core.o aes_cbc.o asm/aes-avr32.o:::::::";
  3576. my $no_asm="::::::::::";
  3577. @@ -170,6 +171,8 @@
  3578. # Basic configs that should work on any (32 and less bit) box
  3579. "gcc", "gcc:-O3::(unknown):::BN_LLONG:::",
  3580. +"avr32-gcc", "avr32-gcc:-mpart=\$(PROCESSOR) -DBN_NO_MUL_COMBA -DBN_NO_SQR_COMBA -DBN_NO_RECURSION -DBN_NO_CONSTTIME -DBN_DIV2W -DDES_CTABLES_IN_DATA -DAES_CTABLES_IN_DATA -DNO_CHMOD -DNO_STRINGS_H -DOPENSSL_NO_DGRAM -DOPENSSL_NO_SOCK -DOPENSSL_SYSNAME_NEWLIB -O3 -fno-common -g -fdata-sections -ffunction-sections -ffast-math::(unknown)::-g -mpart=\${PROCESSOR} -O3 -Wl,--gc-sections,--direct-data:BN_LLONG:${avr32_asm}",
  3581. +"avr32-gcc-size", "avr32-gcc:-mpart=\$(PROCESSOR) -DBN_NO_MUL_COMBA -DBN_NO_SQR_COMBA -DBN_NO_RECURSION -DBN_NO_CONSTTIME -DBN_DIV2W -DNO_CHMOD -DNO_STRINGS_H -DOPENSSL_NO_DGRAM -DOPENSSL_NO_SOCK -DOPENSSL_SYSNAME_NEWLIB -Os -fno-common -g -fdata-sections -ffunction-sections -ffast-math::(unknown)::-Os -g -mrelax -mpart=\$(PROCESSOR) -Wl,--gc-sections,--direct-data:BN_LLONG:${avr32_asm}",
  3582. "cc", "cc:-O::(unknown)::::::",
  3583. ####VOS Configurations
  3584. @@ -319,6 +322,7 @@
  3585. "linux-ia32-icc", "icc:-DL_ENDIAN -DTERMIO -O2 -no_cpprt::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-KPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
  3586. "linux-elf", "gcc:-DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
  3587. "linux-aout", "gcc:-DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -march=i486 -Wall::(unknown):::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_out_asm}",
  3588. +"linux-avr32", "avr32-linux-gcc:-DB_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG BF_PTR:${avr32_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
  3589. ####
  3590. "linux-generic64","gcc:-DTERMIO -O3 -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
  3591. "linux-ppc64", "gcc:-m64 -DB_ENDIAN -DTERMIO -O3 -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_RISC1 DES_UNROLL::linux_ppc64.o::::::::::dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
  3592. @@ -742,6 +746,10 @@
  3593. {
  3594. $prefix=$1;
  3595. }
  3596. + elsif (/^--processor=(.*)$/)
  3597. + {
  3598. + $processor=$1;
  3599. + }
  3600. elsif (/^--openssldir=(.*)$/)
  3601. {
  3602. $openssldir=$1;
  3603. Index: openssl-0.9.8g/crypto/aes/asm/aes-avr32.S
  3604. ===================================================================
  3605. --- /dev/null 1970-01-01 00:00:00.000000000 +0000
  3606. +++ openssl-0.9.8g/crypto/aes/asm/aes-avr32.S 2008-09-24 11:01:01.000000000 +0200
  3607. @@ -0,0 +1,1106 @@
  3608. + .global AES_encrypt
  3609. + .global AES_decrypt
  3610. +
  3611. +
  3612. +/*One Round
  3613. +t0 = Te0[s0 >> 24] ^ Te1[(s1 >> 16) & 0xff] ^ Te2[(s2 >> 8) & 0xff] ^ Te3[s3 & 0xff] ^ rk[ 4];
  3614. +t1 = Te0[s1 >> 24] ^ Te1[(s2 >> 16) & 0xff] ^ Te2[(s3 >> 8) & 0xff] ^ Te3[s0 & 0xff] ^ rk[ 5];
  3615. +t2 = Te0[s2 >> 24] ^ Te1[(s3 >> 16) & 0xff] ^ Te2[(s0 >> 8) & 0xff] ^ Te3[s1 & 0xff] ^ rk[ 6];
  3616. +t3 = Te0[s3 >> 24] ^ Te1[(s0 >> 16) & 0xff] ^ Te2[(s1 >> 8) & 0xff] ^ Te3[s2 & 0xff] ^ rk[ 7] ; */
  3617. +
  3618. +#define AES_MAXNR 14
  3619. +#define TE0 r4
  3620. +#define TE1 r5
  3621. +#define TE2 r6
  3622. +#define TE3 r7
  3623. +#define TD0 r4
  3624. +#define TD1 r5
  3625. +#define TD2 r6
  3626. +#define TD3 r7
  3627. +#define TE4 r4
  3628. +#define TD4 r4
  3629. +
  3630. +#define RK r10
  3631. +#define tmp lr
  3632. +
  3633. + .macro RoundOddEncrypt s0, s1, s2, s3, t0, t1, t2, t3
  3634. +
  3635. + ld.w \t0, TE0[\s0:t << 2]
  3636. + ld.w \t3, TE1[\s0:u << 2]
  3637. + ld.w \t2, TE2[\s0:l << 2]
  3638. + ld.w tmp, RK[16]
  3639. + ld.w \t1, TE3[\s0:b << 2]
  3640. +
  3641. + ld.w \s0, TE1[\s1:u << 2]
  3642. + eor \t0, tmp
  3643. + ld.w tmp, TE2[\s1:l << 2]
  3644. + eor \t0, \s0
  3645. + ld.w \s0, RK[28]
  3646. + eor \t3, tmp
  3647. + ld.w tmp, TE3[\s1:b << 2]
  3648. + eor \t3, \s0
  3649. + ld.w \s0, RK[24]
  3650. + eor \t2, tmp
  3651. + ld.w tmp, TE0[\s1:t << 2]
  3652. + eor \t2, \s0
  3653. + ld.w \s0, RK[20]
  3654. + eor \t1, tmp
  3655. + ld.w tmp, TE2[\s2:l << 2]
  3656. + eor \t1, \s0
  3657. +
  3658. + ld.w \s0, TE3[\s2:b << 2]
  3659. + ld.w \s1, TE0[\s2:t << 2]
  3660. + eor \t0, tmp
  3661. + ld.w tmp, TE1[\s2:u << 2]
  3662. + eor \t3, \s0
  3663. + eor \t2, \s1
  3664. + ld.w \s0, TE3[\s3:b << 2]
  3665. + ld.w \s1, TE0[\s3:t << 2]
  3666. + eor \t1, tmp
  3667. +
  3668. + ld.w \s2, TE1[\s3:u << 2]
  3669. + eor \t0, \s0
  3670. + ld.w tmp, TE2[\s3:l << 2]
  3671. + eor \t3, \s1
  3672. + eor \t2, \s2
  3673. + eor \t1, tmp
  3674. + sub RK, -32
  3675. + .endm
  3676. +
  3677. + .macro RoundEvenEncrypt s0, s1, s2, s3, t0, t1, t2, t3
  3678. +
  3679. + ld.w \t0, TE0[\s0:t << 2]
  3680. + ld.w \t3, TE1[\s0:u << 2]
  3681. + ld.w \t2, TE2[\s0:l << 2]
  3682. + ld.w tmp, RK[0]
  3683. + ld.w \t1, TE3[\s0:b << 2]
  3684. +
  3685. + ld.w \s0, TE1[\s1:u << 2]
  3686. + eor \t0, tmp
  3687. + ld.w tmp, TE2[\s1:l << 2]
  3688. + eor \t0, \s0
  3689. + ld.w \s0, RK[12]
  3690. + eor \t3, tmp
  3691. + ld.w tmp, TE3[\s1:b << 2]
  3692. + eor \t3, \s0
  3693. + ld.w \s0, RK[8]
  3694. + eor \t2, tmp
  3695. + ld.w tmp, TE0[\s1:t << 2]
  3696. + eor \t2, \s0
  3697. + ld.w \s0, RK[4]
  3698. + eor \t1, tmp
  3699. + ld.w tmp, TE2[\s2:l << 2]
  3700. + eor \t1, \s0
  3701. +
  3702. + ld.w \s0, TE3[\s2:b << 2]
  3703. + ld.w \s1, TE0[\s2:t << 2]
  3704. + eor \t0, tmp
  3705. + ld.w tmp, TE1[\s2:u << 2]
  3706. + eor \t3, \s0
  3707. + eor \t2, \s1
  3708. + ld.w \s0, TE3[\s3:b << 2]
  3709. + ld.w \s1, TE0[\s3:t << 2]
  3710. + eor \t1, tmp
  3711. +
  3712. + ld.w \s2, TE1[\s3:u << 2]
  3713. + eor \t0, \s0
  3714. + ld.w tmp, TE2[\s3:l << 2]
  3715. + eor \t3, \s1
  3716. + eor \t2, \s2
  3717. + eor \t1, tmp
  3718. + .endm
  3719. +
  3720. + .macro RoundLastEncrypt s0, s1, s2, s3, t0, t1, t2, t3
  3721. +
  3722. + ld.w \t0, TE4[\s0:t << 2]
  3723. + ld.w \t3, TE4[\s0:u << 2]
  3724. + ld.w \t2, TE4[\s0:l << 2]
  3725. + ld.w tmp, RK[0]
  3726. + ld.w \t1, TE4[\s0:b << 2]
  3727. + andh \t0, 0xFF00, COH
  3728. + andh \t3, 0x00FF, COH
  3729. + andl \t2, 0xFF00, COH
  3730. + andl \t1, 0x00FF, COH
  3731. +
  3732. + ld.w \s0, TE4[\s1:u << 2]
  3733. + eor \t0, tmp
  3734. + ld.w tmp, TE4[\s1:l << 2]
  3735. + andh \s0, 0x00FF, COH
  3736. + eor \t0, \s0
  3737. + ld.w \s0, RK[12]
  3738. + andl tmp, 0xFF00, COH
  3739. + eor \t3, tmp
  3740. + ld.w tmp, TE4[\s1:b << 2]
  3741. + eor \t3, \s0
  3742. + ld.w \s0, RK[8]
  3743. + andl tmp, 0x00FF, COH
  3744. + eor \t2, tmp
  3745. + ld.w tmp, TE4[\s1:t << 2]
  3746. + eor \t2, \s0
  3747. + ld.w \s0, RK[4]
  3748. + andh tmp, 0xFF00, COH
  3749. + eor \t1, tmp
  3750. + ld.w tmp, TE4[\s2:l << 2]
  3751. + eor \t1, \s0
  3752. +
  3753. + ld.w \s0, TE4[\s2:b << 2]
  3754. + ld.w \s1, TE4[\s2:t << 2]
  3755. +
  3756. + andl tmp, 0xFF00, COH
  3757. + eor \t0, tmp
  3758. + ld.w tmp, TE4[\s2:u << 2]
  3759. + andl \s0, 0x00FF, COH
  3760. + eor \t3, \s0
  3761. + andh \s1, 0xFF00, COH
  3762. + eor \t2, \s1
  3763. + ld.w \s0, TE4[\s3:b << 2]
  3764. + ld.w \s1, TE4[\s3:t << 2]
  3765. + andh tmp, 0x00FF, COH
  3766. + eor \t1, tmp
  3767. +
  3768. + ld.w \s2, TE4[\s3:u << 2]
  3769. + andl \s0, 0x00FF, COH
  3770. + eor \t0, \s0
  3771. + ld.w tmp, TE4[\s3:l << 2]
  3772. + andh \s1, 0xFF00, COH
  3773. + eor \t3, \s1
  3774. + andh \s2, 0x00FF, COH
  3775. + eor \t2, \s2
  3776. + andl tmp, 0xFF00, COH
  3777. + eor \t1, tmp
  3778. + .endm
  3779. +
  3780. + .macro RoundOddDecrypt s0, s1, s2, s3, t0, t1, t2, t3
  3781. +
  3782. + ld.w \t0, TD0[\s0:t << 2]
  3783. + ld.w \t3, TD3[\s0:b << 2]
  3784. + ld.w \t2, TD2[\s0:l << 2]
  3785. + ld.w tmp, RK[16]
  3786. + ld.w \t1, TD1[\s0:u << 2]
  3787. +
  3788. + ld.w \s0, TD3[\s1:b << 2]
  3789. + eor \t0, tmp
  3790. + ld.w tmp, TD2[\s1:l << 2]
  3791. + eor \t0, \s0
  3792. + ld.w \s0, RK[28]
  3793. + eor \t3, tmp
  3794. + ld.w tmp, TD1[\s1:u << 2]
  3795. + eor \t3, \s0
  3796. + ld.w \s0, RK[24]
  3797. + eor \t2, tmp
  3798. + ld.w tmp, TD0[\s1:t << 2]
  3799. + eor \t2, \s0
  3800. + ld.w \s0, RK[20]
  3801. + eor \t1, tmp
  3802. + ld.w tmp, TD2[\s2:l << 2]
  3803. + eor \t1, \s0
  3804. +
  3805. + ld.w \s0, TD1[\s2:u << 2]
  3806. + ld.w \s1, TD0[\s2:t << 2]
  3807. + eor \t0, tmp
  3808. + ld.w tmp, TD3[\s2:b << 2]
  3809. + eor \t3, \s0
  3810. + eor \t2, \s1
  3811. + ld.w \s0, TD1[\s3:u << 2]
  3812. + ld.w \s1, TD0[\s3:t << 2]
  3813. + eor \t1, tmp
  3814. +
  3815. + ld.w \s2, TD3[\s3:b << 2]
  3816. + eor \t0, \s0
  3817. + ld.w tmp, TD2[\s3:l << 2]
  3818. + eor \t3, \s1
  3819. + eor \t2, \s2
  3820. + eor \t1, tmp
  3821. + sub RK, -32
  3822. + .endm
  3823. +
  3824. + .macro RoundEvenDecrypt s0, s1, s2, s3, t0, t1, t2, t3
  3825. +
  3826. + ld.w \t0, TD0[\s0:t << 2]
  3827. + ld.w \t3, TD3[\s0:b << 2]
  3828. + ld.w \t2, TD2[\s0:l << 2]
  3829. + ld.w tmp, RK[0]
  3830. + ld.w \t1, TD1[\s0:u << 2]
  3831. +
  3832. + ld.w \s0, TD3[\s1:b << 2]
  3833. + eor \t0, tmp
  3834. + ld.w tmp, TD2[\s1:l << 2]
  3835. + eor \t0, \s0
  3836. + ld.w \s0, RK[12]
  3837. + eor \t3, tmp
  3838. + ld.w tmp, TD1[\s1:u << 2]
  3839. + eor \t3, \s0
  3840. + ld.w \s0, RK[8]
  3841. + eor \t2, tmp
  3842. + ld.w tmp, TD0[\s1:t << 2]
  3843. + eor \t2, \s0
  3844. + ld.w \s0, RK[4]
  3845. + eor \t1, tmp
  3846. + ld.w tmp, TD2[\s2:l << 2]
  3847. + eor \t1, \s0
  3848. +
  3849. + ld.w \s0, TD1[\s2:u << 2]
  3850. + ld.w \s1, TD0[\s2:t << 2]
  3851. + eor \t0, tmp
  3852. + ld.w tmp, TD3[\s2:b << 2]
  3853. + eor \t3, \s0
  3854. + eor \t2, \s1
  3855. + ld.w \s0, TD1[\s3:u << 2]
  3856. + ld.w \s1, TD0[\s3:t << 2]
  3857. + eor \t1, tmp
  3858. +
  3859. + ld.w \s2, TD3[\s3:b << 2]
  3860. + eor \t0, \s0
  3861. + ld.w tmp, TD2[\s3:l << 2]
  3862. + eor \t3, \s1
  3863. + eor \t2, \s2
  3864. + eor \t1, tmp
  3865. + .endm
  3866. +
  3867. + .macro RoundLastDecrypt s0, s1, s2, s3, t0, t1, t2, t3
  3868. +
  3869. + ld.w \t0, TD4[\s0:t << 2]
  3870. + ld.w \t3, TD4[\s0:b << 2]
  3871. + ld.w \t2, TD4[\s0:l << 2]
  3872. + ld.w tmp, RK[0]
  3873. + ld.w \t1, TD4[\s0:u << 2]
  3874. + andh \t0, 0xFF00, COH
  3875. + andl \t3, 0x00FF, COH
  3876. + andl \t2, 0xFF00, COH
  3877. + andh \t1, 0x00FF, COH
  3878. +
  3879. + ld.w \s0, TD4[\s1:b << 2]
  3880. + eor \t0, tmp
  3881. + ld.w tmp, TD4[\s1:l << 2]
  3882. + andl \s0, 0x00FF, COH
  3883. + eor \t0, \s0
  3884. + ld.w \s0, RK[12]
  3885. + andl tmp, 0xFF00, COH
  3886. + eor \t3, tmp
  3887. + ld.w tmp, TD4[\s1:u << 2]
  3888. + eor \t3, \s0
  3889. + ld.w \s0, RK[8]
  3890. + andh tmp, 0x00FF, COH
  3891. + eor \t2, tmp
  3892. + ld.w tmp, TD4[\s1:t << 2]
  3893. + eor \t2, \s0
  3894. + ld.w \s0, RK[4]
  3895. + andh tmp, 0xFF00, COH
  3896. + eor \t1, tmp
  3897. + ld.w tmp, TD4[\s2:l << 2]
  3898. + eor \t1, \s0
  3899. +
  3900. + ld.w \s0, TD4[\s2:u << 2]
  3901. + ld.w \s1, TD4[\s2:t << 2]
  3902. +
  3903. + andl tmp, 0xFF00, COH
  3904. + eor \t0, tmp
  3905. + ld.w tmp, TD4[\s2:b << 2]
  3906. + andh \s0, 0x00FF, COH
  3907. + eor \t3, \s0
  3908. + andh \s1, 0xFF00, COH
  3909. + eor \t2, \s1
  3910. + ld.w \s0, TD4[\s3:u << 2]
  3911. + ld.w \s1, TD4[\s3:t << 2]
  3912. + andl tmp, 0x00FF, COH
  3913. + eor \t1, tmp
  3914. +
  3915. + ld.w \s2, TD4[\s3:b << 2]
  3916. + andh \s0, 0x00FF, COH
  3917. + eor \t0, \s0
  3918. + ld.w tmp, TD4[\s3:l << 2]
  3919. + andh \s1, 0xFF00, COH
  3920. + eor \t3, \s1
  3921. + andl \s2, 0x00FF, COH
  3922. + eor \t2, \s2
  3923. + andl tmp, 0xFF00, COH
  3924. + eor \t1, tmp
  3925. + .endm
  3926. +
  3927. +
  3928. + .text
  3929. + .align 2
  3930. +/* void AES_encrypt(const unsigned char *in, unsigned char *out, const AES_KEY *key) */
  3931. +AES_encrypt:
  3932. + pushm r0-r3, r4-r7, lr
  3933. +
  3934. +/* s0 = GETU32(pt ) ^ rk[0];
  3935. + s1 = GETU32(pt + 4) ^ rk[1];
  3936. + s2 = GETU32(pt + 8) ^ rk[2];
  3937. + \s3 = GETU32(pt + 12) ^ rk[3]; */
  3938. + ldm RK, r0-r3
  3939. + lda.w TE0, AES_Te0
  3940. + ld.w lr, r12[0]
  3941. + lda.w TE1, AES_Te1
  3942. + eor r3, lr // r3 = *pt ^ rk[0]
  3943. + ld.w lr, r12[4]
  3944. + lda.w TE2, AES_Te2
  3945. + eor r2, lr // r2 = *(pt + 4) ^ rk[1]
  3946. + ld.w lr, r12[8]
  3947. + lda.w TE3, AES_Te3
  3948. + eor r1, lr // r1 = *(pt + 8) ^ rk[2]
  3949. + ld.w lr, r12[12]
  3950. +
  3951. + ld.w r9, RK[4*4*(AES_MAXNR+1)]
  3952. + st.w --sp, r11
  3953. + eor r0, lr // r0 = *(pt + 12) ^ rk[3]
  3954. + lsr r9, 1
  3955. + st.w --sp, r9
  3956. +
  3957. +encryption_rounds:
  3958. + RoundOddEncrypt r3, r2, r1, r0, r8, r9, r11, r12
  3959. + ld.w lr, sp[0]
  3960. + sub lr, 1
  3961. + st.w sp[0], lr
  3962. + breq last_encryption_round
  3963. + RoundEvenEncrypt r8, r9, r11, r12, r3, r2, r1, r0
  3964. + rjmp encryption_rounds
  3965. +
  3966. +last_encryption_round:
  3967. + lda.w TE4, AES_Te4
  3968. + RoundLastEncrypt r8, r9, r11, r12, r3, r2, r1, r0
  3969. + ld.w lr, sp[4] // lr = out
  3970. + sub sp, -8
  3971. + stm lr, r0-r3
  3972. + popm r0-r3, r4-r7, pc
  3973. +
  3974. +
  3975. +/* void AES_decrypt(const unsigned char *in, unsigned char *out, const AES_KEY *key) */
  3976. +AES_decrypt:
  3977. + pushm r0-r3, r4-r7, lr
  3978. +
  3979. +/* s0 = GETU32(pt ) ^ rk[0];
  3980. + s1 = GETU32(pt + 4) ^ rk[1];
  3981. + s2 = GETU32(pt + 8) ^ rk[2];
  3982. + s3 = GETU32(pt + 12) ^ rk[3];*/
  3983. + ldm RK, r0-r3
  3984. + lda.w TD0, AES_Td0
  3985. + ld.w lr, r12[0]
  3986. + lda.w TD1, AES_Td1
  3987. + eor r3, lr // r3 = *ct ^ rk[0]
  3988. + ld.w lr, r12[4]
  3989. + lda.w TD2, AES_Td2
  3990. + eor r2, lr // r2 = *(ct + 4) ^ rk[1]
  3991. + ld.w lr, r12[8]
  3992. + lda.w TD3, AES_Td3
  3993. + eor r1, r1, lr << 0 // r1 = *(ct + 8) ^ rk[2]
  3994. + ld.w lr, r12[12]
  3995. +
  3996. + ld.w r9, RK[4*4*(AES_MAXNR+1)]
  3997. + st.w --sp, r11
  3998. + eor r0, lr // r0 = *(ct + 12) ^ rk[3]
  3999. + lsr r9, 1
  4000. + st.w --sp, r9
  4001. +
  4002. +decryption_rounds:
  4003. + RoundOddDecrypt r3, r2, r1, r0, r8, r9, r11, r12
  4004. + ld.w lr, sp[0]
  4005. + sub lr, 1
  4006. + st.w sp[0], lr
  4007. + breq last_decryption_round
  4008. + RoundEvenDecrypt r8, r9, r11, r12, r3, r2, r1, r0
  4009. + rjmp decryption_rounds
  4010. +
  4011. +last_decryption_round:
  4012. + lda.w TD4, AES_Td4
  4013. + RoundLastDecrypt r8, r9, r11, r12, r3, r2, r1, r0
  4014. + ld.w lr, sp[4] // lr = out
  4015. + sub sp, -8
  4016. + stm lr, r0-r3
  4017. + popm r0-r3, r4-r7, pc
  4018. +
  4019. +
  4020. +#ifdef AES_CTABLES_IN_DATA
  4021. + .data
  4022. +#endif
  4023. + .align 2
  4024. + .global AES_Te0
  4025. + .type AES_Te0,@object
  4026. + .size AES_Te0, 1024
  4027. +AES_Te0:
  4028. + .word 0xc66363a5, 0xf87c7c84, 0xee777799, 0xf67b7b8d
  4029. + .word 0xfff2f20d, 0xd66b6bbd, 0xde6f6fb1, 0x91c5c554
  4030. + .word 0x60303050, 0x02010103, 0xce6767a9, 0x562b2b7d
  4031. + .word 0xe7fefe19, 0xb5d7d762, 0x4dababe6, 0xec76769a
  4032. + .word 0x8fcaca45, 0x1f82829d, 0x89c9c940, 0xfa7d7d87
  4033. + .word 0xeffafa15, 0xb25959eb, 0x8e4747c9, 0xfbf0f00b
  4034. + .word 0x41adadec, 0xb3d4d467, 0x5fa2a2fd, 0x45afafea
  4035. + .word 0x239c9cbf, 0x53a4a4f7, 0xe4727296, 0x9bc0c05b
  4036. + .word 0x75b7b7c2, 0xe1fdfd1c, 0x3d9393ae, 0x4c26266a
  4037. + .word 0x6c36365a, 0x7e3f3f41, 0xf5f7f702, 0x83cccc4f
  4038. + .word 0x6834345c, 0x51a5a5f4, 0xd1e5e534, 0xf9f1f108
  4039. + .word 0xe2717193, 0xabd8d873, 0x62313153, 0x2a15153f
  4040. + .word 0x0804040c, 0x95c7c752, 0x46232365, 0x9dc3c35e
  4041. + .word 0x30181828, 0x379696a1, 0x0a05050f, 0x2f9a9ab5
  4042. + .word 0x0e070709, 0x24121236, 0x1b80809b, 0xdfe2e23d
  4043. + .word 0xcdebeb26, 0x4e272769, 0x7fb2b2cd, 0xea75759f
  4044. + .word 0x1209091b, 0x1d83839e, 0x582c2c74, 0x341a1a2e
  4045. + .word 0x361b1b2d, 0xdc6e6eb2, 0xb45a5aee, 0x5ba0a0fb
  4046. + .word 0xa45252f6, 0x763b3b4d, 0xb7d6d661, 0x7db3b3ce
  4047. + .word 0x5229297b, 0xdde3e33e, 0x5e2f2f71, 0x13848497
  4048. + .word 0xa65353f5, 0xb9d1d168, 0x00000000, 0xc1eded2c
  4049. + .word 0x40202060, 0xe3fcfc1f, 0x79b1b1c8, 0xb65b5bed
  4050. + .word 0xd46a6abe, 0x8dcbcb46, 0x67bebed9, 0x7239394b
  4051. + .word 0x944a4ade, 0x984c4cd4, 0xb05858e8, 0x85cfcf4a
  4052. + .word 0xbbd0d06b, 0xc5efef2a, 0x4faaaae5, 0xedfbfb16
  4053. + .word 0x864343c5, 0x9a4d4dd7, 0x66333355, 0x11858594
  4054. + .word 0x8a4545cf, 0xe9f9f910, 0x04020206, 0xfe7f7f81
  4055. + .word 0xa05050f0, 0x783c3c44, 0x259f9fba, 0x4ba8a8e3
  4056. + .word 0xa25151f3, 0x5da3a3fe, 0x804040c0, 0x058f8f8a
  4057. + .word 0x3f9292ad, 0x219d9dbc, 0x70383848, 0xf1f5f504
  4058. + .word 0x63bcbcdf, 0x77b6b6c1, 0xafdada75, 0x42212163
  4059. + .word 0x20101030, 0xe5ffff1a, 0xfdf3f30e, 0xbfd2d26d
  4060. + .word 0x81cdcd4c, 0x180c0c14, 0x26131335, 0xc3ecec2f
  4061. + .word 0xbe5f5fe1, 0x359797a2, 0x884444cc, 0x2e171739
  4062. + .word 0x93c4c457, 0x55a7a7f2, 0xfc7e7e82, 0x7a3d3d47
  4063. + .word 0xc86464ac, 0xba5d5de7, 0x3219192b, 0xe6737395
  4064. + .word 0xc06060a0, 0x19818198, 0x9e4f4fd1, 0xa3dcdc7f
  4065. + .word 0x44222266, 0x542a2a7e, 0x3b9090ab, 0x0b888883
  4066. + .word 0x8c4646ca, 0xc7eeee29, 0x6bb8b8d3, 0x2814143c
  4067. + .word 0xa7dede79, 0xbc5e5ee2, 0x160b0b1d, 0xaddbdb76
  4068. + .word 0xdbe0e03b, 0x64323256, 0x743a3a4e, 0x140a0a1e
  4069. + .word 0x924949db, 0x0c06060a, 0x4824246c, 0xb85c5ce4
  4070. + .word 0x9fc2c25d, 0xbdd3d36e, 0x43acacef, 0xc46262a6
  4071. + .word 0x399191a8, 0x319595a4, 0xd3e4e437, 0xf279798b
  4072. + .word 0xd5e7e732, 0x8bc8c843, 0x6e373759, 0xda6d6db7
  4073. + .word 0x018d8d8c, 0xb1d5d564, 0x9c4e4ed2, 0x49a9a9e0
  4074. + .word 0xd86c6cb4, 0xac5656fa, 0xf3f4f407, 0xcfeaea25
  4075. + .word 0xca6565af, 0xf47a7a8e, 0x47aeaee9, 0x10080818
  4076. + .word 0x6fbabad5, 0xf0787888, 0x4a25256f, 0x5c2e2e72
  4077. + .word 0x381c1c24, 0x57a6a6f1, 0x73b4b4c7, 0x97c6c651
  4078. + .word 0xcbe8e823, 0xa1dddd7c, 0xe874749c, 0x3e1f1f21
  4079. + .word 0x964b4bdd, 0x61bdbddc, 0x0d8b8b86, 0x0f8a8a85
  4080. + .word 0xe0707090, 0x7c3e3e42, 0x71b5b5c4, 0xcc6666aa
  4081. + .word 0x904848d8, 0x06030305, 0xf7f6f601, 0x1c0e0e12
  4082. + .word 0xc26161a3, 0x6a35355f, 0xae5757f9, 0x69b9b9d0
  4083. + .word 0x17868691, 0x99c1c158, 0x3a1d1d27, 0x279e9eb9
  4084. + .word 0xd9e1e138, 0xebf8f813, 0x2b9898b3, 0x22111133
  4085. + .word 0xd26969bb, 0xa9d9d970, 0x078e8e89, 0x339494a7
  4086. + .word 0x2d9b9bb6, 0x3c1e1e22, 0x15878792, 0xc9e9e920
  4087. + .word 0x87cece49, 0xaa5555ff, 0x50282878, 0xa5dfdf7a
  4088. + .word 0x038c8c8f, 0x59a1a1f8, 0x09898980, 0x1a0d0d17
  4089. + .word 0x65bfbfda, 0xd7e6e631, 0x844242c6, 0xd06868b8
  4090. + .word 0x824141c3, 0x299999b0, 0x5a2d2d77, 0x1e0f0f11
  4091. + .word 0x7bb0b0cb, 0xa85454fc, 0x6dbbbbd6, 0x2c16163a
  4092. +
  4093. + .global AES_Te1
  4094. + .type AES_Te1,@object
  4095. + .size AES_Te1, 1024
  4096. +AES_Te1:
  4097. + .word 0xa5c66363, 0x84f87c7c, 0x99ee7777, 0x8df67b7b
  4098. + .word 0x0dfff2f2, 0xbdd66b6b, 0xb1de6f6f, 0x5491c5c5
  4099. + .word 0x50603030, 0x03020101, 0xa9ce6767, 0x7d562b2b
  4100. + .word 0x19e7fefe, 0x62b5d7d7, 0xe64dabab, 0x9aec7676
  4101. + .word 0x458fcaca, 0x9d1f8282, 0x4089c9c9, 0x87fa7d7d
  4102. + .word 0x15effafa, 0xebb25959, 0xc98e4747, 0x0bfbf0f0
  4103. + .word 0xec41adad, 0x67b3d4d4, 0xfd5fa2a2, 0xea45afaf
  4104. + .word 0xbf239c9c, 0xf753a4a4, 0x96e47272, 0x5b9bc0c0
  4105. + .word 0xc275b7b7, 0x1ce1fdfd, 0xae3d9393, 0x6a4c2626
  4106. + .word 0x5a6c3636, 0x417e3f3f, 0x02f5f7f7, 0x4f83cccc
  4107. + .word 0x5c683434, 0xf451a5a5, 0x34d1e5e5, 0x08f9f1f1
  4108. + .word 0x93e27171, 0x73abd8d8, 0x53623131, 0x3f2a1515
  4109. + .word 0x0c080404, 0x5295c7c7, 0x65462323, 0x5e9dc3c3
  4110. + .word 0x28301818, 0xa1379696, 0x0f0a0505, 0xb52f9a9a
  4111. + .word 0x090e0707, 0x36241212, 0x9b1b8080, 0x3ddfe2e2
  4112. + .word 0x26cdebeb, 0x694e2727, 0xcd7fb2b2, 0x9fea7575
  4113. + .word 0x1b120909, 0x9e1d8383, 0x74582c2c, 0x2e341a1a
  4114. + .word 0x2d361b1b, 0xb2dc6e6e, 0xeeb45a5a, 0xfb5ba0a0
  4115. + .word 0xf6a45252, 0x4d763b3b, 0x61b7d6d6, 0xce7db3b3
  4116. + .word 0x7b522929, 0x3edde3e3, 0x715e2f2f, 0x97138484
  4117. + .word 0xf5a65353, 0x68b9d1d1, 0x00000000, 0x2cc1eded
  4118. + .word 0x60402020, 0x1fe3fcfc, 0xc879b1b1, 0xedb65b5b
  4119. + .word 0xbed46a6a, 0x468dcbcb, 0xd967bebe, 0x4b723939
  4120. + .word 0xde944a4a, 0xd4984c4c, 0xe8b05858, 0x4a85cfcf
  4121. + .word 0x6bbbd0d0, 0x2ac5efef, 0xe54faaaa, 0x16edfbfb
  4122. + .word 0xc5864343, 0xd79a4d4d, 0x55663333, 0x94118585
  4123. + .word 0xcf8a4545, 0x10e9f9f9, 0x06040202, 0x81fe7f7f
  4124. + .word 0xf0a05050, 0x44783c3c, 0xba259f9f, 0xe34ba8a8
  4125. + .word 0xf3a25151, 0xfe5da3a3, 0xc0804040, 0x8a058f8f
  4126. + .word 0xad3f9292, 0xbc219d9d, 0x48703838, 0x04f1f5f5
  4127. + .word 0xdf63bcbc, 0xc177b6b6, 0x75afdada, 0x63422121
  4128. + .word 0x30201010, 0x1ae5ffff, 0x0efdf3f3, 0x6dbfd2d2
  4129. + .word 0x4c81cdcd, 0x14180c0c, 0x35261313, 0x2fc3ecec
  4130. + .word 0xe1be5f5f, 0xa2359797, 0xcc884444, 0x392e1717
  4131. + .word 0x5793c4c4, 0xf255a7a7, 0x82fc7e7e, 0x477a3d3d
  4132. + .word 0xacc86464, 0xe7ba5d5d, 0x2b321919, 0x95e67373
  4133. + .word 0xa0c06060, 0x98198181, 0xd19e4f4f, 0x7fa3dcdc
  4134. + .word 0x66442222, 0x7e542a2a, 0xab3b9090, 0x830b8888
  4135. + .word 0xca8c4646, 0x29c7eeee, 0xd36bb8b8, 0x3c281414
  4136. + .word 0x79a7dede, 0xe2bc5e5e, 0x1d160b0b, 0x76addbdb
  4137. + .word 0x3bdbe0e0, 0x56643232, 0x4e743a3a, 0x1e140a0a
  4138. + .word 0xdb924949, 0x0a0c0606, 0x6c482424, 0xe4b85c5c
  4139. + .word 0x5d9fc2c2, 0x6ebdd3d3, 0xef43acac, 0xa6c46262
  4140. + .word 0xa8399191, 0xa4319595, 0x37d3e4e4, 0x8bf27979
  4141. + .word 0x32d5e7e7, 0x438bc8c8, 0x596e3737, 0xb7da6d6d
  4142. + .word 0x8c018d8d, 0x64b1d5d5, 0xd29c4e4e, 0xe049a9a9
  4143. + .word 0xb4d86c6c, 0xfaac5656, 0x07f3f4f4, 0x25cfeaea
  4144. + .word 0xafca6565, 0x8ef47a7a, 0xe947aeae, 0x18100808
  4145. + .word 0xd56fbaba, 0x88f07878, 0x6f4a2525, 0x725c2e2e
  4146. + .word 0x24381c1c, 0xf157a6a6, 0xc773b4b4, 0x5197c6c6
  4147. + .word 0x23cbe8e8, 0x7ca1dddd, 0x9ce87474, 0x213e1f1f
  4148. + .word 0xdd964b4b, 0xdc61bdbd, 0x860d8b8b, 0x850f8a8a
  4149. + .word 0x90e07070, 0x427c3e3e, 0xc471b5b5, 0xaacc6666
  4150. + .word 0xd8904848, 0x05060303, 0x01f7f6f6, 0x121c0e0e
  4151. + .word 0xa3c26161, 0x5f6a3535, 0xf9ae5757, 0xd069b9b9
  4152. + .word 0x91178686, 0x5899c1c1, 0x273a1d1d, 0xb9279e9e
  4153. + .word 0x38d9e1e1, 0x13ebf8f8, 0xb32b9898, 0x33221111
  4154. + .word 0xbbd26969, 0x70a9d9d9, 0x89078e8e, 0xa7339494
  4155. + .word 0xb62d9b9b, 0x223c1e1e, 0x92158787, 0x20c9e9e9
  4156. + .word 0x4987cece, 0xffaa5555, 0x78502828, 0x7aa5dfdf
  4157. + .word 0x8f038c8c, 0xf859a1a1, 0x80098989, 0x171a0d0d
  4158. + .word 0xda65bfbf, 0x31d7e6e6, 0xc6844242, 0xb8d06868
  4159. + .word 0xc3824141, 0xb0299999, 0x775a2d2d, 0x111e0f0f
  4160. + .word 0xcb7bb0b0, 0xfca85454, 0xd66dbbbb, 0x3a2c1616
  4161. +
  4162. + .global AES_Te2
  4163. + .type AES_Te2,@object
  4164. + .size AES_Te2, 1024
  4165. +AES_Te2:
  4166. + .word 0x63a5c663, 0x7c84f87c, 0x7799ee77, 0x7b8df67b
  4167. + .word 0xf20dfff2, 0x6bbdd66b, 0x6fb1de6f, 0xc55491c5
  4168. + .word 0x30506030, 0x01030201, 0x67a9ce67, 0x2b7d562b
  4169. + .word 0xfe19e7fe, 0xd762b5d7, 0xabe64dab, 0x769aec76
  4170. + .word 0xca458fca, 0x829d1f82, 0xc94089c9, 0x7d87fa7d
  4171. + .word 0xfa15effa, 0x59ebb259, 0x47c98e47, 0xf00bfbf0
  4172. + .word 0xadec41ad, 0xd467b3d4, 0xa2fd5fa2, 0xafea45af
  4173. + .word 0x9cbf239c, 0xa4f753a4, 0x7296e472, 0xc05b9bc0
  4174. + .word 0xb7c275b7, 0xfd1ce1fd, 0x93ae3d93, 0x266a4c26
  4175. + .word 0x365a6c36, 0x3f417e3f, 0xf702f5f7, 0xcc4f83cc
  4176. + .word 0x345c6834, 0xa5f451a5, 0xe534d1e5, 0xf108f9f1
  4177. + .word 0x7193e271, 0xd873abd8, 0x31536231, 0x153f2a15
  4178. + .word 0x040c0804, 0xc75295c7, 0x23654623, 0xc35e9dc3
  4179. + .word 0x18283018, 0x96a13796, 0x050f0a05, 0x9ab52f9a
  4180. + .word 0x07090e07, 0x12362412, 0x809b1b80, 0xe23ddfe2
  4181. + .word 0xeb26cdeb, 0x27694e27, 0xb2cd7fb2, 0x759fea75
  4182. + .word 0x091b1209, 0x839e1d83, 0x2c74582c, 0x1a2e341a
  4183. + .word 0x1b2d361b, 0x6eb2dc6e, 0x5aeeb45a, 0xa0fb5ba0
  4184. + .word 0x52f6a452, 0x3b4d763b, 0xd661b7d6, 0xb3ce7db3
  4185. + .word 0x297b5229, 0xe33edde3, 0x2f715e2f, 0x84971384
  4186. + .word 0x53f5a653, 0xd168b9d1, 0x00000000, 0xed2cc1ed
  4187. + .word 0x20604020, 0xfc1fe3fc, 0xb1c879b1, 0x5bedb65b
  4188. + .word 0x6abed46a, 0xcb468dcb, 0xbed967be, 0x394b7239
  4189. + .word 0x4ade944a, 0x4cd4984c, 0x58e8b058, 0xcf4a85cf
  4190. + .word 0xd06bbbd0, 0xef2ac5ef, 0xaae54faa, 0xfb16edfb
  4191. + .word 0x43c58643, 0x4dd79a4d, 0x33556633, 0x85941185
  4192. + .word 0x45cf8a45, 0xf910e9f9, 0x02060402, 0x7f81fe7f
  4193. + .word 0x50f0a050, 0x3c44783c, 0x9fba259f, 0xa8e34ba8
  4194. + .word 0x51f3a251, 0xa3fe5da3, 0x40c08040, 0x8f8a058f
  4195. + .word 0x92ad3f92, 0x9dbc219d, 0x38487038, 0xf504f1f5
  4196. + .word 0xbcdf63bc, 0xb6c177b6, 0xda75afda, 0x21634221
  4197. + .word 0x10302010, 0xff1ae5ff, 0xf30efdf3, 0xd26dbfd2
  4198. + .word 0xcd4c81cd, 0x0c14180c, 0x13352613, 0xec2fc3ec
  4199. + .word 0x5fe1be5f, 0x97a23597, 0x44cc8844, 0x17392e17
  4200. + .word 0xc45793c4, 0xa7f255a7, 0x7e82fc7e, 0x3d477a3d
  4201. + .word 0x64acc864, 0x5de7ba5d, 0x192b3219, 0x7395e673
  4202. + .word 0x60a0c060, 0x81981981, 0x4fd19e4f, 0xdc7fa3dc
  4203. + .word 0x22664422, 0x2a7e542a, 0x90ab3b90, 0x88830b88
  4204. + .word 0x46ca8c46, 0xee29c7ee, 0xb8d36bb8, 0x143c2814
  4205. + .word 0xde79a7de, 0x5ee2bc5e, 0x0b1d160b, 0xdb76addb
  4206. + .word 0xe03bdbe0, 0x32566432, 0x3a4e743a, 0x0a1e140a
  4207. + .word 0x49db9249, 0x060a0c06, 0x246c4824, 0x5ce4b85c
  4208. + .word 0xc25d9fc2, 0xd36ebdd3, 0xacef43ac, 0x62a6c462
  4209. + .word 0x91a83991, 0x95a43195, 0xe437d3e4, 0x798bf279
  4210. + .word 0xe732d5e7, 0xc8438bc8, 0x37596e37, 0x6db7da6d
  4211. + .word 0x8d8c018d, 0xd564b1d5, 0x4ed29c4e, 0xa9e049a9
  4212. + .word 0x6cb4d86c, 0x56faac56, 0xf407f3f4, 0xea25cfea
  4213. + .word 0x65afca65, 0x7a8ef47a, 0xaee947ae, 0x08181008
  4214. + .word 0xbad56fba, 0x7888f078, 0x256f4a25, 0x2e725c2e
  4215. + .word 0x1c24381c, 0xa6f157a6, 0xb4c773b4, 0xc65197c6
  4216. + .word 0xe823cbe8, 0xdd7ca1dd, 0x749ce874, 0x1f213e1f
  4217. + .word 0x4bdd964b, 0xbddc61bd, 0x8b860d8b, 0x8a850f8a
  4218. + .word 0x7090e070, 0x3e427c3e, 0xb5c471b5, 0x66aacc66
  4219. + .word 0x48d89048, 0x03050603, 0xf601f7f6, 0x0e121c0e
  4220. + .word 0x61a3c261, 0x355f6a35, 0x57f9ae57, 0xb9d069b9
  4221. + .word 0x86911786, 0xc15899c1, 0x1d273a1d, 0x9eb9279e
  4222. + .word 0xe138d9e1, 0xf813ebf8, 0x98b32b98, 0x11332211
  4223. + .word 0x69bbd269, 0xd970a9d9, 0x8e89078e, 0x94a73394
  4224. + .word 0x9bb62d9b, 0x1e223c1e, 0x87921587, 0xe920c9e9
  4225. + .word 0xce4987ce, 0x55ffaa55, 0x28785028, 0xdf7aa5df
  4226. + .word 0x8c8f038c, 0xa1f859a1, 0x89800989, 0x0d171a0d
  4227. + .word 0xbfda65bf, 0xe631d7e6, 0x42c68442, 0x68b8d068
  4228. + .word 0x41c38241, 0x99b02999, 0x2d775a2d, 0x0f111e0f
  4229. + .word 0xb0cb7bb0, 0x54fca854, 0xbbd66dbb, 0x163a2c16
  4230. +
  4231. + .global AES_Te3
  4232. + .type AES_Te3,@object
  4233. + .size AES_Te3, 1024
  4234. +AES_Te3:
  4235. + .word 0x6363a5c6, 0x7c7c84f8, 0x777799ee, 0x7b7b8df6
  4236. + .word 0xf2f20dff, 0x6b6bbdd6, 0x6f6fb1de, 0xc5c55491
  4237. + .word 0x30305060, 0x01010302, 0x6767a9ce, 0x2b2b7d56
  4238. + .word 0xfefe19e7, 0xd7d762b5, 0xababe64d, 0x76769aec
  4239. + .word 0xcaca458f, 0x82829d1f, 0xc9c94089, 0x7d7d87fa
  4240. + .word 0xfafa15ef, 0x5959ebb2, 0x4747c98e, 0xf0f00bfb
  4241. + .word 0xadadec41, 0xd4d467b3, 0xa2a2fd5f, 0xafafea45
  4242. + .word 0x9c9cbf23, 0xa4a4f753, 0x727296e4, 0xc0c05b9b
  4243. + .word 0xb7b7c275, 0xfdfd1ce1, 0x9393ae3d, 0x26266a4c
  4244. + .word 0x36365a6c, 0x3f3f417e, 0xf7f702f5, 0xcccc4f83
  4245. + .word 0x34345c68, 0xa5a5f451, 0xe5e534d1, 0xf1f108f9
  4246. + .word 0x717193e2, 0xd8d873ab, 0x31315362, 0x15153f2a
  4247. + .word 0x04040c08, 0xc7c75295, 0x23236546, 0xc3c35e9d
  4248. + .word 0x18182830, 0x9696a137, 0x05050f0a, 0x9a9ab52f
  4249. + .word 0x0707090e, 0x12123624, 0x80809b1b, 0xe2e23ddf
  4250. + .word 0xebeb26cd, 0x2727694e, 0xb2b2cd7f, 0x75759fea
  4251. + .word 0x09091b12, 0x83839e1d, 0x2c2c7458, 0x1a1a2e34
  4252. + .word 0x1b1b2d36, 0x6e6eb2dc, 0x5a5aeeb4, 0xa0a0fb5b
  4253. + .word 0x5252f6a4, 0x3b3b4d76, 0xd6d661b7, 0xb3b3ce7d
  4254. + .word 0x29297b52, 0xe3e33edd, 0x2f2f715e, 0x84849713
  4255. + .word 0x5353f5a6, 0xd1d168b9, 0x00000000, 0xeded2cc1
  4256. + .word 0x20206040, 0xfcfc1fe3, 0xb1b1c879, 0x5b5bedb6
  4257. + .word 0x6a6abed4, 0xcbcb468d, 0xbebed967, 0x39394b72
  4258. + .word 0x4a4ade94, 0x4c4cd498, 0x5858e8b0, 0xcfcf4a85
  4259. + .word 0xd0d06bbb, 0xefef2ac5, 0xaaaae54f, 0xfbfb16ed
  4260. + .word 0x4343c586, 0x4d4dd79a, 0x33335566, 0x85859411
  4261. + .word 0x4545cf8a, 0xf9f910e9, 0x02020604, 0x7f7f81fe
  4262. + .word 0x5050f0a0, 0x3c3c4478, 0x9f9fba25, 0xa8a8e34b
  4263. + .word 0x5151f3a2, 0xa3a3fe5d, 0x4040c080, 0x8f8f8a05
  4264. + .word 0x9292ad3f, 0x9d9dbc21, 0x38384870, 0xf5f504f1
  4265. + .word 0xbcbcdf63, 0xb6b6c177, 0xdada75af, 0x21216342
  4266. + .word 0x10103020, 0xffff1ae5, 0xf3f30efd, 0xd2d26dbf
  4267. + .word 0xcdcd4c81, 0x0c0c1418, 0x13133526, 0xecec2fc3
  4268. + .word 0x5f5fe1be, 0x9797a235, 0x4444cc88, 0x1717392e
  4269. + .word 0xc4c45793, 0xa7a7f255, 0x7e7e82fc, 0x3d3d477a
  4270. + .word 0x6464acc8, 0x5d5de7ba, 0x19192b32, 0x737395e6
  4271. + .word 0x6060a0c0, 0x81819819, 0x4f4fd19e, 0xdcdc7fa3
  4272. + .word 0x22226644, 0x2a2a7e54, 0x9090ab3b, 0x8888830b
  4273. + .word 0x4646ca8c, 0xeeee29c7, 0xb8b8d36b, 0x14143c28
  4274. + .word 0xdede79a7, 0x5e5ee2bc, 0x0b0b1d16, 0xdbdb76ad
  4275. + .word 0xe0e03bdb, 0x32325664, 0x3a3a4e74, 0x0a0a1e14
  4276. + .word 0x4949db92, 0x06060a0c, 0x24246c48, 0x5c5ce4b8
  4277. + .word 0xc2c25d9f, 0xd3d36ebd, 0xacacef43, 0x6262a6c4
  4278. + .word 0x9191a839, 0x9595a431, 0xe4e437d3, 0x79798bf2
  4279. + .word 0xe7e732d5, 0xc8c8438b, 0x3737596e, 0x6d6db7da
  4280. + .word 0x8d8d8c01, 0xd5d564b1, 0x4e4ed29c, 0xa9a9e049
  4281. + .word 0x6c6cb4d8, 0x5656faac, 0xf4f407f3, 0xeaea25cf
  4282. + .word 0x6565afca, 0x7a7a8ef4, 0xaeaee947, 0x08081810
  4283. + .word 0xbabad56f, 0x787888f0, 0x25256f4a, 0x2e2e725c
  4284. + .word 0x1c1c2438, 0xa6a6f157, 0xb4b4c773, 0xc6c65197
  4285. + .word 0xe8e823cb, 0xdddd7ca1, 0x74749ce8, 0x1f1f213e
  4286. + .word 0x4b4bdd96, 0xbdbddc61, 0x8b8b860d, 0x8a8a850f
  4287. + .word 0x707090e0, 0x3e3e427c, 0xb5b5c471, 0x6666aacc
  4288. + .word 0x4848d890, 0x03030506, 0xf6f601f7, 0x0e0e121c
  4289. + .word 0x6161a3c2, 0x35355f6a, 0x5757f9ae, 0xb9b9d069
  4290. + .word 0x86869117, 0xc1c15899, 0x1d1d273a, 0x9e9eb927
  4291. + .word 0xe1e138d9, 0xf8f813eb, 0x9898b32b, 0x11113322
  4292. + .word 0x6969bbd2, 0xd9d970a9, 0x8e8e8907, 0x9494a733
  4293. + .word 0x9b9bb62d, 0x1e1e223c, 0x87879215, 0xe9e920c9
  4294. + .word 0xcece4987, 0x5555ffaa, 0x28287850, 0xdfdf7aa5
  4295. + .word 0x8c8c8f03, 0xa1a1f859, 0x89898009, 0x0d0d171a
  4296. + .word 0xbfbfda65, 0xe6e631d7, 0x4242c684, 0x6868b8d0
  4297. + .word 0x4141c382, 0x9999b029, 0x2d2d775a, 0x0f0f111e
  4298. + .word 0xb0b0cb7b, 0x5454fca8, 0xbbbbd66d, 0x16163a2c
  4299. +
  4300. + .global AES_Te4
  4301. + .type AES_Te4,@object
  4302. + .size AES_Te4, 1024
  4303. +AES_Te4:
  4304. + .word 0x63636363, 0x7c7c7c7c, 0x77777777, 0x7b7b7b7b
  4305. + .word 0xf2f2f2f2, 0x6b6b6b6b, 0x6f6f6f6f, 0xc5c5c5c5
  4306. + .word 0x30303030, 0x01010101, 0x67676767, 0x2b2b2b2b
  4307. + .word 0xfefefefe, 0xd7d7d7d7, 0xabababab, 0x76767676
  4308. + .word 0xcacacaca, 0x82828282, 0xc9c9c9c9, 0x7d7d7d7d
  4309. + .word 0xfafafafa, 0x59595959, 0x47474747, 0xf0f0f0f0
  4310. + .word 0xadadadad, 0xd4d4d4d4, 0xa2a2a2a2, 0xafafafaf
  4311. + .word 0x9c9c9c9c, 0xa4a4a4a4, 0x72727272, 0xc0c0c0c0
  4312. + .word 0xb7b7b7b7, 0xfdfdfdfd, 0x93939393, 0x26262626
  4313. + .word 0x36363636, 0x3f3f3f3f, 0xf7f7f7f7, 0xcccccccc
  4314. + .word 0x34343434, 0xa5a5a5a5, 0xe5e5e5e5, 0xf1f1f1f1
  4315. + .word 0x71717171, 0xd8d8d8d8, 0x31313131, 0x15151515
  4316. + .word 0x04040404, 0xc7c7c7c7, 0x23232323, 0xc3c3c3c3
  4317. + .word 0x18181818, 0x96969696, 0x05050505, 0x9a9a9a9a
  4318. + .word 0x07070707, 0x12121212, 0x80808080, 0xe2e2e2e2
  4319. + .word 0xebebebeb, 0x27272727, 0xb2b2b2b2, 0x75757575
  4320. + .word 0x09090909, 0x83838383, 0x2c2c2c2c, 0x1a1a1a1a
  4321. + .word 0x1b1b1b1b, 0x6e6e6e6e, 0x5a5a5a5a, 0xa0a0a0a0
  4322. + .word 0x52525252, 0x3b3b3b3b, 0xd6d6d6d6, 0xb3b3b3b3
  4323. + .word 0x29292929, 0xe3e3e3e3, 0x2f2f2f2f, 0x84848484
  4324. + .word 0x53535353, 0xd1d1d1d1, 0x00000000, 0xedededed
  4325. + .word 0x20202020, 0xfcfcfcfc, 0xb1b1b1b1, 0x5b5b5b5b
  4326. + .word 0x6a6a6a6a, 0xcbcbcbcb, 0xbebebebe, 0x39393939
  4327. + .word 0x4a4a4a4a, 0x4c4c4c4c, 0x58585858, 0xcfcfcfcf
  4328. + .word 0xd0d0d0d0, 0xefefefef, 0xaaaaaaaa, 0xfbfbfbfb
  4329. + .word 0x43434343, 0x4d4d4d4d, 0x33333333, 0x85858585
  4330. + .word 0x45454545, 0xf9f9f9f9, 0x02020202, 0x7f7f7f7f
  4331. + .word 0x50505050, 0x3c3c3c3c, 0x9f9f9f9f, 0xa8a8a8a8
  4332. + .word 0x51515151, 0xa3a3a3a3, 0x40404040, 0x8f8f8f8f
  4333. + .word 0x92929292, 0x9d9d9d9d, 0x38383838, 0xf5f5f5f5
  4334. + .word 0xbcbcbcbc, 0xb6b6b6b6, 0xdadadada, 0x21212121
  4335. + .word 0x10101010, 0xffffffff, 0xf3f3f3f3, 0xd2d2d2d2
  4336. + .word 0xcdcdcdcd, 0x0c0c0c0c, 0x13131313, 0xecececec
  4337. + .word 0x5f5f5f5f, 0x97979797, 0x44444444, 0x17171717
  4338. + .word 0xc4c4c4c4, 0xa7a7a7a7, 0x7e7e7e7e, 0x3d3d3d3d
  4339. + .word 0x64646464, 0x5d5d5d5d, 0x19191919, 0x73737373
  4340. + .word 0x60606060, 0x81818181, 0x4f4f4f4f, 0xdcdcdcdc
  4341. + .word 0x22222222, 0x2a2a2a2a, 0x90909090, 0x88888888
  4342. + .word 0x46464646, 0xeeeeeeee, 0xb8b8b8b8, 0x14141414
  4343. + .word 0xdededede, 0x5e5e5e5e, 0x0b0b0b0b, 0xdbdbdbdb
  4344. + .word 0xe0e0e0e0, 0x32323232, 0x3a3a3a3a, 0x0a0a0a0a
  4345. + .word 0x49494949, 0x06060606, 0x24242424, 0x5c5c5c5c
  4346. + .word 0xc2c2c2c2, 0xd3d3d3d3, 0xacacacac, 0x62626262
  4347. + .word 0x91919191, 0x95959595, 0xe4e4e4e4, 0x79797979
  4348. + .word 0xe7e7e7e7, 0xc8c8c8c8, 0x37373737, 0x6d6d6d6d
  4349. + .word 0x8d8d8d8d, 0xd5d5d5d5, 0x4e4e4e4e, 0xa9a9a9a9
  4350. + .word 0x6c6c6c6c, 0x56565656, 0xf4f4f4f4, 0xeaeaeaea
  4351. + .word 0x65656565, 0x7a7a7a7a, 0xaeaeaeae, 0x08080808
  4352. + .word 0xbabababa, 0x78787878, 0x25252525, 0x2e2e2e2e
  4353. + .word 0x1c1c1c1c, 0xa6a6a6a6, 0xb4b4b4b4, 0xc6c6c6c6
  4354. + .word 0xe8e8e8e8, 0xdddddddd, 0x74747474, 0x1f1f1f1f
  4355. + .word 0x4b4b4b4b, 0xbdbdbdbd, 0x8b8b8b8b, 0x8a8a8a8a
  4356. + .word 0x70707070, 0x3e3e3e3e, 0xb5b5b5b5, 0x66666666
  4357. + .word 0x48484848, 0x03030303, 0xf6f6f6f6, 0x0e0e0e0e
  4358. + .word 0x61616161, 0x35353535, 0x57575757, 0xb9b9b9b9
  4359. + .word 0x86868686, 0xc1c1c1c1, 0x1d1d1d1d, 0x9e9e9e9e
  4360. + .word 0xe1e1e1e1, 0xf8f8f8f8, 0x98989898, 0x11111111
  4361. + .word 0x69696969, 0xd9d9d9d9, 0x8e8e8e8e, 0x94949494
  4362. + .word 0x9b9b9b9b, 0x1e1e1e1e, 0x87878787, 0xe9e9e9e9
  4363. + .word 0xcececece, 0x55555555, 0x28282828, 0xdfdfdfdf
  4364. + .word 0x8c8c8c8c, 0xa1a1a1a1, 0x89898989, 0x0d0d0d0d
  4365. + .word 0xbfbfbfbf, 0xe6e6e6e6, 0x42424242, 0x68686868
  4366. + .word 0x41414141, 0x99999999, 0x2d2d2d2d, 0x0f0f0f0f
  4367. + .word 0xb0b0b0b0, 0x54545454, 0xbbbbbbbb, 0x16161616
  4368. +
  4369. + .global AES_Td0
  4370. + .type AES_Td0,@object
  4371. + .size AES_Td0, 1024
  4372. +AES_Td0:
  4373. + .word 0x51f4a750, 0x7e416553, 0x1a17a4c3, 0x3a275e96
  4374. + .word 0x3bab6bcb, 0x1f9d45f1, 0xacfa58ab, 0x4be30393
  4375. + .word 0x2030fa55, 0xad766df6, 0x88cc7691, 0xf5024c25
  4376. + .word 0x4fe5d7fc, 0xc52acbd7, 0x26354480, 0xb562a38f
  4377. + .word 0xdeb15a49, 0x25ba1b67, 0x45ea0e98, 0x5dfec0e1
  4378. + .word 0xc32f7502, 0x814cf012, 0x8d4697a3, 0x6bd3f9c6
  4379. + .word 0x038f5fe7, 0x15929c95, 0xbf6d7aeb, 0x955259da
  4380. + .word 0xd4be832d, 0x587421d3, 0x49e06929, 0x8ec9c844
  4381. + .word 0x75c2896a, 0xf48e7978, 0x99583e6b, 0x27b971dd
  4382. + .word 0xbee14fb6, 0xf088ad17, 0xc920ac66, 0x7dce3ab4
  4383. + .word 0x63df4a18, 0xe51a3182, 0x97513360, 0x62537f45
  4384. + .word 0xb16477e0, 0xbb6bae84, 0xfe81a01c, 0xf9082b94
  4385. + .word 0x70486858, 0x8f45fd19, 0x94de6c87, 0x527bf8b7
  4386. + .word 0xab73d323, 0x724b02e2, 0xe31f8f57, 0x6655ab2a
  4387. + .word 0xb2eb2807, 0x2fb5c203, 0x86c57b9a, 0xd33708a5
  4388. + .word 0x302887f2, 0x23bfa5b2, 0x02036aba, 0xed16825c
  4389. + .word 0x8acf1c2b, 0xa779b492, 0xf307f2f0, 0x4e69e2a1
  4390. + .word 0x65daf4cd, 0x0605bed5, 0xd134621f, 0xc4a6fe8a
  4391. + .word 0x342e539d, 0xa2f355a0, 0x058ae132, 0xa4f6eb75
  4392. + .word 0x0b83ec39, 0x4060efaa, 0x5e719f06, 0xbd6e1051
  4393. + .word 0x3e218af9, 0x96dd063d, 0xdd3e05ae, 0x4de6bd46
  4394. + .word 0x91548db5, 0x71c45d05, 0x0406d46f, 0x605015ff
  4395. + .word 0x1998fb24, 0xd6bde997, 0x894043cc, 0x67d99e77
  4396. + .word 0xb0e842bd, 0x07898b88, 0xe7195b38, 0x79c8eedb
  4397. + .word 0xa17c0a47, 0x7c420fe9, 0xf8841ec9, 0x00000000
  4398. + .word 0x09808683, 0x322bed48, 0x1e1170ac, 0x6c5a724e
  4399. + .word 0xfd0efffb, 0x0f853856, 0x3daed51e, 0x362d3927
  4400. + .word 0x0a0fd964, 0x685ca621, 0x9b5b54d1, 0x24362e3a
  4401. + .word 0x0c0a67b1, 0x9357e70f, 0xb4ee96d2, 0x1b9b919e
  4402. + .word 0x80c0c54f, 0x61dc20a2, 0x5a774b69, 0x1c121a16
  4403. + .word 0xe293ba0a, 0xc0a02ae5, 0x3c22e043, 0x121b171d
  4404. + .word 0x0e090d0b, 0xf28bc7ad, 0x2db6a8b9, 0x141ea9c8
  4405. + .word 0x57f11985, 0xaf75074c, 0xee99ddbb, 0xa37f60fd
  4406. + .word 0xf701269f, 0x5c72f5bc, 0x44663bc5, 0x5bfb7e34
  4407. + .word 0x8b432976, 0xcb23c6dc, 0xb6edfc68, 0xb8e4f163
  4408. + .word 0xd731dcca, 0x42638510, 0x13972240, 0x84c61120
  4409. + .word 0x854a247d, 0xd2bb3df8, 0xaef93211, 0xc729a16d
  4410. + .word 0x1d9e2f4b, 0xdcb230f3, 0x0d8652ec, 0x77c1e3d0
  4411. + .word 0x2bb3166c, 0xa970b999, 0x119448fa, 0x47e96422
  4412. + .word 0xa8fc8cc4, 0xa0f03f1a, 0x567d2cd8, 0x223390ef
  4413. + .word 0x87494ec7, 0xd938d1c1, 0x8ccaa2fe, 0x98d40b36
  4414. + .word 0xa6f581cf, 0xa57ade28, 0xdab78e26, 0x3fadbfa4
  4415. + .word 0x2c3a9de4, 0x5078920d, 0x6a5fcc9b, 0x547e4662
  4416. + .word 0xf68d13c2, 0x90d8b8e8, 0x2e39f75e, 0x82c3aff5
  4417. + .word 0x9f5d80be, 0x69d0937c, 0x6fd52da9, 0xcf2512b3
  4418. + .word 0xc8ac993b, 0x10187da7, 0xe89c636e, 0xdb3bbb7b
  4419. + .word 0xcd267809, 0x6e5918f4, 0xec9ab701, 0x834f9aa8
  4420. + .word 0xe6956e65, 0xaaffe67e, 0x21bccf08, 0xef15e8e6
  4421. + .word 0xbae79bd9, 0x4a6f36ce, 0xea9f09d4, 0x29b07cd6
  4422. + .word 0x31a4b2af, 0x2a3f2331, 0xc6a59430, 0x35a266c0
  4423. + .word 0x744ebc37, 0xfc82caa6, 0xe090d0b0, 0x33a7d815
  4424. + .word 0xf104984a, 0x41ecdaf7, 0x7fcd500e, 0x1791f62f
  4425. + .word 0x764dd68d, 0x43efb04d, 0xccaa4d54, 0xe49604df
  4426. + .word 0x9ed1b5e3, 0x4c6a881b, 0xc12c1fb8, 0x4665517f
  4427. + .word 0x9d5eea04, 0x018c355d, 0xfa877473, 0xfb0b412e
  4428. + .word 0xb3671d5a, 0x92dbd252, 0xe9105633, 0x6dd64713
  4429. + .word 0x9ad7618c, 0x37a10c7a, 0x59f8148e, 0xeb133c89
  4430. + .word 0xcea927ee, 0xb761c935, 0xe11ce5ed, 0x7a47b13c
  4431. + .word 0x9cd2df59, 0x55f2733f, 0x1814ce79, 0x73c737bf
  4432. + .word 0x53f7cdea, 0x5ffdaa5b, 0xdf3d6f14, 0x7844db86
  4433. + .word 0xcaaff381, 0xb968c43e, 0x3824342c, 0xc2a3405f
  4434. + .word 0x161dc372, 0xbce2250c, 0x283c498b, 0xff0d9541
  4435. + .word 0x39a80171, 0x080cb3de, 0xd8b4e49c, 0x6456c190
  4436. + .word 0x7bcb8461, 0xd532b670, 0x486c5c74, 0xd0b85742
  4437. +
  4438. + .global AES_Td1
  4439. + .type AES_Td1,@object
  4440. + .size AES_Td1, 1024
  4441. +AES_Td1:
  4442. + .word 0x5051f4a7, 0x537e4165, 0xc31a17a4, 0x963a275e
  4443. + .word 0xcb3bab6b, 0xf11f9d45, 0xabacfa58, 0x934be303
  4444. + .word 0x552030fa, 0xf6ad766d, 0x9188cc76, 0x25f5024c
  4445. + .word 0xfc4fe5d7, 0xd7c52acb, 0x80263544, 0x8fb562a3
  4446. + .word 0x49deb15a, 0x6725ba1b, 0x9845ea0e, 0xe15dfec0
  4447. + .word 0x02c32f75, 0x12814cf0, 0xa38d4697, 0xc66bd3f9
  4448. + .word 0xe7038f5f, 0x9515929c, 0xebbf6d7a, 0xda955259
  4449. + .word 0x2dd4be83, 0xd3587421, 0x2949e069, 0x448ec9c8
  4450. + .word 0x6a75c289, 0x78f48e79, 0x6b99583e, 0xdd27b971
  4451. + .word 0xb6bee14f, 0x17f088ad, 0x66c920ac, 0xb47dce3a
  4452. + .word 0x1863df4a, 0x82e51a31, 0x60975133, 0x4562537f
  4453. + .word 0xe0b16477, 0x84bb6bae, 0x1cfe81a0, 0x94f9082b
  4454. + .word 0x58704868, 0x198f45fd, 0x8794de6c, 0xb7527bf8
  4455. + .word 0x23ab73d3, 0xe2724b02, 0x57e31f8f, 0x2a6655ab
  4456. + .word 0x07b2eb28, 0x032fb5c2, 0x9a86c57b, 0xa5d33708
  4457. + .word 0xf2302887, 0xb223bfa5, 0xba02036a, 0x5ced1682
  4458. + .word 0x2b8acf1c, 0x92a779b4, 0xf0f307f2, 0xa14e69e2
  4459. + .word 0xcd65daf4, 0xd50605be, 0x1fd13462, 0x8ac4a6fe
  4460. + .word 0x9d342e53, 0xa0a2f355, 0x32058ae1, 0x75a4f6eb
  4461. + .word 0x390b83ec, 0xaa4060ef, 0x065e719f, 0x51bd6e10
  4462. + .word 0xf93e218a, 0x3d96dd06, 0xaedd3e05, 0x464de6bd
  4463. + .word 0xb591548d, 0x0571c45d, 0x6f0406d4, 0xff605015
  4464. + .word 0x241998fb, 0x97d6bde9, 0xcc894043, 0x7767d99e
  4465. + .word 0xbdb0e842, 0x8807898b, 0x38e7195b, 0xdb79c8ee
  4466. + .word 0x47a17c0a, 0xe97c420f, 0xc9f8841e, 0x00000000
  4467. + .word 0x83098086, 0x48322bed, 0xac1e1170, 0x4e6c5a72
  4468. + .word 0xfbfd0eff, 0x560f8538, 0x1e3daed5, 0x27362d39
  4469. + .word 0x640a0fd9, 0x21685ca6, 0xd19b5b54, 0x3a24362e
  4470. + .word 0xb10c0a67, 0x0f9357e7, 0xd2b4ee96, 0x9e1b9b91
  4471. + .word 0x4f80c0c5, 0xa261dc20, 0x695a774b, 0x161c121a
  4472. + .word 0x0ae293ba, 0xe5c0a02a, 0x433c22e0, 0x1d121b17
  4473. + .word 0x0b0e090d, 0xadf28bc7, 0xb92db6a8, 0xc8141ea9
  4474. + .word 0x8557f119, 0x4caf7507, 0xbbee99dd, 0xfda37f60
  4475. + .word 0x9ff70126, 0xbc5c72f5, 0xc544663b, 0x345bfb7e
  4476. + .word 0x768b4329, 0xdccb23c6, 0x68b6edfc, 0x63b8e4f1
  4477. + .word 0xcad731dc, 0x10426385, 0x40139722, 0x2084c611
  4478. + .word 0x7d854a24, 0xf8d2bb3d, 0x11aef932, 0x6dc729a1
  4479. + .word 0x4b1d9e2f, 0xf3dcb230, 0xec0d8652, 0xd077c1e3
  4480. + .word 0x6c2bb316, 0x99a970b9, 0xfa119448, 0x2247e964
  4481. + .word 0xc4a8fc8c, 0x1aa0f03f, 0xd8567d2c, 0xef223390
  4482. + .word 0xc787494e, 0xc1d938d1, 0xfe8ccaa2, 0x3698d40b
  4483. + .word 0xcfa6f581, 0x28a57ade, 0x26dab78e, 0xa43fadbf
  4484. + .word 0xe42c3a9d, 0x0d507892, 0x9b6a5fcc, 0x62547e46
  4485. + .word 0xc2f68d13, 0xe890d8b8, 0x5e2e39f7, 0xf582c3af
  4486. + .word 0xbe9f5d80, 0x7c69d093, 0xa96fd52d, 0xb3cf2512
  4487. + .word 0x3bc8ac99, 0xa710187d, 0x6ee89c63, 0x7bdb3bbb
  4488. + .word 0x09cd2678, 0xf46e5918, 0x01ec9ab7, 0xa8834f9a
  4489. + .word 0x65e6956e, 0x7eaaffe6, 0x0821bccf, 0xe6ef15e8
  4490. + .word 0xd9bae79b, 0xce4a6f36, 0xd4ea9f09, 0xd629b07c
  4491. + .word 0xaf31a4b2, 0x312a3f23, 0x30c6a594, 0xc035a266
  4492. + .word 0x37744ebc, 0xa6fc82ca, 0xb0e090d0, 0x1533a7d8
  4493. + .word 0x4af10498, 0xf741ecda, 0x0e7fcd50, 0x2f1791f6
  4494. + .word 0x8d764dd6, 0x4d43efb0, 0x54ccaa4d, 0xdfe49604
  4495. + .word 0xe39ed1b5, 0x1b4c6a88, 0xb8c12c1f, 0x7f466551
  4496. + .word 0x049d5eea, 0x5d018c35, 0x73fa8774, 0x2efb0b41
  4497. + .word 0x5ab3671d, 0x5292dbd2, 0x33e91056, 0x136dd647
  4498. + .word 0x8c9ad761, 0x7a37a10c, 0x8e59f814, 0x89eb133c
  4499. + .word 0xeecea927, 0x35b761c9, 0xede11ce5, 0x3c7a47b1
  4500. + .word 0x599cd2df, 0x3f55f273, 0x791814ce, 0xbf73c737
  4501. + .word 0xea53f7cd, 0x5b5ffdaa, 0x14df3d6f, 0x867844db
  4502. + .word 0x81caaff3, 0x3eb968c4, 0x2c382434, 0x5fc2a340
  4503. + .word 0x72161dc3, 0x0cbce225, 0x8b283c49, 0x41ff0d95
  4504. + .word 0x7139a801, 0xde080cb3, 0x9cd8b4e4, 0x906456c1
  4505. + .word 0x617bcb84, 0x70d532b6, 0x74486c5c, 0x42d0b857
  4506. +
  4507. + .global AES_Td2
  4508. + .type AES_Td2,@object
  4509. + .size AES_Td2, 1024
  4510. +AES_Td2:
  4511. + .word 0xa75051f4, 0x65537e41, 0xa4c31a17, 0x5e963a27
  4512. + .word 0x6bcb3bab, 0x45f11f9d, 0x58abacfa, 0x03934be3
  4513. + .word 0xfa552030, 0x6df6ad76, 0x769188cc, 0x4c25f502
  4514. + .word 0xd7fc4fe5, 0xcbd7c52a, 0x44802635, 0xa38fb562
  4515. + .word 0x5a49deb1, 0x1b6725ba, 0x0e9845ea, 0xc0e15dfe
  4516. + .word 0x7502c32f, 0xf012814c, 0x97a38d46, 0xf9c66bd3
  4517. + .word 0x5fe7038f, 0x9c951592, 0x7aebbf6d, 0x59da9552
  4518. + .word 0x832dd4be, 0x21d35874, 0x692949e0, 0xc8448ec9
  4519. + .word 0x896a75c2, 0x7978f48e, 0x3e6b9958, 0x71dd27b9
  4520. + .word 0x4fb6bee1, 0xad17f088, 0xac66c920, 0x3ab47dce
  4521. + .word 0x4a1863df, 0x3182e51a, 0x33609751, 0x7f456253
  4522. + .word 0x77e0b164, 0xae84bb6b, 0xa01cfe81, 0x2b94f908
  4523. + .word 0x68587048, 0xfd198f45, 0x6c8794de, 0xf8b7527b
  4524. + .word 0xd323ab73, 0x02e2724b, 0x8f57e31f, 0xab2a6655
  4525. + .word 0x2807b2eb, 0xc2032fb5, 0x7b9a86c5, 0x08a5d337
  4526. + .word 0x87f23028, 0xa5b223bf, 0x6aba0203, 0x825ced16
  4527. + .word 0x1c2b8acf, 0xb492a779, 0xf2f0f307, 0xe2a14e69
  4528. + .word 0xf4cd65da, 0xbed50605, 0x621fd134, 0xfe8ac4a6
  4529. + .word 0x539d342e, 0x55a0a2f3, 0xe132058a, 0xeb75a4f6
  4530. + .word 0xec390b83, 0xefaa4060, 0x9f065e71, 0x1051bd6e
  4531. + .word 0x8af93e21, 0x063d96dd, 0x05aedd3e, 0xbd464de6
  4532. + .word 0x8db59154, 0x5d0571c4, 0xd46f0406, 0x15ff6050
  4533. + .word 0xfb241998, 0xe997d6bd, 0x43cc8940, 0x9e7767d9
  4534. + .word 0x42bdb0e8, 0x8b880789, 0x5b38e719, 0xeedb79c8
  4535. + .word 0x0a47a17c, 0x0fe97c42, 0x1ec9f884, 0x00000000
  4536. + .word 0x86830980, 0xed48322b, 0x70ac1e11, 0x724e6c5a
  4537. + .word 0xfffbfd0e, 0x38560f85, 0xd51e3dae, 0x3927362d
  4538. + .word 0xd9640a0f, 0xa621685c, 0x54d19b5b, 0x2e3a2436
  4539. + .word 0x67b10c0a, 0xe70f9357, 0x96d2b4ee, 0x919e1b9b
  4540. + .word 0xc54f80c0, 0x20a261dc, 0x4b695a77, 0x1a161c12
  4541. + .word 0xba0ae293, 0x2ae5c0a0, 0xe0433c22, 0x171d121b
  4542. + .word 0x0d0b0e09, 0xc7adf28b, 0xa8b92db6, 0xa9c8141e
  4543. + .word 0x198557f1, 0x074caf75, 0xddbbee99, 0x60fda37f
  4544. + .word 0x269ff701, 0xf5bc5c72, 0x3bc54466, 0x7e345bfb
  4545. + .word 0x29768b43, 0xc6dccb23, 0xfc68b6ed, 0xf163b8e4
  4546. + .word 0xdccad731, 0x85104263, 0x22401397, 0x112084c6
  4547. + .word 0x247d854a, 0x3df8d2bb, 0x3211aef9, 0xa16dc729
  4548. + .word 0x2f4b1d9e, 0x30f3dcb2, 0x52ec0d86, 0xe3d077c1
  4549. + .word 0x166c2bb3, 0xb999a970, 0x48fa1194, 0x642247e9
  4550. + .word 0x8cc4a8fc, 0x3f1aa0f0, 0x2cd8567d, 0x90ef2233
  4551. + .word 0x4ec78749, 0xd1c1d938, 0xa2fe8cca, 0x0b3698d4
  4552. + .word 0x81cfa6f5, 0xde28a57a, 0x8e26dab7, 0xbfa43fad
  4553. + .word 0x9de42c3a, 0x920d5078, 0xcc9b6a5f, 0x4662547e
  4554. + .word 0x13c2f68d, 0xb8e890d8, 0xf75e2e39, 0xaff582c3
  4555. + .word 0x80be9f5d, 0x937c69d0, 0x2da96fd5, 0x12b3cf25
  4556. + .word 0x993bc8ac, 0x7da71018, 0x636ee89c, 0xbb7bdb3b
  4557. + .word 0x7809cd26, 0x18f46e59, 0xb701ec9a, 0x9aa8834f
  4558. + .word 0x6e65e695, 0xe67eaaff, 0xcf0821bc, 0xe8e6ef15
  4559. + .word 0x9bd9bae7, 0x36ce4a6f, 0x09d4ea9f, 0x7cd629b0
  4560. + .word 0xb2af31a4, 0x23312a3f, 0x9430c6a5, 0x66c035a2
  4561. + .word 0xbc37744e, 0xcaa6fc82, 0xd0b0e090, 0xd81533a7
  4562. + .word 0x984af104, 0xdaf741ec, 0x500e7fcd, 0xf62f1791
  4563. + .word 0xd68d764d, 0xb04d43ef, 0x4d54ccaa, 0x04dfe496
  4564. + .word 0xb5e39ed1, 0x881b4c6a, 0x1fb8c12c, 0x517f4665
  4565. + .word 0xea049d5e, 0x355d018c, 0x7473fa87, 0x412efb0b
  4566. + .word 0x1d5ab367, 0xd25292db, 0x5633e910, 0x47136dd6
  4567. + .word 0x618c9ad7, 0x0c7a37a1, 0x148e59f8, 0x3c89eb13
  4568. + .word 0x27eecea9, 0xc935b761, 0xe5ede11c, 0xb13c7a47
  4569. + .word 0xdf599cd2, 0x733f55f2, 0xce791814, 0x37bf73c7
  4570. + .word 0xcdea53f7, 0xaa5b5ffd, 0x6f14df3d, 0xdb867844
  4571. + .word 0xf381caaf, 0xc43eb968, 0x342c3824, 0x405fc2a3
  4572. + .word 0xc372161d, 0x250cbce2, 0x498b283c, 0x9541ff0d
  4573. + .word 0x017139a8, 0xb3de080c, 0xe49cd8b4, 0xc1906456
  4574. + .word 0x84617bcb, 0xb670d532, 0x5c74486c, 0x5742d0b8
  4575. +
  4576. + .global AES_Td3
  4577. + .type AES_Td3,@object
  4578. + .size AES_Td3, 1024
  4579. +AES_Td3:
  4580. + .word 0xf4a75051, 0x4165537e, 0x17a4c31a, 0x275e963a
  4581. + .word 0xab6bcb3b, 0x9d45f11f, 0xfa58abac, 0xe303934b
  4582. + .word 0x30fa5520, 0x766df6ad, 0xcc769188, 0x024c25f5
  4583. + .word 0xe5d7fc4f, 0x2acbd7c5, 0x35448026, 0x62a38fb5
  4584. + .word 0xb15a49de, 0xba1b6725, 0xea0e9845, 0xfec0e15d
  4585. + .word 0x2f7502c3, 0x4cf01281, 0x4697a38d, 0xd3f9c66b
  4586. + .word 0x8f5fe703, 0x929c9515, 0x6d7aebbf, 0x5259da95
  4587. + .word 0xbe832dd4, 0x7421d358, 0xe0692949, 0xc9c8448e
  4588. + .word 0xc2896a75, 0x8e7978f4, 0x583e6b99, 0xb971dd27
  4589. + .word 0xe14fb6be, 0x88ad17f0, 0x20ac66c9, 0xce3ab47d
  4590. + .word 0xdf4a1863, 0x1a3182e5, 0x51336097, 0x537f4562
  4591. + .word 0x6477e0b1, 0x6bae84bb, 0x81a01cfe, 0x082b94f9
  4592. + .word 0x48685870, 0x45fd198f, 0xde6c8794, 0x7bf8b752
  4593. + .word 0x73d323ab, 0x4b02e272, 0x1f8f57e3, 0x55ab2a66
  4594. + .word 0xeb2807b2, 0xb5c2032f, 0xc57b9a86, 0x3708a5d3
  4595. + .word 0x2887f230, 0xbfa5b223, 0x036aba02, 0x16825ced
  4596. + .word 0xcf1c2b8a, 0x79b492a7, 0x07f2f0f3, 0x69e2a14e
  4597. + .word 0xdaf4cd65, 0x05bed506, 0x34621fd1, 0xa6fe8ac4
  4598. + .word 0x2e539d34, 0xf355a0a2, 0x8ae13205, 0xf6eb75a4
  4599. + .word 0x83ec390b, 0x60efaa40, 0x719f065e, 0x6e1051bd
  4600. + .word 0x218af93e, 0xdd063d96, 0x3e05aedd, 0xe6bd464d
  4601. + .word 0x548db591, 0xc45d0571, 0x06d46f04, 0x5015ff60
  4602. + .word 0x98fb2419, 0xbde997d6, 0x4043cc89, 0xd99e7767
  4603. + .word 0xe842bdb0, 0x898b8807, 0x195b38e7, 0xc8eedb79
  4604. + .word 0x7c0a47a1, 0x420fe97c, 0x841ec9f8, 0x00000000
  4605. + .word 0x80868309, 0x2bed4832, 0x1170ac1e, 0x5a724e6c
  4606. + .word 0x0efffbfd, 0x8538560f, 0xaed51e3d, 0x2d392736
  4607. + .word 0x0fd9640a, 0x5ca62168, 0x5b54d19b, 0x362e3a24
  4608. + .word 0x0a67b10c, 0x57e70f93, 0xee96d2b4, 0x9b919e1b
  4609. + .word 0xc0c54f80, 0xdc20a261, 0x774b695a, 0x121a161c
  4610. + .word 0x93ba0ae2, 0xa02ae5c0, 0x22e0433c, 0x1b171d12
  4611. + .word 0x090d0b0e, 0x8bc7adf2, 0xb6a8b92d, 0x1ea9c814
  4612. + .word 0xf1198557, 0x75074caf, 0x99ddbbee, 0x7f60fda3
  4613. + .word 0x01269ff7, 0x72f5bc5c, 0x663bc544, 0xfb7e345b
  4614. + .word 0x4329768b, 0x23c6dccb, 0xedfc68b6, 0xe4f163b8
  4615. + .word 0x31dccad7, 0x63851042, 0x97224013, 0xc6112084
  4616. + .word 0x4a247d85, 0xbb3df8d2, 0xf93211ae, 0x29a16dc7
  4617. + .word 0x9e2f4b1d, 0xb230f3dc, 0x8652ec0d, 0xc1e3d077
  4618. + .word 0xb3166c2b, 0x70b999a9, 0x9448fa11, 0xe9642247
  4619. + .word 0xfc8cc4a8, 0xf03f1aa0, 0x7d2cd856, 0x3390ef22
  4620. + .word 0x494ec787, 0x38d1c1d9, 0xcaa2fe8c, 0xd40b3698
  4621. + .word 0xf581cfa6, 0x7ade28a5, 0xb78e26da, 0xadbfa43f
  4622. + .word 0x3a9de42c, 0x78920d50, 0x5fcc9b6a, 0x7e466254
  4623. + .word 0x8d13c2f6, 0xd8b8e890, 0x39f75e2e, 0xc3aff582
  4624. + .word 0x5d80be9f, 0xd0937c69, 0xd52da96f, 0x2512b3cf
  4625. + .word 0xac993bc8, 0x187da710, 0x9c636ee8, 0x3bbb7bdb
  4626. + .word 0x267809cd, 0x5918f46e, 0x9ab701ec, 0x4f9aa883
  4627. + .word 0x956e65e6, 0xffe67eaa, 0xbccf0821, 0x15e8e6ef
  4628. + .word 0xe79bd9ba, 0x6f36ce4a, 0x9f09d4ea, 0xb07cd629
  4629. + .word 0xa4b2af31, 0x3f23312a, 0xa59430c6, 0xa266c035
  4630. + .word 0x4ebc3774, 0x82caa6fc, 0x90d0b0e0, 0xa7d81533
  4631. + .word 0x04984af1, 0xecdaf741, 0xcd500e7f, 0x91f62f17
  4632. + .word 0x4dd68d76, 0xefb04d43, 0xaa4d54cc, 0x9604dfe4
  4633. + .word 0xd1b5e39e, 0x6a881b4c, 0x2c1fb8c1, 0x65517f46
  4634. + .word 0x5eea049d, 0x8c355d01, 0x877473fa, 0x0b412efb
  4635. + .word 0x671d5ab3, 0xdbd25292, 0x105633e9, 0xd647136d
  4636. + .word 0xd7618c9a, 0xa10c7a37, 0xf8148e59, 0x133c89eb
  4637. + .word 0xa927eece, 0x61c935b7, 0x1ce5ede1, 0x47b13c7a
  4638. + .word 0xd2df599c, 0xf2733f55, 0x14ce7918, 0xc737bf73
  4639. + .word 0xf7cdea53, 0xfdaa5b5f, 0x3d6f14df, 0x44db8678
  4640. + .word 0xaff381ca, 0x68c43eb9, 0x24342c38, 0xa3405fc2
  4641. + .word 0x1dc37216, 0xe2250cbc, 0x3c498b28, 0x0d9541ff
  4642. + .word 0xa8017139, 0x0cb3de08, 0xb4e49cd8, 0x56c19064
  4643. + .word 0xcb84617b, 0x32b670d5, 0x6c5c7448, 0xb85742d0
  4644. +
  4645. + .global AES_Td4
  4646. + .type AES_Td4,@object
  4647. + .size AES_Td4, 1024
  4648. +AES_Td4:
  4649. + .word 0x52525252, 0x09090909, 0x6a6a6a6a, 0xd5d5d5d5
  4650. + .word 0x30303030, 0x36363636, 0xa5a5a5a5, 0x38383838
  4651. + .word 0xbfbfbfbf, 0x40404040, 0xa3a3a3a3, 0x9e9e9e9e
  4652. + .word 0x81818181, 0xf3f3f3f3, 0xd7d7d7d7, 0xfbfbfbfb
  4653. + .word 0x7c7c7c7c, 0xe3e3e3e3, 0x39393939, 0x82828282
  4654. + .word 0x9b9b9b9b, 0x2f2f2f2f, 0xffffffff, 0x87878787
  4655. + .word 0x34343434, 0x8e8e8e8e, 0x43434343, 0x44444444
  4656. + .word 0xc4c4c4c4, 0xdededede, 0xe9e9e9e9, 0xcbcbcbcb
  4657. + .word 0x54545454, 0x7b7b7b7b, 0x94949494, 0x32323232
  4658. + .word 0xa6a6a6a6, 0xc2c2c2c2, 0x23232323, 0x3d3d3d3d
  4659. + .word 0xeeeeeeee, 0x4c4c4c4c, 0x95959595, 0x0b0b0b0b
  4660. + .word 0x42424242, 0xfafafafa, 0xc3c3c3c3, 0x4e4e4e4e
  4661. + .word 0x08080808, 0x2e2e2e2e, 0xa1a1a1a1, 0x66666666
  4662. + .word 0x28282828, 0xd9d9d9d9, 0x24242424, 0xb2b2b2b2
  4663. + .word 0x76767676, 0x5b5b5b5b, 0xa2a2a2a2, 0x49494949
  4664. + .word 0x6d6d6d6d, 0x8b8b8b8b, 0xd1d1d1d1, 0x25252525
  4665. + .word 0x72727272, 0xf8f8f8f8, 0xf6f6f6f6, 0x64646464
  4666. + .word 0x86868686, 0x68686868, 0x98989898, 0x16161616
  4667. + .word 0xd4d4d4d4, 0xa4a4a4a4, 0x5c5c5c5c, 0xcccccccc
  4668. + .word 0x5d5d5d5d, 0x65656565, 0xb6b6b6b6, 0x92929292
  4669. + .word 0x6c6c6c6c, 0x70707070, 0x48484848, 0x50505050
  4670. + .word 0xfdfdfdfd, 0xedededed, 0xb9b9b9b9, 0xdadadada
  4671. + .word 0x5e5e5e5e, 0x15151515, 0x46464646, 0x57575757
  4672. + .word 0xa7a7a7a7, 0x8d8d8d8d, 0x9d9d9d9d, 0x84848484
  4673. + .word 0x90909090, 0xd8d8d8d8, 0xabababab, 0x00000000
  4674. + .word 0x8c8c8c8c, 0xbcbcbcbc, 0xd3d3d3d3, 0x0a0a0a0a
  4675. + .word 0xf7f7f7f7, 0xe4e4e4e4, 0x58585858, 0x05050505
  4676. + .word 0xb8b8b8b8, 0xb3b3b3b3, 0x45454545, 0x06060606
  4677. + .word 0xd0d0d0d0, 0x2c2c2c2c, 0x1e1e1e1e, 0x8f8f8f8f
  4678. + .word 0xcacacaca, 0x3f3f3f3f, 0x0f0f0f0f, 0x02020202
  4679. + .word 0xc1c1c1c1, 0xafafafaf, 0xbdbdbdbd, 0x03030303
  4680. + .word 0x01010101, 0x13131313, 0x8a8a8a8a, 0x6b6b6b6b
  4681. + .word 0x3a3a3a3a, 0x91919191, 0x11111111, 0x41414141
  4682. + .word 0x4f4f4f4f, 0x67676767, 0xdcdcdcdc, 0xeaeaeaea
  4683. + .word 0x97979797, 0xf2f2f2f2, 0xcfcfcfcf, 0xcececece
  4684. + .word 0xf0f0f0f0, 0xb4b4b4b4, 0xe6e6e6e6, 0x73737373
  4685. + .word 0x96969696, 0xacacacac, 0x74747474, 0x22222222
  4686. + .word 0xe7e7e7e7, 0xadadadad, 0x35353535, 0x85858585
  4687. + .word 0xe2e2e2e2, 0xf9f9f9f9, 0x37373737, 0xe8e8e8e8
  4688. + .word 0x1c1c1c1c, 0x75757575, 0xdfdfdfdf, 0x6e6e6e6e
  4689. + .word 0x47474747, 0xf1f1f1f1, 0x1a1a1a1a, 0x71717171
  4690. + .word 0x1d1d1d1d, 0x29292929, 0xc5c5c5c5, 0x89898989
  4691. + .word 0x6f6f6f6f, 0xb7b7b7b7, 0x62626262, 0x0e0e0e0e
  4692. + .word 0xaaaaaaaa, 0x18181818, 0xbebebebe, 0x1b1b1b1b
  4693. + .word 0xfcfcfcfc, 0x56565656, 0x3e3e3e3e, 0x4b4b4b4b
  4694. + .word 0xc6c6c6c6, 0xd2d2d2d2, 0x79797979, 0x20202020
  4695. + .word 0x9a9a9a9a, 0xdbdbdbdb, 0xc0c0c0c0, 0xfefefefe
  4696. + .word 0x78787878, 0xcdcdcdcd, 0x5a5a5a5a, 0xf4f4f4f4
  4697. + .word 0x1f1f1f1f, 0xdddddddd, 0xa8a8a8a8, 0x33333333
  4698. + .word 0x88888888, 0x07070707, 0xc7c7c7c7, 0x31313131
  4699. + .word 0xb1b1b1b1, 0x12121212, 0x10101010, 0x59595959
  4700. + .word 0x27272727, 0x80808080, 0xecececec, 0x5f5f5f5f
  4701. + .word 0x60606060, 0x51515151, 0x7f7f7f7f, 0xa9a9a9a9
  4702. + .word 0x19191919, 0xb5b5b5b5, 0x4a4a4a4a, 0x0d0d0d0d
  4703. + .word 0x2d2d2d2d, 0xe5e5e5e5, 0x7a7a7a7a, 0x9f9f9f9f
  4704. + .word 0x93939393, 0xc9c9c9c9, 0x9c9c9c9c, 0xefefefef
  4705. + .word 0xa0a0a0a0, 0xe0e0e0e0, 0x3b3b3b3b, 0x4d4d4d4d
  4706. + .word 0xaeaeaeae, 0x2a2a2a2a, 0xf5f5f5f5, 0xb0b0b0b0
  4707. + .word 0xc8c8c8c8, 0xebebebeb, 0xbbbbbbbb, 0x3c3c3c3c
  4708. + .word 0x83838383, 0x53535353, 0x99999999, 0x61616161
  4709. + .word 0x17171717, 0x2b2b2b2b, 0x04040404, 0x7e7e7e7e
  4710. + .word 0xbabababa, 0x77777777, 0xd6d6d6d6, 0x26262626
  4711. + .word 0xe1e1e1e1, 0x69696969, 0x14141414, 0x63636363
  4712. + .word 0x55555555, 0x21212121, 0x0c0c0c0c, 0x7d7d7d7d
  4713. +
  4714. Index: openssl-0.9.8g/crypto/aes/Makefile
  4715. ===================================================================
  4716. --- openssl-0.9.8g.orig/crypto/aes/Makefile 2008-09-24 11:00:04.000000000 +0200
  4717. +++ openssl-0.9.8g/crypto/aes/Makefile 2008-09-24 11:01:01.000000000 +0200
  4718. @@ -90,7 +90,7 @@
  4719. mv -f Makefile.new $(MAKEFILE)
  4720. clean:
  4721. - rm -f *.s *.o *.obj lib tags core .pure .nfs* *.old *.bak fluff
  4722. + rm -f asm/*.o *.s *.o *.obj lib tags core .pure .nfs* *.old *.bak fluff
  4723. # DO NOT DELETE THIS LINE -- make depend depends on it.
  4724. Index: openssl-0.9.8g/crypto/asn1/t_x509.c
  4725. ===================================================================
  4726. --- openssl-0.9.8g.orig/crypto/asn1/t_x509.c 2008-09-24 11:00:04.000000000 +0200
  4727. +++ openssl-0.9.8g/crypto/asn1/t_x509.c 2008-09-24 11:01:01.000000000 +0200
  4728. @@ -264,6 +264,10 @@
  4729. return(ret);
  4730. }
  4731. +#ifdef OPENSSL_NO_SHA
  4732. +#define SHA_DIGEST_LENGTH 20
  4733. +#endif
  4734. +
  4735. int X509_ocspid_print (BIO *bp, X509 *x)
  4736. {
  4737. unsigned char *der=NULL ;
  4738. Index: openssl-0.9.8g/crypto/asn1/x_info.c
  4739. ===================================================================
  4740. --- openssl-0.9.8g.orig/crypto/asn1/x_info.c 2008-09-24 11:00:04.000000000 +0200
  4741. +++ openssl-0.9.8g/crypto/asn1/x_info.c 2008-09-24 11:01:01.000000000 +0200
  4742. @@ -73,7 +73,9 @@
  4743. return(NULL);
  4744. }
  4745. +#ifndef OPENSSL_NO_EVP
  4746. ret->enc_cipher.cipher=NULL;
  4747. +#endif
  4748. ret->enc_len=0;
  4749. ret->enc_data=NULL;
  4750. Index: openssl-0.9.8g/crypto/bio/bss_conn.c
  4751. ===================================================================
  4752. --- openssl-0.9.8g.orig/crypto/bio/bss_conn.c 2008-09-24 11:00:04.000000000 +0200
  4753. +++ openssl-0.9.8g/crypto/bio/bss_conn.c 2008-09-24 11:01:01.000000000 +0200
  4754. @@ -63,7 +63,6 @@
  4755. #include <openssl/bio.h>
  4756. #ifndef OPENSSL_NO_SOCK
  4757. -
  4758. #ifdef OPENSSL_SYS_WIN16
  4759. #define SOCKET_PROTOCOL 0 /* more microsoft stupidity */
  4760. #else
  4761. Index: openssl-0.9.8g/crypto/bio/Makefile
  4762. ===================================================================
  4763. --- openssl-0.9.8g.orig/crypto/bio/Makefile 2008-09-24 11:00:04.000000000 +0200
  4764. +++ openssl-0.9.8g/crypto/bio/Makefile 2008-09-24 11:01:01.000000000 +0200
  4765. @@ -170,13 +170,6 @@
  4766. bss_conn.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
  4767. bss_conn.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
  4768. bss_conn.o: ../../include/openssl/symhacks.h ../cryptlib.h bss_conn.c
  4769. -bss_dgram.o: ../../e_os.h ../../include/openssl/bio.h
  4770. -bss_dgram.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
  4771. -bss_dgram.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
  4772. -bss_dgram.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
  4773. -bss_dgram.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
  4774. -bss_dgram.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
  4775. -bss_dgram.o: ../../include/openssl/symhacks.h ../cryptlib.h bss_dgram.c
  4776. bss_fd.o: ../../e_os.h ../../include/openssl/bio.h
  4777. bss_fd.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
  4778. bss_fd.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
  4779. Index: openssl-0.9.8g/crypto/bn/bn_asm.c
  4780. ===================================================================
  4781. --- openssl-0.9.8g.orig/crypto/bn/bn_asm.c 2008-09-24 11:00:04.000000000 +0200
  4782. +++ openssl-0.9.8g/crypto/bn/bn_asm.c 2008-09-24 11:01:01.000000000 +0200
  4783. @@ -219,7 +219,6 @@
  4784. #endif /* !(defined(BN_LLONG) || defined(BN_UMULT_HIGH)) */
  4785. #if defined(BN_LLONG) && defined(BN_DIV2W)
  4786. -
  4787. BN_ULONG bn_div_words(BN_ULONG h, BN_ULONG l, BN_ULONG d)
  4788. {
  4789. return((BN_ULONG)(((((BN_ULLONG)h)<<BN_BITS2)|l)/(BN_ULLONG)d));
  4790. @@ -821,17 +820,16 @@
  4791. r[7]=c2;
  4792. }
  4793. #else /* !BN_MUL_COMBA */
  4794. -
  4795. /* hmm... is it faster just to do a multiply? */
  4796. #undef bn_sqr_comba4
  4797. -void bn_sqr_comba4(BN_ULONG *r, BN_ULONG *a)
  4798. +void bn_sqr_comba4(BN_ULONG *r, const BN_ULONG *a)
  4799. {
  4800. BN_ULONG t[8];
  4801. bn_sqr_normal(r,a,4,t);
  4802. }
  4803. #undef bn_sqr_comba8
  4804. -void bn_sqr_comba8(BN_ULONG *r, BN_ULONG *a)
  4805. +void bn_sqr_comba8(BN_ULONG *r, const BN_ULONG *a)
  4806. {
  4807. BN_ULONG t[16];
  4808. bn_sqr_normal(r,a,8,t);
  4809. Index: openssl-0.9.8g/crypto/bn/bn_div.c
  4810. ===================================================================
  4811. --- openssl-0.9.8g.orig/crypto/bn/bn_div.c 2008-09-24 11:00:04.000000000 +0200
  4812. +++ openssl-0.9.8g/crypto/bn/bn_div.c 2008-09-24 11:01:01.000000000 +0200
  4813. @@ -187,10 +187,12 @@
  4814. BN_ULONG d0,d1;
  4815. int num_n,div_n;
  4816. +#ifndef BN_NO_CONSTTIME
  4817. if ((BN_get_flags(num, BN_FLG_CONSTTIME) != 0) || (BN_get_flags(divisor, BN_FLG_CONSTTIME) != 0))
  4818. {
  4819. return BN_div_no_branch(dv, rm, num, divisor, ctx);
  4820. }
  4821. +#endif
  4822. bn_check_top(dv);
  4823. bn_check_top(rm);
  4824. Index: openssl-0.9.8g/crypto/bn/bn_exp.c
  4825. ===================================================================
  4826. --- openssl-0.9.8g.orig/crypto/bn/bn_exp.c 2008-09-24 11:00:04.000000000 +0200
  4827. +++ openssl-0.9.8g/crypto/bn/bn_exp.c 2008-09-24 11:01:01.000000000 +0200
  4828. @@ -379,11 +379,12 @@
  4829. BIGNUM *val[TABLE_SIZE];
  4830. BN_MONT_CTX *mont=NULL;
  4831. +#ifndef BN_NO_CONSTTIME
  4832. if (BN_get_flags(p, BN_FLG_CONSTTIME) != 0)
  4833. {
  4834. return BN_mod_exp_mont_consttime(rr, a, p, m, ctx, in_mont);
  4835. }
  4836. -
  4837. +#endif
  4838. bn_check_top(a);
  4839. bn_check_top(p);
  4840. bn_check_top(m);
  4841. Index: openssl-0.9.8g/crypto/bn/bn_gcd.c
  4842. ===================================================================
  4843. --- openssl-0.9.8g.orig/crypto/bn/bn_gcd.c 2008-09-24 11:00:04.000000000 +0200
  4844. +++ openssl-0.9.8g/crypto/bn/bn_gcd.c 2008-09-24 11:01:01.000000000 +0200
  4845. @@ -212,10 +212,12 @@
  4846. BIGNUM *ret=NULL;
  4847. int sign;
  4848. +#ifndef BN_NO_CONSTTIME
  4849. if ((BN_get_flags(a, BN_FLG_CONSTTIME) != 0) || (BN_get_flags(n, BN_FLG_CONSTTIME) != 0))
  4850. {
  4851. return BN_mod_inverse_no_branch(in, a, n, ctx);
  4852. }
  4853. +#endif
  4854. bn_check_top(a);
  4855. bn_check_top(n);
  4856. Index: openssl-0.9.8g/crypto/bn/bn.h
  4857. ===================================================================
  4858. --- openssl-0.9.8g.orig/crypto/bn/bn.h 2008-09-24 11:00:04.000000000 +0200
  4859. +++ openssl-0.9.8g/crypto/bn/bn.h 2008-09-24 11:01:01.000000000 +0200
  4860. @@ -94,9 +94,15 @@
  4861. /* #define BN_DEBUG */
  4862. /* #define BN_DEBUG_RAND */
  4863. +#ifndef BN_NO_MUL_COMBA
  4864. #define BN_MUL_COMBA
  4865. +#endif
  4866. +#ifndef BN_NO_SQR_COMBA
  4867. #define BN_SQR_COMBA
  4868. +#endif
  4869. +#ifndef BN_NO_RECURSION
  4870. #define BN_RECURSION
  4871. +#endif
  4872. /* This next option uses the C libraries (2 word)/(1 word) function.
  4873. * If it is not defined, I use my C version (which is slower).
  4874. @@ -219,6 +225,7 @@
  4875. #endif
  4876. #ifdef EIGHT_BIT
  4877. +#error
  4878. #ifndef BN_DIV2W
  4879. #define BN_DIV2W
  4880. #endif
  4881. @@ -406,7 +413,11 @@
  4882. int BN_rand_range(BIGNUM *rnd, BIGNUM *range);
  4883. int BN_pseudo_rand_range(BIGNUM *rnd, BIGNUM *range);
  4884. int BN_num_bits(const BIGNUM *a);
  4885. +#if defined(__GNUC__)
  4886. +#define BN_num_bits_word(w) (BN_BITS2 - __builtin_clz(w))
  4887. +#else
  4888. int BN_num_bits_word(BN_ULONG);
  4889. +#endif
  4890. BIGNUM *BN_new(void);
  4891. void BN_init(BIGNUM *);
  4892. void BN_clear_free(BIGNUM *a);
  4893. Index: openssl-0.9.8g/crypto/bn/bn_lcl.h
  4894. ===================================================================
  4895. --- openssl-0.9.8g.orig/crypto/bn/bn_lcl.h 2008-09-24 11:00:04.000000000 +0200
  4896. +++ openssl-0.9.8g/crypto/bn/bn_lcl.h 2008-09-24 11:01:01.000000000 +0200
  4897. @@ -301,6 +301,36 @@
  4898. #endif
  4899. #ifdef BN_LLONG
  4900. +#if !defined(OPENSSL_NO_ASM) && !defined(OPENSSL_NO_INLINE_ASM) && !defined(PEDANTIC) && defined(__AVR32__)
  4901. +#define mul_add(r,a,w,c) { \
  4902. + BN_ULLONG t; \
  4903. + asm ( "add %0, %1, %2\n" \
  4904. + "srcs %m0\n" \
  4905. + "macu.d %0, %3, %4\n" \
  4906. + : "=&r"(t) \
  4907. + : "r"(r), "r"(c), "r"(w), "r"(a) \
  4908. + : "cc"); \
  4909. + (r)= Lw(t); \
  4910. + (c)= Hw(t); \
  4911. + }
  4912. +
  4913. +#define mul(r,a,w,c) { \
  4914. + BN_ULLONG t = c; \
  4915. + asm ( "macu.d %0, %1, %2\n" \
  4916. + : "+r"(t) \
  4917. + : "r"(w), "r"(a)); \
  4918. + (r)= Lw(t); \
  4919. + (c)= Hw(t); \
  4920. + }
  4921. +
  4922. +#define sqr(r0,r1,a) { \
  4923. + BN_ULLONG t; \
  4924. + t=(BN_ULLONG)(a)*(a); \
  4925. + (r0)=Lw(t); \
  4926. + (r1)=Hw(t); \
  4927. + }
  4928. +
  4929. +#else
  4930. #define mul_add(r,a,w,c) { \
  4931. BN_ULLONG t; \
  4932. t=(BN_ULLONG)w * (a) + (r) + (c); \
  4933. @@ -310,7 +340,7 @@
  4934. #define mul(r,a,w,c) { \
  4935. BN_ULLONG t; \
  4936. - t=(BN_ULLONG)w * (a) + (c); \
  4937. + t=(BN_ULLONG)w * (a) + (c); \
  4938. (r)= Lw(t); \
  4939. (c)= Hw(t); \
  4940. }
  4941. @@ -322,6 +352,7 @@
  4942. (r1)=Hw(t); \
  4943. }
  4944. +#endif
  4945. #elif defined(BN_UMULT_LOHI)
  4946. #define mul_add(r,a,w,c) { \
  4947. BN_ULONG high,low,ret,tmp=(a); \
  4948. Index: openssl-0.9.8g/crypto/bn/bn_lib.c
  4949. ===================================================================
  4950. --- openssl-0.9.8g.orig/crypto/bn/bn_lib.c 2008-09-24 11:00:04.000000000 +0200
  4951. +++ openssl-0.9.8g/crypto/bn/bn_lib.c 2008-09-24 11:01:01.000000000 +0200
  4952. @@ -158,6 +158,7 @@
  4953. return(data);
  4954. }
  4955. +#ifndef BN_num_bits_word
  4956. int BN_num_bits_word(BN_ULONG l)
  4957. {
  4958. static const char bits[256]={
  4959. @@ -244,6 +245,7 @@
  4960. }
  4961. }
  4962. }
  4963. +#endif
  4964. int BN_num_bits(const BIGNUM *a)
  4965. {
  4966. Index: openssl-0.9.8g/crypto/conf/conf.h
  4967. ===================================================================
  4968. --- openssl-0.9.8g.orig/crypto/conf/conf.h 2008-09-24 11:00:04.000000000 +0200
  4969. +++ openssl-0.9.8g/crypto/conf/conf.h 2008-09-24 11:01:01.000000000 +0200
  4970. @@ -121,13 +121,14 @@
  4971. LHASH *CONF_load(LHASH *conf,const char *file,long *eline);
  4972. #ifndef OPENSSL_NO_FP_API
  4973. LHASH *CONF_load_fp(LHASH *conf, FILE *fp,long *eline);
  4974. +int CONF_dump_fp(LHASH *conf, FILE *out);
  4975. +int NCONF_dump_fp(const CONF *conf, FILE *out);
  4976. #endif
  4977. LHASH *CONF_load_bio(LHASH *conf, BIO *bp,long *eline);
  4978. STACK_OF(CONF_VALUE) *CONF_get_section(LHASH *conf,const char *section);
  4979. char *CONF_get_string(LHASH *conf,const char *group,const char *name);
  4980. long CONF_get_number(LHASH *conf,const char *group,const char *name);
  4981. void CONF_free(LHASH *conf);
  4982. -int CONF_dump_fp(LHASH *conf, FILE *out);
  4983. int CONF_dump_bio(LHASH *conf, BIO *out);
  4984. void OPENSSL_config(const char *config_name);
  4985. @@ -161,7 +162,6 @@
  4986. char *NCONF_get_string(const CONF *conf,const char *group,const char *name);
  4987. int NCONF_get_number_e(const CONF *conf,const char *group,const char *name,
  4988. long *result);
  4989. -int NCONF_dump_fp(const CONF *conf, FILE *out);
  4990. int NCONF_dump_bio(const CONF *conf, BIO *out);
  4991. #if 0 /* The following function has no error checking,
  4992. Index: openssl-0.9.8g/crypto/cryptlib.c
  4993. ===================================================================
  4994. --- openssl-0.9.8g.orig/crypto/cryptlib.c 2008-09-24 11:00:04.000000000 +0200
  4995. +++ openssl-0.9.8g/crypto/cryptlib.c 2008-09-24 11:01:01.000000000 +0200
  4996. @@ -68,7 +68,7 @@
  4997. *
  4998. * Copyright remains Eric Young's, and as such any Copyright notices in
  4999. * the code are not to be removed.
  5000. - * If this package is used in a product, Eric Young should be given attribution
  5001. +5~ * If this package is used in a product, Eric Young should be given attribution
  5002. * as the author of the parts of the library used.
  5003. * This can be in the form of a textual message at program startup or
  5004. * in documentation (online or textual) provided with the package.
  5005. @@ -740,9 +740,11 @@
  5006. void OPENSSL_showfatal (const char *fmta,...)
  5007. { va_list ap;
  5008. +#ifndef OPENSSL_NO_STDIO
  5009. va_start (ap,fmta);
  5010. vfprintf (stderr,fmta,ap);
  5011. va_end (ap);
  5012. +#endif
  5013. }
  5014. int OPENSSL_isservice (void) { return 0; }
  5015. #endif
  5016. @@ -755,4 +757,8 @@
  5017. abort();
  5018. }
  5019. -void *OPENSSL_stderr(void) { return stderr; }
  5020. +void *OPENSSL_stderr(void) {
  5021. +#ifndef OPENSSL_NO_STDIO
  5022. + return stderr;
  5023. +#endif
  5024. +}
  5025. Index: openssl-0.9.8g/crypto/des/asm/des-avr32.S
  5026. ===================================================================
  5027. --- /dev/null 1970-01-01 00:00:00.000000000 +0000
  5028. +++ openssl-0.9.8g/crypto/des/asm/des-avr32.S 2008-09-24 11:01:01.000000000 +0200
  5029. @@ -0,0 +1,309 @@
  5030. + .global DES_encrypt1
  5031. + .global DES_encrypt2
  5032. + .global DES_encrypt3
  5033. + .global DES_decrypt3
  5034. +
  5035. + .macro DesEncrypt L, R, s, S, u /*hi*/, t /*lo*/, tmp, mask, to_u, to_t, spt0, spt1
  5036. + ld.d \t, \s[\S<<3]
  5037. + eor \u, \R
  5038. + eor \t, \R
  5039. + lsl \tmp, \t, 28
  5040. + or \t, \tmp, \t >> 4
  5041. + and \u, \mask, \u >> 2
  5042. + and \t, \mask, \t >> 2
  5043. + or \u, \to_u
  5044. + or \t, \to_t
  5045. + ld.w \tmp, \spt0[\u:b << 2]
  5046. + eor \L, \tmp
  5047. + ld.w \tmp, \spt0[\u:l << 2]
  5048. + eor \L, \tmp
  5049. + ld.w \tmp, \spt1[\u:u << 2]
  5050. + eor \L, \tmp
  5051. + ld.w \tmp, \spt1[\u:t << 2]
  5052. + eor \L, \tmp
  5053. + ld.w \tmp, \spt0[\t:b << 2]
  5054. + eor \L, \tmp
  5055. + ld.w \tmp, \spt0[\t:l << 2]
  5056. + eor \L, \tmp
  5057. + ld.w \tmp, \spt1[\t:u << 2]
  5058. + eor \L, \tmp
  5059. + ld.w \tmp, \spt1[\t:t << 2]
  5060. + eor \L, \tmp
  5061. + .endm
  5062. +
  5063. + .macro PermOp a, b, tmp, n, m
  5064. + eor \tmp, \b, \a >> \n
  5065. + andh \tmp, hi(\m)
  5066. + andl \tmp, lo(\m)
  5067. + eor \b, \tmp
  5068. + eor \a, \a, \tmp << \n
  5069. + .endm
  5070. +
  5071. + .macro IP l, r, tmp
  5072. + PermOp \r, \l, \tmp, 4, 0x0f0f0f0f
  5073. + PermOp \l, \r, \tmp, 16, 0x0000ffff
  5074. + PermOp \r, \l, \tmp, 2, 0x33333333
  5075. + PermOp \l, \r, \tmp, 8, 0x00ff00ff
  5076. + PermOp \r, \l, \tmp, 1, 0x55555555
  5077. + .endm
  5078. +
  5079. + .macro FP l, r, tmp
  5080. + PermOp \l, \r, \tmp, 1, 0x55555555
  5081. + PermOp \r, \l, \tmp, 8, 0x00ff00ff
  5082. + PermOp \l, \r, \tmp, 2, 0x33333333
  5083. + PermOp \r, \l, \tmp, 16, 0x0000ffff
  5084. + PermOp \l, \r, \tmp, 4, 0x0f0f0f0f
  5085. + .endm
  5086. +
  5087. + .text
  5088. + .align 2
  5089. +/* void DES_encrypt1(DES_LONG *data, DES_key_schedule *ks, int enc) */
  5090. +DES_encrypt1:
  5091. + pushm r0-r3, r4-r7, lr
  5092. +
  5093. + /*
  5094. + r=data[0];
  5095. + l=data[1];
  5096. + */
  5097. + ld.d r8, r12[0] /* r8 = l, r9 = r */
  5098. +
  5099. + /*
  5100. + IP(r,l);
  5101. + */
  5102. + IP r9, r8, r0
  5103. +
  5104. + /*
  5105. + r=ROTATE(r,29)&0xffffffffL;
  5106. + l=ROTATE(l,29)&0xffffffffL;
  5107. + */
  5108. + lsl r0, r8, 3
  5109. + or r8, r0, r8 >> 29
  5110. + lsl r0, r9, 3
  5111. + or r9, r0, r9 >> 29
  5112. +
  5113. + /* Setup mask and table offset values. */
  5114. + mov r3, 0x3f3f
  5115. + or r3, r3, r3 << 16
  5116. + mov r4, (2 << 14) | (0 << 6)
  5117. + or r4, r4, r4 << 16
  5118. + mov r5, (3 << 14) | (1 << 6)
  5119. + or r5, r5, r5 << 16
  5120. +
  5121. + /* Load DES_SPtrans pointer, we also need pointer to
  5122. + DES_SPtrans[4] */
  5123. + lda.w r6, DES_SPtrans
  5124. + sub r7, r6, -(64*4*4)
  5125. +
  5126. + cp.w r10, 0
  5127. + movne lr, 1
  5128. + movne r10, 0
  5129. + moveq lr, -1
  5130. + moveq r10, 15
  5131. +
  5132. +DES_encrypt1_loop:
  5133. + DesEncrypt /*L*/r8,/*R*/r9,/*s*/r11,/*S*/r10,/*u*/r1,/*t*/r0,/*tmp*/r2,/*mask*/r3,/*to_u*/r4,/*to_t*/r5,/*spt0*/r6,/*spt1*/r7
  5134. + add r10, lr
  5135. + DesEncrypt /*R*/r9,/*L*/r8,/*s*/r11,/*S*/r10,/*u*/r1,/*t*/r0,/*tmp*/r2,/*mask*/r3,/*to_u*/r4,/*to_t*/r5,/*spt0*/r6,/*spt1*/r7
  5136. + add r10, lr
  5137. + /* If bit 4 is set it means that r10 is either -1 or 16
  5138. + in which case the algorithm is finished and the loop should exit. */
  5139. + bld r10, 4
  5140. + brne DES_encrypt1_loop
  5141. +
  5142. + /*
  5143. + r=ROTATE(r,3)&0xffffffffL;
  5144. + l=ROTATE(l,3)&0xffffffffL;
  5145. +
  5146. + Note we also move l and r into r1 and r0 respectively
  5147. + */
  5148. + lsl r1, r8, 29
  5149. + or r1, r1, r8 >> 3
  5150. + lsl r0, r9, 29
  5151. + or r0, r0, r9 >> 3
  5152. +
  5153. + /*
  5154. + FP(r,l);
  5155. + */
  5156. + FP r0, r1, r2
  5157. +
  5158. + /*
  5159. + data[0]=l;
  5160. + data[1]=r;
  5161. + */
  5162. + st.d r12[0], r0
  5163. + popm r0-r3, r4-r7, pc
  5164. +
  5165. +
  5166. +/*void DES_encrypt2(DES_LONG *data, DES_key_schedule *ks, int enc) */
  5167. +DES_encrypt2:
  5168. + pushm r0-r3, r4-r7, lr
  5169. +
  5170. + /*
  5171. + r=data[0];
  5172. + l=data[1];
  5173. + */
  5174. + ld.d r8, r12[0] /* r8 = l, r9 = r */
  5175. +
  5176. + /*
  5177. + r=ROTATE(r,29)&0xffffffffL;
  5178. + l=ROTATE(l,29)&0xffffffffL;
  5179. + */
  5180. + lsl r0, r8, 3
  5181. + or r8, r0, r8 >> 29
  5182. + lsl r0, r9, 3
  5183. + or r9, r0, r9 >> 29
  5184. +
  5185. + /* Setup mask and table offset values. */
  5186. + mov r3, 0x3f3f
  5187. + or r3, r3, r3 << 16
  5188. + mov r4, (2 << 14) | (0 << 6)
  5189. + or r4, r4, r4 << 16
  5190. + mov r5, (3 << 14) | (1 << 6)
  5191. + or r5, r5, r5 << 16
  5192. +
  5193. + /* Load DES_SPtrans pointer, we also need pointer to
  5194. + DES_SPtrans[4] */
  5195. + lda.w r6, DES_SPtrans
  5196. + sub r7, r6, -(64*4*4)
  5197. +
  5198. + cp.w r10, 0
  5199. + movne lr, 1
  5200. + movne r10, 0
  5201. + moveq lr, -1
  5202. + moveq r10, 15
  5203. +
  5204. +DES_encrypt2_loop:
  5205. + DesEncrypt /*L*/r8,/*R*/r9,/*s*/r11,/*S*/r10,/*u*/r1,/*t*/r0,/*tmp*/r2,/*mask*/r3,/*to_u*/r4,/*to_t*/r5,/*spt0*/r6,/*spt1*/r7
  5206. + add r10, lr
  5207. + DesEncrypt /*R*/r9,/*L*/r8,/*s*/r11,/*S*/r10,/*u*/r1,/*t*/r0,/*tmp*/r2,/*mask*/r3,/*to_u*/r4,/*to_t*/r5,/*spt0*/r6,/*spt1*/r7
  5208. + add r10, lr
  5209. + /* If bit 4 is set it means that r10 is either -1 or 16
  5210. + in which case the algorithm is finished and the loop should exit. */
  5211. + bld r10, 4
  5212. + brne DES_encrypt2_loop
  5213. +
  5214. + /*
  5215. + r=ROTATE(r,3)&0xffffffffL;
  5216. + l=ROTATE(l,3)&0xffffffffL;
  5217. +
  5218. + Note we also move l and r into r1 and r0 respectively
  5219. + */
  5220. + lsl r1, r8, 29
  5221. + or r1, r1, r8 >> 3
  5222. + lsl r0, r9, 29
  5223. + or r0, r0, r9 >> 3
  5224. +
  5225. + /*
  5226. + data[0]=l;
  5227. + data[1]=r;
  5228. + */
  5229. + st.d r12[0], r0
  5230. + popm r0-r3, r4-r7, pc
  5231. +
  5232. +
  5233. +/* void DES_encrypt3(DES_LONG *data, DES_key_schedule *ks1,
  5234. + DES_key_schedule *ks2, DES_key_schedule *ks3) */
  5235. +DES_encrypt3:
  5236. + pushm r0-r3, lr
  5237. +
  5238. + /*
  5239. + l=data[0];
  5240. + r=data[1];
  5241. + */
  5242. + ld.d r0, r12[0] /* r0 = r, r1 = l */
  5243. +
  5244. + mov r2, r10
  5245. + mov r3, r9
  5246. +
  5247. + /*
  5248. + IP(l,r);
  5249. + */
  5250. + IP r1, r0, lr
  5251. +
  5252. + /*
  5253. + data[0] = l;
  5254. + data[1] = r;
  5255. + */
  5256. + st.d r12[0], r0
  5257. +
  5258. + mov r10, 1
  5259. + call DES_encrypt2
  5260. + mov r10, 0
  5261. + mov r11, r2
  5262. + call DES_encrypt2
  5263. + mov r10, 1
  5264. + mov r11, r3
  5265. + call DES_encrypt2
  5266. +
  5267. + /*
  5268. + l=data[0];
  5269. + r=data[1];
  5270. + */
  5271. + ld.d r0, r12[0] /* r0 = r, r1 = l */
  5272. +
  5273. + /*
  5274. + FP(r,l);
  5275. + */
  5276. + FP r0, r1, lr
  5277. +
  5278. + /*
  5279. + data[0] = l;
  5280. + data[1] = r;
  5281. + */
  5282. + st.d r12[0], r0
  5283. +
  5284. + popm r0-r3, pc
  5285. +
  5286. +/* void DES_decrypt3(DES_LONG *data, DES_key_schedule *ks1,
  5287. + DES_key_schedule *ks2, DES_key_schedule *ks3) */
  5288. +DES_decrypt3:
  5289. + pushm r0-r3, lr
  5290. +
  5291. + /*
  5292. + l=data[0];
  5293. + r=data[1];
  5294. + */
  5295. + ld.d r0, r12[0] /* r0 = r, r1 = l */
  5296. +
  5297. + mov r2, r10
  5298. + mov r3, r11
  5299. + mov r11, r9
  5300. +
  5301. + /*
  5302. + IP(l,r);
  5303. + */
  5304. + IP r1, r0, lr
  5305. +
  5306. + /*
  5307. + data[0] = l;
  5308. + data[1] = r;
  5309. + */
  5310. + st.d r12[0], r0
  5311. +
  5312. + mov r10, 0
  5313. + call DES_encrypt2
  5314. + mov r10, 1
  5315. + mov r11, r2
  5316. + call DES_encrypt2
  5317. + mov r10, 0
  5318. + mov r11, r3
  5319. + call DES_encrypt2
  5320. +
  5321. + /*
  5322. + l=data[0];
  5323. + r=data[1];
  5324. + */
  5325. + ld.d r0, r12[0] /* r0 = r, r1 = l */
  5326. +
  5327. + /*
  5328. + FP(r,l);
  5329. + */
  5330. + FP r0, r1, lr
  5331. +
  5332. + /*
  5333. + data[0] = l;
  5334. + data[1] = r;
  5335. + */
  5336. + st.d r12[0], r0
  5337. +
  5338. + popm r0-r3, pc
  5339. Index: openssl-0.9.8g/crypto/des/asm/des_cbc.c
  5340. ===================================================================
  5341. --- /dev/null 1970-01-01 00:00:00.000000000 +0000
  5342. +++ openssl-0.9.8g/crypto/des/asm/des_cbc.c 2008-09-24 11:01:01.000000000 +0200
  5343. @@ -0,0 +1,191 @@
  5344. +#include "../des_locl.h"
  5345. +
  5346. +#ifndef DES_DEFAULT_OPTIONS
  5347. +
  5348. +void DES_ncbc_encrypt(const unsigned char *in, unsigned char *out, long length,
  5349. + DES_key_schedule *_schedule, DES_cblock *ivec, int enc)
  5350. + {
  5351. + register DES_LONG tin0,tin1;
  5352. + register DES_LONG tout0,tout1,xor0,xor1;
  5353. + register long l=length;
  5354. + DES_LONG tin[2];
  5355. + unsigned char *iv;
  5356. +
  5357. + iv = &(*ivec)[0];
  5358. +
  5359. + if (enc)
  5360. + {
  5361. + c2l(iv,tout0);
  5362. + c2l(iv,tout1);
  5363. + for (l-=8; l>=0; l-=8)
  5364. + {
  5365. + c2l(in,tin0);
  5366. + c2l(in,tin1);
  5367. + tin0^=tout0; tin[0]=tin0;
  5368. + tin1^=tout1; tin[1]=tin1;
  5369. + DES_encrypt1((DES_LONG *)tin,_schedule,DES_ENCRYPT);
  5370. + tout0=tin[0]; l2c(tout0,out);
  5371. + tout1=tin[1]; l2c(tout1,out);
  5372. + }
  5373. + if (l != -8)
  5374. + {
  5375. + c2ln(in,tin0,tin1,l+8);
  5376. + tin0^=tout0; tin[0]=tin0;
  5377. + tin1^=tout1; tin[1]=tin1;
  5378. + DES_encrypt1((DES_LONG *)tin,_schedule,DES_ENCRYPT);
  5379. + tout0=tin[0]; l2c(tout0,out);
  5380. + tout1=tin[1]; l2c(tout1,out);
  5381. + }
  5382. + iv = &(*ivec)[0];
  5383. + l2c(tout0,iv);
  5384. + l2c(tout1,iv);
  5385. + }
  5386. + else
  5387. + {
  5388. + c2l(iv,xor0);
  5389. + c2l(iv,xor1);
  5390. + for (l-=8; l>=0; l-=8)
  5391. + {
  5392. + c2l(in,tin0); tin[0]=tin0;
  5393. + c2l(in,tin1); tin[1]=tin1;
  5394. + DES_encrypt1((DES_LONG *)tin,_schedule,DES_DECRYPT);
  5395. + tout0=tin[0]^xor0;
  5396. + tout1=tin[1]^xor1;
  5397. + l2c(tout0,out);
  5398. + l2c(tout1,out);
  5399. + xor0=tin0;
  5400. + xor1=tin1;
  5401. + }
  5402. + if (l != -8)
  5403. + {
  5404. + c2l(in,tin0); tin[0]=tin0;
  5405. + c2l(in,tin1); tin[1]=tin1;
  5406. + DES_encrypt1((DES_LONG *)tin,_schedule,DES_DECRYPT);
  5407. + tout0=tin[0]^xor0;
  5408. + tout1=tin[1]^xor1;
  5409. + l2cn(tout0,tout1,out,l+8);
  5410. + xor0=tin0;
  5411. + xor1=tin1;
  5412. + }
  5413. + iv = &(*ivec)[0];
  5414. + l2c(xor0,iv);
  5415. + l2c(xor1,iv);
  5416. + }
  5417. + tin0=tin1=tout0=tout1=xor0=xor1=0;
  5418. + tin[0]=tin[1]=0;
  5419. + }
  5420. +
  5421. +
  5422. +void DES_ede3_cbc_encrypt(const unsigned char *input, unsigned char *output,
  5423. + long length, DES_key_schedule *ks1,
  5424. + DES_key_schedule *ks2, DES_key_schedule *ks3,
  5425. + DES_cblock *ivec, int enc)
  5426. + {
  5427. + register DES_LONG tin0,tin1;
  5428. + register DES_LONG tout0,tout1,xor0,xor1;
  5429. + register const unsigned char *in;
  5430. + unsigned char *out;
  5431. + register long l=length;
  5432. + DES_LONG tin[2];
  5433. + unsigned char *iv;
  5434. +
  5435. + in=input;
  5436. + out=output;
  5437. + iv = &(*ivec)[0];
  5438. +
  5439. + if (enc)
  5440. + {
  5441. + c2l(iv,tout0);
  5442. + c2l(iv,tout1);
  5443. + for (l-=8; l>=0; l-=8)
  5444. + {
  5445. + c2l(in,tin0);
  5446. + c2l(in,tin1);
  5447. + tin0^=tout0;
  5448. + tin1^=tout1;
  5449. +
  5450. + tin[0]=tin0;
  5451. + tin[1]=tin1;
  5452. + DES_encrypt3((DES_LONG *)tin,ks1,ks2,ks3);
  5453. + tout0=tin[0];
  5454. + tout1=tin[1];
  5455. +
  5456. + l2c(tout0,out);
  5457. + l2c(tout1,out);
  5458. + }
  5459. + if (l != -8)
  5460. + {
  5461. + c2ln(in,tin0,tin1,l+8);
  5462. + tin0^=tout0;
  5463. + tin1^=tout1;
  5464. +
  5465. + tin[0]=tin0;
  5466. + tin[1]=tin1;
  5467. + DES_encrypt3((DES_LONG *)tin,ks1,ks2,ks3);
  5468. + tout0=tin[0];
  5469. + tout1=tin[1];
  5470. +
  5471. + l2c(tout0,out);
  5472. + l2c(tout1,out);
  5473. + }
  5474. + iv = &(*ivec)[0];
  5475. + l2c(tout0,iv);
  5476. + l2c(tout1,iv);
  5477. + }
  5478. + else
  5479. + {
  5480. + register DES_LONG t0,t1;
  5481. +
  5482. + c2l(iv,xor0);
  5483. + c2l(iv,xor1);
  5484. + for (l-=8; l>=0; l-=8)
  5485. + {
  5486. + c2l(in,tin0);
  5487. + c2l(in,tin1);
  5488. +
  5489. + t0=tin0;
  5490. + t1=tin1;
  5491. +
  5492. + tin[0]=tin0;
  5493. + tin[1]=tin1;
  5494. + DES_decrypt3((DES_LONG *)tin,ks1,ks2,ks3);
  5495. + tout0=tin[0];
  5496. + tout1=tin[1];
  5497. +
  5498. + tout0^=xor0;
  5499. + tout1^=xor1;
  5500. + l2c(tout0,out);
  5501. + l2c(tout1,out);
  5502. + xor0=t0;
  5503. + xor1=t1;
  5504. + }
  5505. + if (l != -8)
  5506. + {
  5507. + c2l(in,tin0);
  5508. + c2l(in,tin1);
  5509. +
  5510. + t0=tin0;
  5511. + t1=tin1;
  5512. +
  5513. + tin[0]=tin0;
  5514. + tin[1]=tin1;
  5515. + DES_decrypt3((DES_LONG *)tin,ks1,ks2,ks3);
  5516. + tout0=tin[0];
  5517. + tout1=tin[1];
  5518. +
  5519. + tout0^=xor0;
  5520. + tout1^=xor1;
  5521. + l2cn(tout0,tout1,out,l+8);
  5522. + xor0=t0;
  5523. + xor1=t1;
  5524. + }
  5525. +
  5526. + iv = &(*ivec)[0];
  5527. + l2c(xor0,iv);
  5528. + l2c(xor1,iv);
  5529. + }
  5530. + tin0=tin1=tout0=tout1=xor0=xor1=0;
  5531. + tin[0]=tin[1]=0;
  5532. + }
  5533. +
  5534. +#endif /* DES_DEFAULT_OPTIONS */
  5535. Index: openssl-0.9.8g/crypto/des/des_locl.h
  5536. ===================================================================
  5537. --- openssl-0.9.8g.orig/crypto/des/des_locl.h 2008-09-24 11:00:04.000000000 +0200
  5538. +++ openssl-0.9.8g/crypto/des/des_locl.h 2008-09-24 11:01:01.000000000 +0200
  5539. @@ -421,7 +421,11 @@
  5540. PERM_OP(l,r,tt, 4,0x0f0f0f0fL); \
  5541. }
  5542. +#ifdef DES_CTABLES_IN_DATA
  5543. +extern DES_LONG DES_SPtrans[8][64];
  5544. +#else
  5545. extern const DES_LONG DES_SPtrans[8][64];
  5546. +#endif
  5547. void fcrypt_body(DES_LONG *out,DES_key_schedule *ks,
  5548. DES_LONG Eswap0, DES_LONG Eswap1);
  5549. Index: openssl-0.9.8g/crypto/des/Makefile
  5550. ===================================================================
  5551. --- openssl-0.9.8g.orig/crypto/des/Makefile 2008-09-24 11:00:04.000000000 +0200
  5552. +++ openssl-0.9.8g/crypto/des/Makefile 2008-09-24 11:01:01.000000000 +0200
  5553. @@ -116,7 +116,7 @@
  5554. mv -f Makefile.new $(MAKEFILE)
  5555. clean:
  5556. - rm -f *.s *.o *.obj des lib tags core .pure .nfs* *.old *.bak fluff
  5557. + rm asm/*.o -f *.s *.o *.obj des lib tags core .pure .nfs* *.old *.bak fluff
  5558. # DO NOT DELETE THIS LINE -- make depend depends on it.
  5559. Index: openssl-0.9.8g/crypto/des/spr.h
  5560. ===================================================================
  5561. --- openssl-0.9.8g.orig/crypto/des/spr.h 2008-09-24 11:00:04.000000000 +0200
  5562. +++ openssl-0.9.8g/crypto/des/spr.h 2008-09-24 11:01:01.000000000 +0200
  5563. @@ -56,7 +56,11 @@
  5564. * [including the GNU Public Licence.]
  5565. */
  5566. +#ifdef DES_CTABLES_IN_DATA
  5567. +OPENSSL_GLOBAL DES_LONG DES_SPtrans[8][64]={
  5568. +#else
  5569. OPENSSL_GLOBAL const DES_LONG DES_SPtrans[8][64]={
  5570. +#endif
  5571. {
  5572. /* nibble 0 */
  5573. 0x02080800L, 0x00080000L, 0x02000002L, 0x02080802L,
  5574. Index: openssl-0.9.8g/crypto/dsa/dsa_depr.c
  5575. ===================================================================
  5576. --- openssl-0.9.8g.orig/crypto/dsa/dsa_depr.c 2008-09-24 11:00:04.000000000 +0200
  5577. +++ openssl-0.9.8g/crypto/dsa/dsa_depr.c 2008-09-24 11:01:01.000000000 +0200
  5578. @@ -71,8 +71,8 @@
  5579. static void *dummy=&dummy;
  5580. +#include <openssl/e_os2.h>
  5581. #ifndef OPENSSL_NO_SHA
  5582. -
  5583. #include <stdio.h>
  5584. #include <time.h>
  5585. #include "cryptlib.h"
  5586. Index: openssl-0.9.8g/crypto/ec/Makefile
  5587. ===================================================================
  5588. --- openssl-0.9.8g.orig/crypto/ec/Makefile 2008-09-24 11:00:04.000000000 +0200
  5589. +++ openssl-0.9.8g/crypto/ec/Makefile 2008-09-24 11:01:01.000000000 +0200
  5590. @@ -95,7 +95,6 @@
  5591. ec2_smpl.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
  5592. ec2_smpl.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
  5593. ec2_smpl.o: ../../include/openssl/symhacks.h ec2_smpl.c ec2_smpt.c ec_lcl.h
  5594. -ec2_smpt.o: ec2_smpt.c
  5595. ec_asn1.o: ../../include/openssl/asn1.h ../../include/openssl/asn1t.h
  5596. ec_asn1.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
  5597. ec_asn1.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
  5598. Index: openssl-0.9.8g/crypto/ecdh/ech_ossl.c
  5599. ===================================================================
  5600. --- openssl-0.9.8g.orig/crypto/ecdh/ech_ossl.c 2008-09-24 11:00:04.000000000 +0200
  5601. +++ openssl-0.9.8g/crypto/ecdh/ech_ossl.c 2008-09-24 11:01:01.000000000 +0200
  5602. @@ -75,7 +75,7 @@
  5603. #include "ech_locl.h"
  5604. #include <openssl/err.h>
  5605. -#include <openssl/sha.h>
  5606. +//#include <openssl/sha.h>
  5607. #include <openssl/obj_mac.h>
  5608. #include <openssl/bn.h>
  5609. Index: openssl-0.9.8g/crypto/ecdh/Makefile
  5610. ===================================================================
  5611. --- openssl-0.9.8g.orig/crypto/ecdh/Makefile 2008-09-24 11:00:04.000000000 +0200
  5612. +++ openssl-0.9.8g/crypto/ecdh/Makefile 2008-09-24 11:01:01.000000000 +0200
  5613. @@ -106,6 +106,6 @@
  5614. ech_ossl.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
  5615. ech_ossl.o: ../../include/openssl/opensslconf.h
  5616. ech_ossl.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
  5617. -ech_ossl.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
  5618. -ech_ossl.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
  5619. -ech_ossl.o: ../cryptlib.h ech_locl.h ech_ossl.c
  5620. +ech_ossl.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
  5621. +ech_ossl.o: ../../include/openssl/symhacks.h ../cryptlib.h ech_locl.h
  5622. +ech_ossl.o: ech_ossl.c
  5623. Index: openssl-0.9.8g/crypto/evp/Makefile
  5624. ===================================================================
  5625. --- openssl-0.9.8g.orig/crypto/evp/Makefile 2008-09-24 11:00:04.000000000 +0200
  5626. +++ openssl-0.9.8g/crypto/evp/Makefile 2008-09-24 11:01:01.000000000 +0200
  5627. @@ -245,7 +245,6 @@
  5628. e_null.o: ../../include/openssl/ossl_typ.h ../../include/openssl/safestack.h
  5629. e_null.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
  5630. e_null.o: ../cryptlib.h e_null.c
  5631. -e_old.o: e_old.c
  5632. e_rc2.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h
  5633. e_rc2.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
  5634. e_rc2.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
  5635. Index: openssl-0.9.8g/crypto/Makefile
  5636. ===================================================================
  5637. --- openssl-0.9.8g.orig/crypto/Makefile 2008-09-24 11:00:04.000000000 +0200
  5638. +++ openssl-0.9.8g/crypto/Makefile 2008-09-24 11:01:01.000000000 +0200
  5639. @@ -186,7 +186,7 @@
  5640. mem_dbg.o: ../include/openssl/stack.h ../include/openssl/symhacks.h cryptlib.h
  5641. mem_dbg.o: mem_dbg.c
  5642. o_dir.o: ../e_os.h ../include/openssl/e_os2.h ../include/openssl/opensslconf.h
  5643. -o_dir.o: LPdir_unix.c o_dir.c o_dir.h
  5644. +o_dir.o: o_dir.c o_dir.h
  5645. o_str.o: ../e_os.h ../include/openssl/e_os2.h ../include/openssl/opensslconf.h
  5646. o_str.o: o_str.c o_str.h
  5647. o_time.o: ../include/openssl/e_os2.h ../include/openssl/opensslconf.h o_time.c
  5648. Index: openssl-0.9.8g/crypto/o_dir.c
  5649. ===================================================================
  5650. --- openssl-0.9.8g.orig/crypto/o_dir.c 2008-09-24 11:00:04.000000000 +0200
  5651. +++ openssl-0.9.8g/crypto/o_dir.c 2008-09-24 11:01:01.000000000 +0200
  5652. @@ -70,7 +70,20 @@
  5653. #include "o_dir.h"
  5654. #define LPDIR_H
  5655. -#if defined OPENSSL_SYS_UNIX || defined DJGPP
  5656. +#if defined OPENSSL_SYS_NEWLIB
  5657. +struct OPENSSL_dir_context_st {
  5658. + //void *dummy;
  5659. +};
  5660. +
  5661. +const char *OPENSSL_DIR_read(OPENSSL_DIR_CTX **ctx, const char *directory){
  5662. + return NULL;
  5663. +}
  5664. +
  5665. +int OPENSSL_DIR_end(OPENSSL_DIR_CTX **ctx){
  5666. + return 1;
  5667. +}
  5668. +
  5669. +#elif defined OPENSSL_SYS_UNIX || defined DJGPP
  5670. #include "LPdir_unix.c"
  5671. #elif defined OPENSSL_SYS_VMS
  5672. #include "LPdir_vms.c"
  5673. Index: openssl-0.9.8g/crypto/opensslconf.h
  5674. ===================================================================
  5675. --- openssl-0.9.8g.orig/crypto/opensslconf.h 2008-09-24 11:00:04.000000000 +0200
  5676. +++ openssl-0.9.8g/crypto/opensslconf.h 2008-09-24 11:01:01.000000000 +0200
  5677. @@ -25,6 +25,9 @@
  5678. #ifndef OPENSSL_NO_SEED
  5679. # define OPENSSL_NO_SEED
  5680. #endif
  5681. +#ifndef OPENSSL_NO_THREAD
  5682. +# define OPENSSL_NO_THREAD
  5683. +#endif
  5684. #ifndef OPENSSL_NO_TLSEXT
  5685. # define OPENSSL_NO_TLSEXT
  5686. #endif
  5687. @@ -60,6 +63,9 @@
  5688. # if defined(OPENSSL_NO_SEED) && !defined(NO_SEED)
  5689. # define NO_SEED
  5690. # endif
  5691. +# if defined(OPENSSL_NO_THREAD) && !defined(NO_THREAD)
  5692. +# define NO_THREAD
  5693. +# endif
  5694. # if defined(OPENSSL_NO_TLSEXT) && !defined(NO_TLSEXT)
  5695. # define NO_TLSEXT
  5696. # endif
  5697. @@ -125,7 +131,7 @@
  5698. #if defined(HEADER_BN_H) && !defined(CONFIG_HEADER_BN_H)
  5699. #define CONFIG_HEADER_BN_H
  5700. -#undef BN_LLONG
  5701. +#define BN_LLONG
  5702. /* Should we define BN_DIV2W here? */
  5703. Index: openssl-0.9.8g/crypto/pem/pem.h
  5704. ===================================================================
  5705. --- openssl-0.9.8g.orig/crypto/pem/pem.h 2008-09-24 11:00:04.000000000 +0200
  5706. +++ openssl-0.9.8g/crypto/pem/pem.h 2008-09-24 11:01:01.000000000 +0200
  5707. @@ -353,6 +353,7 @@
  5708. #define DECLARE_PEM_read_fp(name, type) /**/
  5709. #define DECLARE_PEM_write_fp(name, type) /**/
  5710. +#define DECLARE_PEM_write_fp_const(name, type) /**/
  5711. #define DECLARE_PEM_write_cb_fp(name, type) /**/
  5712. #else
  5713. Index: openssl-0.9.8g/crypto/rand/md_rand.c
  5714. ===================================================================
  5715. --- openssl-0.9.8g.orig/crypto/rand/md_rand.c 2008-09-24 11:00:04.000000000 +0200
  5716. +++ openssl-0.9.8g/crypto/rand/md_rand.c 2008-09-24 11:01:01.000000000 +0200
  5717. @@ -152,6 +152,7 @@
  5718. int rand_predictable=0;
  5719. #endif
  5720. +#ifndef OPENSSL_NO_EVP
  5721. const char RAND_version[]="RAND" OPENSSL_VERSION_PTEXT;
  5722. static void ssleay_rand_cleanup(void);
  5723. @@ -496,6 +497,7 @@
  5724. CRYPTO_w_unlock(CRYPTO_LOCK_RAND);
  5725. EVP_MD_CTX_cleanup(&m);
  5726. +
  5727. if (ok)
  5728. return(1);
  5729. else
  5730. @@ -570,3 +572,4 @@
  5731. return ret;
  5732. }
  5733. +#endif
  5734. Index: openssl-0.9.8g/crypto/rand/rand_egd.c
  5735. ===================================================================
  5736. --- openssl-0.9.8g.orig/crypto/rand/rand_egd.c 2008-09-24 11:00:04.000000000 +0200
  5737. +++ openssl-0.9.8g/crypto/rand/rand_egd.c 2008-09-24 11:01:01.000000000 +0200
  5738. @@ -95,7 +95,7 @@
  5739. * RAND_egd() is a wrapper for RAND_egd_bytes() with numbytes=255.
  5740. */
  5741. -#if defined(OPENSSL_SYS_WIN32) || defined(OPENSSL_SYS_VMS) || defined(OPENSSL_SYS_MSDOS) || defined(OPENSSL_SYS_VXWORKS) || defined(OPENSSL_SYS_NETWARE) || defined(OPENSSL_SYS_VOS)
  5742. +#if defined(OPENSSL_SYS_NEWLIB) || defined(OPENSSL_SYS_WIN32) || defined(OPENSSL_SYS_VMS) || defined(OPENSSL_SYS_MSDOS) || defined(OPENSSL_SYS_VXWORKS) || defined(OPENSSL_SYS_NETWARE) || defined(OPENSSL_SYS_VOS)
  5743. int RAND_query_egd_bytes(const char *path, unsigned char *buf, int bytes)
  5744. {
  5745. return(-1);
  5746. Index: openssl-0.9.8g/crypto/rand/rand_lib.c
  5747. ===================================================================
  5748. --- openssl-0.9.8g.orig/crypto/rand/rand_lib.c 2008-09-24 11:00:04.000000000 +0200
  5749. +++ openssl-0.9.8g/crypto/rand/rand_lib.c 2008-09-24 11:01:01.000000000 +0200
  5750. @@ -102,7 +102,9 @@
  5751. funct_ref = e;
  5752. else
  5753. #endif
  5754. +#ifndef OPENSSL_NO_EVP
  5755. default_RAND_meth = RAND_SSLeay();
  5756. +#endif
  5757. }
  5758. return default_RAND_meth;
  5759. }
  5760. Index: openssl-0.9.8g/crypto/rand/rand_unix.c
  5761. ===================================================================
  5762. --- openssl-0.9.8g.orig/crypto/rand/rand_unix.c 2008-09-24 11:00:04.000000000 +0200
  5763. +++ openssl-0.9.8g/crypto/rand/rand_unix.c 2008-09-24 11:01:01.000000000 +0200
  5764. @@ -116,7 +116,7 @@
  5765. #include <openssl/rand.h>
  5766. #include "rand_lcl.h"
  5767. -#if !(defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_WIN32) || defined(OPENSSL_SYS_VMS) || defined(OPENSSL_SYS_OS2) || defined(OPENSSL_SYS_VXWORKS) || defined(OPENSSL_SYS_NETWARE))
  5768. +#if !(defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_WIN32) || defined(OPENSSL_SYS_VMS) || defined(OPENSSL_SYS_OS2) || defined(OPENSSL_SYS_VXWORKS) || defined(OPENSSL_SYS_NETWARE) || defined(OPENSSL_SYS_NEWLIB))
  5769. #include <sys/types.h>
  5770. #include <sys/time.h>
  5771. @@ -322,7 +322,7 @@
  5772. #endif /* !(defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_WIN32) || defined(OPENSSL_SYS_VMS) || defined(OPENSSL_SYS_OS2) || defined(OPENSSL_SYS_VXWORKS) || defined(OPENSSL_SYS_NETWARE)) */
  5773. -#if defined(OPENSSL_SYS_VXWORKS)
  5774. +#if defined(OPENSSL_SYS_VXWORKS) || defined(OPENSSL_SYS_NEWLIB)
  5775. int RAND_poll(void)
  5776. {
  5777. return 0;
  5778. Index: openssl-0.9.8g/crypto/rsa/Makefile
  5779. ===================================================================
  5780. --- openssl-0.9.8g.orig/crypto/rsa/Makefile 2008-09-24 11:00:04.000000000 +0200
  5781. +++ openssl-0.9.8g/crypto/rsa/Makefile 2008-09-24 11:01:01.000000000 +0200
  5782. @@ -167,9 +167,8 @@
  5783. rsa_oaep.o: ../../include/openssl/opensslconf.h
  5784. rsa_oaep.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
  5785. rsa_oaep.o: ../../include/openssl/rand.h ../../include/openssl/rsa.h
  5786. -rsa_oaep.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
  5787. -rsa_oaep.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
  5788. -rsa_oaep.o: ../cryptlib.h rsa_oaep.c
  5789. +rsa_oaep.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
  5790. +rsa_oaep.o: ../../include/openssl/symhacks.h ../cryptlib.h rsa_oaep.c
  5791. rsa_pk1.o: ../../e_os.h ../../include/openssl/asn1.h
  5792. rsa_pk1.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
  5793. rsa_pk1.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
  5794. @@ -188,8 +187,8 @@
  5795. rsa_pss.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
  5796. rsa_pss.o: ../../include/openssl/ossl_typ.h ../../include/openssl/rand.h
  5797. rsa_pss.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
  5798. -rsa_pss.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
  5799. -rsa_pss.o: ../../include/openssl/symhacks.h ../cryptlib.h rsa_pss.c
  5800. +rsa_pss.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
  5801. +rsa_pss.o: ../cryptlib.h rsa_pss.c
  5802. rsa_saos.o: ../../e_os.h ../../include/openssl/asn1.h
  5803. rsa_saos.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
  5804. rsa_saos.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
  5805. Index: openssl-0.9.8g/crypto/rsa/rsa_oaep.c
  5806. ===================================================================
  5807. --- openssl-0.9.8g.orig/crypto/rsa/rsa_oaep.c 2008-09-24 11:00:04.000000000 +0200
  5808. +++ openssl-0.9.8g/crypto/rsa/rsa_oaep.c 2008-09-24 11:01:01.000000000 +0200
  5809. @@ -26,7 +26,8 @@
  5810. #include <openssl/rsa.h>
  5811. #include <openssl/evp.h>
  5812. #include <openssl/rand.h>
  5813. -#include <openssl/sha.h>
  5814. +//#include <openssl/sha.h>
  5815. +#define SHA_DIGEST_LENGTH 20
  5816. int MGF1(unsigned char *mask, long len,
  5817. const unsigned char *seed, long seedlen);
  5818. Index: openssl-0.9.8g/crypto/rsa/rsa_pss.c
  5819. ===================================================================
  5820. --- openssl-0.9.8g.orig/crypto/rsa/rsa_pss.c 2008-09-24 11:00:04.000000000 +0200
  5821. +++ openssl-0.9.8g/crypto/rsa/rsa_pss.c 2008-09-24 11:01:01.000000000 +0200
  5822. @@ -62,7 +62,7 @@
  5823. #include <openssl/rsa.h>
  5824. #include <openssl/evp.h>
  5825. #include <openssl/rand.h>
  5826. -#include <openssl/sha.h>
  5827. +//#include <openssl/sha.h>
  5828. static const unsigned char zeroes[] = {0,0,0,0,0,0,0,0};
  5829. Index: openssl-0.9.8g/crypto/ui/ui_openssl.c
  5830. ===================================================================
  5831. --- openssl-0.9.8g.orig/crypto/ui/ui_openssl.c 2008-09-24 11:00:04.000000000 +0200
  5832. +++ openssl-0.9.8g/crypto/ui/ui_openssl.c 2008-09-24 11:01:01.000000000 +0200
  5833. @@ -212,6 +212,12 @@
  5834. #undef SGTTY
  5835. #endif
  5836. +#if defined(OPENSSL_SYS_NEWLIB)
  5837. +# undef TERMIOS
  5838. +# undef TERMIO
  5839. +# undef SGTTY
  5840. +#endif
  5841. +
  5842. #ifdef TERMIOS
  5843. # include <termios.h>
  5844. # define TTY_STRUCT struct termios
  5845. @@ -236,7 +242,7 @@
  5846. # define TTY_set(tty,data) ioctl(tty,TIOCSETP,data)
  5847. #endif
  5848. -#if !defined(_LIBC) && !defined(OPENSSL_SYS_MSDOS) && !defined(OPENSSL_SYS_VMS) && !defined(OPENSSL_SYS_MACINTOSH_CLASSIC) && !defined(OPENSSL_SYS_SUNOS)
  5849. +#if !defined(OPENSSL_SYS_NEWLIB) && !defined(_LIBC) && !defined(OPENSSL_SYS_MSDOS) && !defined(OPENSSL_SYS_VMS) && !defined(OPENSSL_SYS_MACINTOSH_CLASSIC) && !defined(OPENSSL_SYS_SUNOS)
  5850. # include <sys/ioctl.h>
  5851. #endif
  5852. @@ -260,7 +266,7 @@
  5853. typedef int sig_atomic_t;
  5854. #endif
  5855. -#if defined(OPENSSL_SYS_MACINTOSH_CLASSIC) || defined(MAC_OS_GUSI_SOURCE) || defined(OPENSSL_SYS_NETWARE)
  5856. +#if defined(OPENSSL_SYS_NEWLIB) || defined(OPENSSL_SYS_MACINTOSH_CLASSIC) || defined(MAC_OS_GUSI_SOURCE) || defined(OPENSSL_SYS_NETWARE)
  5857. /*
  5858. * This one needs work. As a matter of fact the code is unoperational
  5859. * and this is only a trick to get it compiled.
  5860. @@ -473,7 +479,7 @@
  5861. CRYPTO_w_lock(CRYPTO_LOCK_UI);
  5862. is_a_tty = 1;
  5863. -#if defined(OPENSSL_SYS_MACINTOSH_CLASSIC) || defined(OPENSSL_SYS_VXWORKS) || defined(OPENSSL_SYS_NETWARE)
  5864. +#if defined(OPENSSL_SYS_NEWLIB) || defined(OPENSSL_SYS_MACINTOSH_CLASSIC) || defined(OPENSSL_SYS_VXWORKS) || defined(OPENSSL_SYS_NETWARE)
  5865. tty_in=stdin;
  5866. tty_out=stderr;
  5867. #else
  5868. Index: openssl-0.9.8g/crypto/uid.c
  5869. ===================================================================
  5870. --- openssl-0.9.8g.orig/crypto/uid.c 2008-09-24 11:00:04.000000000 +0200
  5871. +++ openssl-0.9.8g/crypto/uid.c 2008-09-24 11:01:01.000000000 +0200
  5872. @@ -65,7 +65,7 @@
  5873. return issetugid();
  5874. }
  5875. -#elif defined(OPENSSL_SYS_WIN32) || defined(OPENSSL_SYS_VXWORKS) || defined(OPENSSL_SYS_NETWARE)
  5876. +#elif defined(OPENSSL_SYS_NEWLIB) || defined(OPENSSL_SYS_WIN32) || defined(OPENSSL_SYS_VXWORKS) || defined(OPENSSL_SYS_NETWARE)
  5877. int OPENSSL_issetugid(void)
  5878. {
  5879. Index: openssl-0.9.8g/crypto/x509/x509.h
  5880. ===================================================================
  5881. --- openssl-0.9.8g.orig/crypto/x509/x509.h 2008-09-24 11:00:04.000000000 +0200
  5882. +++ openssl-0.9.8g/crypto/x509/x509.h 2008-09-24 11:01:01.000000000 +0200
  5883. @@ -69,9 +69,9 @@
  5884. #ifndef OPENSSL_NO_BUFFER
  5885. #include <openssl/buffer.h>
  5886. #endif
  5887. -#ifndef OPENSSL_NO_EVP
  5888. +//#ifndef OPENSSL_NO_EVP
  5889. #include <openssl/evp.h>
  5890. -#endif
  5891. +//#endif
  5892. #ifndef OPENSSL_NO_BIO
  5893. #include <openssl/bio.h>
  5894. #endif
  5895. @@ -476,14 +476,15 @@
  5896. int references;
  5897. } X509_PKEY;
  5898. -#ifndef OPENSSL_NO_EVP
  5899. typedef struct X509_info_st
  5900. {
  5901. X509 *x509;
  5902. X509_CRL *crl;
  5903. X509_PKEY *x_pkey;
  5904. +#ifndef OPENSSL_NO_EVP
  5905. EVP_CIPHER_INFO enc_cipher;
  5906. +#endif
  5907. int enc_len;
  5908. char *enc_data;
  5909. @@ -491,7 +492,6 @@
  5910. } X509_INFO;
  5911. DECLARE_STACK_OF(X509_INFO)
  5912. -#endif
  5913. /* The next 2 structures and their 8 routines were sent to me by
  5914. * Pat Richard <patr@x509.com> and are used to manipulate
  5915. Index: openssl-0.9.8g/crypto/x509v3/x509v3.h
  5916. ===================================================================
  5917. --- openssl-0.9.8g.orig/crypto/x509v3/x509v3.h 2008-09-24 11:00:04.000000000 +0200
  5918. +++ openssl-0.9.8g/crypto/x509v3/x509v3.h 2008-09-24 11:01:01.000000000 +0200
  5919. @@ -592,7 +592,9 @@
  5920. void X509V3_EXT_val_prn(BIO *out, STACK_OF(CONF_VALUE) *val, int indent,
  5921. int ml);
  5922. int X509V3_EXT_print(BIO *out, X509_EXTENSION *ext, unsigned long flag, int indent);
  5923. +#ifndef OPENSSL_NO_FP_API
  5924. int X509V3_EXT_print_fp(FILE *out, X509_EXTENSION *ext, int flag, int indent);
  5925. +#endif
  5926. int X509V3_extensions_print(BIO *out, char *title, STACK_OF(X509_EXTENSION) *exts, unsigned long flag, int indent);
  5927. Index: openssl-0.9.8g/e_os2.h
  5928. ===================================================================
  5929. --- openssl-0.9.8g.orig/e_os2.h 2008-09-24 11:00:04.000000000 +0200
  5930. +++ openssl-0.9.8g/e_os2.h 2008-09-24 11:01:01.000000000 +0200
  5931. @@ -157,6 +157,11 @@
  5932. # define OPENSSL_SYS_OS2
  5933. #endif
  5934. +/* --------------------------------- Newlib ---------------------------------- */
  5935. +#ifdef OPENSSL_SYSNAME_NEWLIB
  5936. +#define OPENSSL_SYS_NEWLIB
  5937. +#endif
  5938. +
  5939. /* --------------------------------- Unix ---------------------------------- */
  5940. #ifdef OPENSSL_SYS_UNIX
  5941. # if defined(linux) || defined(__linux__) || defined(OPENSSL_SYSNAME_LINUX)
  5942. Index: openssl-0.9.8g/e_os.h
  5943. ===================================================================
  5944. --- openssl-0.9.8g.orig/e_os.h 2008-09-24 11:00:04.000000000 +0200
  5945. +++ openssl-0.9.8g/e_os.h 2008-09-24 11:01:01.000000000 +0200
  5946. @@ -94,6 +94,12 @@
  5947. # define NO_SYSLOG
  5948. #endif
  5949. +#if defined(OPENSSL_SYS_NEWLIB)
  5950. +# define NO_SYS_PARAM_H
  5951. + //# define NO_CHMOD
  5952. +# define NO_SYSLOG
  5953. +#endif
  5954. +
  5955. #if defined(OPENSSL_SYS_MACINTOSH_CLASSIC)
  5956. # if macintosh==1
  5957. # ifndef MAC_OS_GUSI_SOURCE
  5958. @@ -425,7 +431,12 @@
  5959. /*************/
  5960. #ifdef USE_SOCKETS
  5961. -# if defined(WINDOWS) || defined(MSDOS)
  5962. +# if defined(OPENSSL_SYS_NEWLIB)
  5963. +# define SSLeay_Write(a,b,c) (-1)
  5964. +# define SSLeay_Read(a,b,c) (-1)
  5965. +# define SHUTDOWN(fd) close(fd)
  5966. +# define SHUTDOWN2(fd) close(fd)
  5967. +# elif defined(WINDOWS) || defined(MSDOS)
  5968. /* windows world */
  5969. # ifdef OPENSSL_NO_SOCK
  5970. Index: openssl-0.9.8g/ssl/bio_ssl.c
  5971. ===================================================================
  5972. --- openssl-0.9.8g.orig/ssl/bio_ssl.c 2008-09-24 11:00:04.000000000 +0200
  5973. +++ openssl-0.9.8g/ssl/bio_ssl.c 2008-09-24 11:01:01.000000000 +0200
  5974. @@ -534,12 +534,14 @@
  5975. {
  5976. BIO *ret=NULL,*con=NULL,*ssl=NULL;
  5977. +#ifndef OPENSSL_NO_SOCK
  5978. if ((con=BIO_new(BIO_s_connect())) == NULL)
  5979. return(NULL);
  5980. if ((ssl=BIO_new_ssl(ctx,1)) == NULL)
  5981. goto err;
  5982. if ((ret=BIO_push(ssl,con)) == NULL)
  5983. goto err;
  5984. +#endif
  5985. return(ret);
  5986. err:
  5987. if (con != NULL) BIO_free(con);
  5988. Index: openssl-0.9.8g/ssl/Makefile
  5989. ===================================================================
  5990. --- openssl-0.9.8g.orig/ssl/Makefile 2008-09-24 11:00:04.000000000 +0200
  5991. +++ openssl-0.9.8g/ssl/Makefile 2008-09-24 11:01:01.000000000 +0200
  5992. @@ -634,20 +634,20 @@
  5993. s3_srvr.o: ../include/openssl/ec.h ../include/openssl/ecdh.h
  5994. s3_srvr.o: ../include/openssl/ecdsa.h ../include/openssl/err.h
  5995. s3_srvr.o: ../include/openssl/evp.h ../include/openssl/hmac.h
  5996. -s3_srvr.o: ../include/openssl/krb5_asn.h ../include/openssl/kssl.h
  5997. -s3_srvr.o: ../include/openssl/lhash.h ../include/openssl/md5.h
  5998. -s3_srvr.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h
  5999. -s3_srvr.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
  6000. -s3_srvr.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h
  6001. -s3_srvr.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h
  6002. -s3_srvr.o: ../include/openssl/pq_compat.h ../include/openssl/pqueue.h
  6003. -s3_srvr.o: ../include/openssl/rand.h ../include/openssl/rsa.h
  6004. -s3_srvr.o: ../include/openssl/safestack.h ../include/openssl/sha.h
  6005. -s3_srvr.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h
  6006. -s3_srvr.o: ../include/openssl/ssl23.h ../include/openssl/ssl3.h
  6007. -s3_srvr.o: ../include/openssl/stack.h ../include/openssl/symhacks.h
  6008. -s3_srvr.o: ../include/openssl/tls1.h ../include/openssl/x509.h
  6009. -s3_srvr.o: ../include/openssl/x509_vfy.h kssl_lcl.h s3_srvr.c ssl_locl.h
  6010. +s3_srvr.o: ../include/openssl/kssl.h ../include/openssl/lhash.h
  6011. +s3_srvr.o: ../include/openssl/md5.h ../include/openssl/obj_mac.h
  6012. +s3_srvr.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h
  6013. +s3_srvr.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h
  6014. +s3_srvr.o: ../include/openssl/pem.h ../include/openssl/pem2.h
  6015. +s3_srvr.o: ../include/openssl/pkcs7.h ../include/openssl/pq_compat.h
  6016. +s3_srvr.o: ../include/openssl/pqueue.h ../include/openssl/rand.h
  6017. +s3_srvr.o: ../include/openssl/rsa.h ../include/openssl/safestack.h
  6018. +s3_srvr.o: ../include/openssl/sha.h ../include/openssl/ssl.h
  6019. +s3_srvr.o: ../include/openssl/ssl2.h ../include/openssl/ssl23.h
  6020. +s3_srvr.o: ../include/openssl/ssl3.h ../include/openssl/stack.h
  6021. +s3_srvr.o: ../include/openssl/symhacks.h ../include/openssl/tls1.h
  6022. +s3_srvr.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h kssl_lcl.h
  6023. +s3_srvr.o: s3_srvr.c ssl_locl.h
  6024. ssl_algs.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h
  6025. ssl_algs.o: ../include/openssl/bn.h ../include/openssl/buffer.h
  6026. ssl_algs.o: ../include/openssl/comp.h ../include/openssl/crypto.h
  6027. Index: openssl-0.9.8g/test/Makefile
  6028. ===================================================================
  6029. --- openssl-0.9.8g.orig/test/Makefile 2008-09-24 11:00:04.000000000 +0200
  6030. +++ openssl-0.9.8g/test/Makefile 2008-09-24 11:01:01.000000000 +0200
  6031. @@ -445,8 +445,9 @@
  6032. bntest.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h bntest.c
  6033. casttest.o: ../e_os.h ../include/openssl/cast.h ../include/openssl/e_os2.h
  6034. casttest.o: ../include/openssl/opensslconf.h casttest.c
  6035. -destest.o: ../include/openssl/des.h ../include/openssl/des_old.h
  6036. -destest.o: ../include/openssl/e_os2.h ../include/openssl/opensslconf.h
  6037. +destest.o: ../include/openssl/crypto.h ../include/openssl/des.h
  6038. +destest.o: ../include/openssl/des_old.h ../include/openssl/e_os2.h
  6039. +destest.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
  6040. destest.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h
  6041. destest.o: ../include/openssl/stack.h ../include/openssl/symhacks.h
  6042. destest.o: ../include/openssl/ui.h ../include/openssl/ui_compat.h destest.c
  6043. @@ -476,41 +477,69 @@
  6044. ecdhtest.o: ../include/openssl/sha.h ../include/openssl/stack.h
  6045. ecdhtest.o: ../include/openssl/symhacks.h ecdhtest.c
  6046. ecdsatest.o: ../include/openssl/asn1.h ../include/openssl/bio.h
  6047. -ecdsatest.o: ../include/openssl/bn.h ../include/openssl/crypto.h
  6048. -ecdsatest.o: ../include/openssl/e_os2.h ../include/openssl/ec.h
  6049. +ecdsatest.o: ../include/openssl/bn.h ../include/openssl/buffer.h
  6050. +ecdsatest.o: ../include/openssl/crypto.h ../include/openssl/dh.h
  6051. +ecdsatest.o: ../include/openssl/dsa.h ../include/openssl/e_os2.h
  6052. +ecdsatest.o: ../include/openssl/ec.h ../include/openssl/ecdh.h
  6053. ecdsatest.o: ../include/openssl/ecdsa.h ../include/openssl/engine.h
  6054. ecdsatest.o: ../include/openssl/err.h ../include/openssl/evp.h
  6055. ecdsatest.o: ../include/openssl/lhash.h ../include/openssl/obj_mac.h
  6056. ecdsatest.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h
  6057. ecdsatest.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h
  6058. -ecdsatest.o: ../include/openssl/rand.h ../include/openssl/safestack.h
  6059. -ecdsatest.o: ../include/openssl/stack.h ../include/openssl/symhacks.h
  6060. -ecdsatest.o: ecdsatest.c
  6061. +ecdsatest.o: ../include/openssl/pkcs7.h ../include/openssl/rand.h
  6062. +ecdsatest.o: ../include/openssl/rsa.h ../include/openssl/safestack.h
  6063. +ecdsatest.o: ../include/openssl/sha.h ../include/openssl/stack.h
  6064. +ecdsatest.o: ../include/openssl/store.h ../include/openssl/symhacks.h
  6065. +ecdsatest.o: ../include/openssl/ui.h ../include/openssl/x509.h
  6066. +ecdsatest.o: ../include/openssl/x509_vfy.h ecdsatest.c
  6067. ectest.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h
  6068. -ectest.o: ../include/openssl/bn.h ../include/openssl/crypto.h
  6069. -ectest.o: ../include/openssl/e_os2.h ../include/openssl/ec.h
  6070. -ectest.o: ../include/openssl/engine.h ../include/openssl/err.h
  6071. +ectest.o: ../include/openssl/bn.h ../include/openssl/buffer.h
  6072. +ectest.o: ../include/openssl/crypto.h ../include/openssl/dh.h
  6073. +ectest.o: ../include/openssl/dsa.h ../include/openssl/e_os2.h
  6074. +ectest.o: ../include/openssl/ec.h ../include/openssl/ecdh.h
  6075. +ectest.o: ../include/openssl/ecdsa.h ../include/openssl/engine.h
  6076. +ectest.o: ../include/openssl/err.h ../include/openssl/evp.h
  6077. ectest.o: ../include/openssl/lhash.h ../include/openssl/obj_mac.h
  6078. ectest.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h
  6079. ectest.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h
  6080. -ectest.o: ../include/openssl/rand.h ../include/openssl/safestack.h
  6081. -ectest.o: ../include/openssl/stack.h ../include/openssl/symhacks.h ectest.c
  6082. -enginetest.o: ../include/openssl/bio.h ../include/openssl/buffer.h
  6083. -enginetest.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
  6084. -enginetest.o: ../include/openssl/engine.h ../include/openssl/err.h
  6085. -enginetest.o: ../include/openssl/lhash.h ../include/openssl/opensslconf.h
  6086. +ectest.o: ../include/openssl/pkcs7.h ../include/openssl/rand.h
  6087. +ectest.o: ../include/openssl/rsa.h ../include/openssl/safestack.h
  6088. +ectest.o: ../include/openssl/sha.h ../include/openssl/stack.h
  6089. +ectest.o: ../include/openssl/store.h ../include/openssl/symhacks.h
  6090. +ectest.o: ../include/openssl/ui.h ../include/openssl/x509.h
  6091. +ectest.o: ../include/openssl/x509_vfy.h ectest.c
  6092. +enginetest.o: ../include/openssl/asn1.h ../include/openssl/bio.h
  6093. +enginetest.o: ../include/openssl/bn.h ../include/openssl/buffer.h
  6094. +enginetest.o: ../include/openssl/crypto.h ../include/openssl/dh.h
  6095. +enginetest.o: ../include/openssl/dsa.h ../include/openssl/e_os2.h
  6096. +enginetest.o: ../include/openssl/ec.h ../include/openssl/ecdh.h
  6097. +enginetest.o: ../include/openssl/ecdsa.h ../include/openssl/engine.h
  6098. +enginetest.o: ../include/openssl/err.h ../include/openssl/evp.h
  6099. +enginetest.o: ../include/openssl/lhash.h ../include/openssl/obj_mac.h
  6100. +enginetest.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h
  6101. enginetest.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h
  6102. -enginetest.o: ../include/openssl/safestack.h ../include/openssl/stack.h
  6103. -enginetest.o: ../include/openssl/symhacks.h enginetest.c
  6104. +enginetest.o: ../include/openssl/pkcs7.h ../include/openssl/rand.h
  6105. +enginetest.o: ../include/openssl/rsa.h ../include/openssl/safestack.h
  6106. +enginetest.o: ../include/openssl/sha.h ../include/openssl/stack.h
  6107. +enginetest.o: ../include/openssl/store.h ../include/openssl/symhacks.h
  6108. +enginetest.o: ../include/openssl/ui.h ../include/openssl/x509.h
  6109. +enginetest.o: ../include/openssl/x509_vfy.h enginetest.c
  6110. evp_test.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h
  6111. +evp_test.o: ../include/openssl/bn.h ../include/openssl/buffer.h
  6112. evp_test.o: ../include/openssl/conf.h ../include/openssl/crypto.h
  6113. -evp_test.o: ../include/openssl/e_os2.h ../include/openssl/engine.h
  6114. -evp_test.o: ../include/openssl/err.h ../include/openssl/evp.h
  6115. -evp_test.o: ../include/openssl/lhash.h ../include/openssl/obj_mac.h
  6116. -evp_test.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h
  6117. -evp_test.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h
  6118. -evp_test.o: ../include/openssl/safestack.h ../include/openssl/stack.h
  6119. -evp_test.o: ../include/openssl/symhacks.h evp_test.c
  6120. +evp_test.o: ../include/openssl/dh.h ../include/openssl/dsa.h
  6121. +evp_test.o: ../include/openssl/e_os2.h ../include/openssl/ec.h
  6122. +evp_test.o: ../include/openssl/ecdh.h ../include/openssl/ecdsa.h
  6123. +evp_test.o: ../include/openssl/engine.h ../include/openssl/err.h
  6124. +evp_test.o: ../include/openssl/evp.h ../include/openssl/lhash.h
  6125. +evp_test.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h
  6126. +evp_test.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
  6127. +evp_test.o: ../include/openssl/ossl_typ.h ../include/openssl/pkcs7.h
  6128. +evp_test.o: ../include/openssl/rand.h ../include/openssl/rsa.h
  6129. +evp_test.o: ../include/openssl/safestack.h ../include/openssl/sha.h
  6130. +evp_test.o: ../include/openssl/stack.h ../include/openssl/store.h
  6131. +evp_test.o: ../include/openssl/symhacks.h ../include/openssl/ui.h
  6132. +evp_test.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h evp_test.c
  6133. exptest.o: ../e_os.h ../include/openssl/bio.h ../include/openssl/bn.h
  6134. exptest.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
  6135. exptest.o: ../include/openssl/err.h ../include/openssl/lhash.h
  6136. @@ -519,39 +548,42 @@
  6137. exptest.o: ../include/openssl/safestack.h ../include/openssl/stack.h
  6138. exptest.o: ../include/openssl/symhacks.h exptest.c
  6139. hmactest.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h
  6140. -hmactest.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
  6141. -hmactest.o: ../include/openssl/evp.h ../include/openssl/hmac.h
  6142. -hmactest.o: ../include/openssl/md5.h ../include/openssl/obj_mac.h
  6143. -hmactest.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h
  6144. -hmactest.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h
  6145. -hmactest.o: ../include/openssl/safestack.h ../include/openssl/stack.h
  6146. -hmactest.o: ../include/openssl/symhacks.h hmactest.c
  6147. +hmactest.o: ../include/openssl/bn.h ../include/openssl/crypto.h
  6148. +hmactest.o: ../include/openssl/e_os2.h ../include/openssl/evp.h
  6149. +hmactest.o: ../include/openssl/hmac.h ../include/openssl/md5.h
  6150. +hmactest.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h
  6151. +hmactest.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
  6152. +hmactest.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h
  6153. +hmactest.o: ../include/openssl/stack.h ../include/openssl/symhacks.h hmactest.c
  6154. ideatest.o: ../e_os.h ../include/openssl/e_os2.h ../include/openssl/idea.h
  6155. ideatest.o: ../include/openssl/opensslconf.h ideatest.c
  6156. igetest.o: ../include/openssl/aes.h ../include/openssl/e_os2.h
  6157. igetest.o: ../include/openssl/opensslconf.h ../include/openssl/ossl_typ.h
  6158. igetest.o: ../include/openssl/rand.h igetest.c
  6159. md2test.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h
  6160. -md2test.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
  6161. -md2test.o: ../include/openssl/evp.h ../include/openssl/md2.h
  6162. -md2test.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h
  6163. -md2test.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
  6164. -md2test.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h
  6165. -md2test.o: ../include/openssl/stack.h ../include/openssl/symhacks.h md2test.c
  6166. +md2test.o: ../include/openssl/bn.h ../include/openssl/crypto.h
  6167. +md2test.o: ../include/openssl/e_os2.h ../include/openssl/evp.h
  6168. +md2test.o: ../include/openssl/md2.h ../include/openssl/obj_mac.h
  6169. +md2test.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h
  6170. +md2test.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h
  6171. +md2test.o: ../include/openssl/safestack.h ../include/openssl/stack.h
  6172. +md2test.o: ../include/openssl/symhacks.h md2test.c
  6173. md4test.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h
  6174. -md4test.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
  6175. -md4test.o: ../include/openssl/evp.h ../include/openssl/md4.h
  6176. -md4test.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h
  6177. -md4test.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
  6178. -md4test.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h
  6179. -md4test.o: ../include/openssl/stack.h ../include/openssl/symhacks.h md4test.c
  6180. +md4test.o: ../include/openssl/bn.h ../include/openssl/crypto.h
  6181. +md4test.o: ../include/openssl/e_os2.h ../include/openssl/evp.h
  6182. +md4test.o: ../include/openssl/md4.h ../include/openssl/obj_mac.h
  6183. +md4test.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h
  6184. +md4test.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h
  6185. +md4test.o: ../include/openssl/safestack.h ../include/openssl/stack.h
  6186. +md4test.o: ../include/openssl/symhacks.h md4test.c
  6187. md5test.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h
  6188. -md5test.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
  6189. -md5test.o: ../include/openssl/evp.h ../include/openssl/md5.h
  6190. -md5test.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h
  6191. -md5test.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
  6192. -md5test.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h
  6193. -md5test.o: ../include/openssl/stack.h ../include/openssl/symhacks.h md5test.c
  6194. +md5test.o: ../include/openssl/bn.h ../include/openssl/crypto.h
  6195. +md5test.o: ../include/openssl/e_os2.h ../include/openssl/evp.h
  6196. +md5test.o: ../include/openssl/md5.h ../include/openssl/obj_mac.h
  6197. +md5test.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h
  6198. +md5test.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h
  6199. +md5test.o: ../include/openssl/safestack.h ../include/openssl/stack.h
  6200. +md5test.o: ../include/openssl/symhacks.h md5test.c
  6201. mdc2test.o: ../include/openssl/buffer.h ../include/openssl/crypto.h
  6202. mdc2test.o: ../include/openssl/e_os2.h ../include/openssl/opensslconf.h
  6203. mdc2test.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h
  6204. @@ -571,12 +603,13 @@
  6205. rc5test.o: ../include/openssl/safestack.h ../include/openssl/stack.h
  6206. rc5test.o: ../include/openssl/symhacks.h rc5test.c
  6207. rmdtest.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h
  6208. -rmdtest.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
  6209. -rmdtest.o: ../include/openssl/evp.h ../include/openssl/obj_mac.h
  6210. -rmdtest.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h
  6211. -rmdtest.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h
  6212. -rmdtest.o: ../include/openssl/ripemd.h ../include/openssl/safestack.h
  6213. -rmdtest.o: ../include/openssl/stack.h ../include/openssl/symhacks.h rmdtest.c
  6214. +rmdtest.o: ../include/openssl/bn.h ../include/openssl/crypto.h
  6215. +rmdtest.o: ../include/openssl/e_os2.h ../include/openssl/evp.h
  6216. +rmdtest.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h
  6217. +rmdtest.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
  6218. +rmdtest.o: ../include/openssl/ossl_typ.h ../include/openssl/ripemd.h
  6219. +rmdtest.o: ../include/openssl/safestack.h ../include/openssl/stack.h
  6220. +rmdtest.o: ../include/openssl/symhacks.h rmdtest.c
  6221. rsa_test.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h
  6222. rsa_test.o: ../include/openssl/bn.h ../include/openssl/crypto.h
  6223. rsa_test.o: ../include/openssl/e_os2.h ../include/openssl/err.h
  6224. @@ -586,19 +619,21 @@
  6225. rsa_test.o: ../include/openssl/safestack.h ../include/openssl/stack.h
  6226. rsa_test.o: ../include/openssl/symhacks.h rsa_test.c
  6227. sha1test.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h
  6228. -sha1test.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
  6229. -sha1test.o: ../include/openssl/evp.h ../include/openssl/obj_mac.h
  6230. -sha1test.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h
  6231. -sha1test.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h
  6232. -sha1test.o: ../include/openssl/safestack.h ../include/openssl/sha.h
  6233. -sha1test.o: ../include/openssl/stack.h ../include/openssl/symhacks.h sha1test.c
  6234. +sha1test.o: ../include/openssl/bn.h ../include/openssl/crypto.h
  6235. +sha1test.o: ../include/openssl/e_os2.h ../include/openssl/evp.h
  6236. +sha1test.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h
  6237. +sha1test.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
  6238. +sha1test.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h
  6239. +sha1test.o: ../include/openssl/sha.h ../include/openssl/stack.h
  6240. +sha1test.o: ../include/openssl/symhacks.h sha1test.c
  6241. shatest.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h
  6242. -shatest.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
  6243. -shatest.o: ../include/openssl/evp.h ../include/openssl/obj_mac.h
  6244. -shatest.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h
  6245. -shatest.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h
  6246. -shatest.o: ../include/openssl/safestack.h ../include/openssl/sha.h
  6247. -shatest.o: ../include/openssl/stack.h ../include/openssl/symhacks.h shatest.c
  6248. +shatest.o: ../include/openssl/bn.h ../include/openssl/crypto.h
  6249. +shatest.o: ../include/openssl/e_os2.h ../include/openssl/evp.h
  6250. +shatest.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h
  6251. +shatest.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
  6252. +shatest.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h
  6253. +shatest.o: ../include/openssl/sha.h ../include/openssl/stack.h
  6254. +shatest.o: ../include/openssl/symhacks.h shatest.c
  6255. ssltest.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h
  6256. ssltest.o: ../include/openssl/bn.h ../include/openssl/buffer.h
  6257. ssltest.o: ../include/openssl/comp.h ../include/openssl/conf.h
  6258. @@ -618,6 +653,7 @@
  6259. ssltest.o: ../include/openssl/sha.h ../include/openssl/ssl.h
  6260. ssltest.o: ../include/openssl/ssl2.h ../include/openssl/ssl23.h
  6261. ssltest.o: ../include/openssl/ssl3.h ../include/openssl/stack.h
  6262. -ssltest.o: ../include/openssl/symhacks.h ../include/openssl/tls1.h
  6263. +ssltest.o: ../include/openssl/store.h ../include/openssl/symhacks.h
  6264. +ssltest.o: ../include/openssl/tls1.h ../include/openssl/ui.h
  6265. ssltest.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h
  6266. ssltest.o: ../include/openssl/x509v3.h ssltest.c