12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379 |
- /******************************************************************************
- * Filename: hw_aes.h
- * Revised: $Date: 2013-04-12 15:10:54 +0200 (Fri, 12 Apr 2013) $
- * Revision: $Revision: 9735 $
- *
- * Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/
- *
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * Neither the name of Texas Instruments Incorporated nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- ******************************************************************************/
- #ifndef __HW_AES_H__
- #define __HW_AES_H__
- //*****************************************************************************
- //
- // The following are defines for the AES register offsets.
- //
- //*****************************************************************************
- #define AES_DMAC_CH0_CTRL 0x4008B000 // Channel control This register
- // is used for channel enabling and
- // priority selection. When a
- // channel is disabled, it becomes
- // inactive only when all ongoing
- // requests are finished.
- #define AES_DMAC_CH0_EXTADDR 0x4008B004 // Channel external address
- #define AES_DMAC_CH0_DMALENGTH \
- 0x4008B00C // Channel DMA length
- #define AES_DMAC_STATUS 0x4008B018 // DMAC status This register
- // provides the actual state of
- // each DMA channel. It also
- // reports port errors in case
- // these were received by the
- // master interface module during
- // the data transfer.
- #define AES_DMAC_SWRES 0x4008B01C // DMAC software reset register
- // Software reset is used to reset
- // the DMAC to stop all transfers
- // and clears the port error status
- // register. After the software
- // reset is performed, all the
- // channels are disabled and no new
- // requests are performed by the
- // channels. The DMAC waits for the
- // existing (active) requests to
- // finish and accordingly sets the
- // DMAC status registers.
- #define AES_DMAC_CH1_CTRL 0x4008B020 // Channel control This register
- // is used for channel enabling and
- // priority selection. When a
- // channel is disabled, it becomes
- // inactive only when all ongoing
- // requests are finished.
- #define AES_DMAC_CH1_EXTADDR 0x4008B024 // Channel external address
- #define AES_DMAC_CH1_DMALENGTH \
- 0x4008B02C // Channel DMA length
- #define AES_DMAC_MST_RUNPARAMS \
- 0x4008B078 // DMAC master run-time parameters
- // This register defines all the
- // run-time parameters for the AHB
- // master interface port. These
- // parameters are required for the
- // proper functioning of the
- // EIP-101m AHB master adapter.
- #define AES_DMAC_PERSR 0x4008B07C // DMAC port error raw status
- // register This register provides
- // the actual status of individual
- // port errors. It also indicates
- // which channel is serviced by an
- // external AHB port (which is
- // frozen by a port error). A port
- // error aborts operations on all
- // serviced channels (channel
- // enable bit is forced to 0) and
- // prevents further transfers via
- // that port until the error is
- // cleared by writing to the
- // DMAC_SWRES register.
- #define AES_DMAC_OPTIONS 0x4008B0F8 // DMAC options register These
- // registers contain information
- // regarding the different options
- // configured in this DMAC.
- #define AES_DMAC_VERSION 0x4008B0FC // DMAC version register This
- // register contains an indication
- // (or signature) of the EIP type
- // of this DMAC, as well as the
- // hardware version/patch numbers.
- #define AES_KEY_STORE_WRITE_AREA \
- 0x4008B400 // Key store write area register
- // This register defines where the
- // keys should be written in the
- // key store RAM. After writing
- // this register, the key store
- // module is ready to receive the
- // keys through a DMA operation. In
- // case the key data transfer
- // triggered an error in the key
- // store, the error will be
- // available in the interrupt
- // status register after the DMA is
- // finished. The key store
- // write-error is asserted when the
- // programmed/selected area is not
- // completely written. This error
- // is also asserted when the DMA
- // operation writes to ram areas
- // that are not selected. The key
- // store RAM is divided into 8
- // areas of 128 bits. 192-bit keys
- // written in the key store RAM
- // should start on boundaries of
- // 256 bits. This means that
- // writing a 192-bit key to the key
- // store RAM must be done by
- // writing 256 bits of data with
- // the 64 most-significant bits set
- // to 0. These bits are ignored by
- // the AES engine.
- #define AES_KEY_STORE_WRITTEN_AREA \
- 0x4008B404 // Key store written area register
- // This register shows which areas
- // of the key store RAM contain
- // valid written keys. When a new
- // key needs to be written to the
- // key store, on a location that is
- // already occupied by a valid key,
- // this key area must be cleared
- // first. This can be done by
- // writing this register before the
- // new key is written to the key
- // store memory. Attempting to
- // write to a key area that already
- // contains a valid key is not
- // allowed and results in an error.
- #define AES_KEY_STORE_SIZE 0x4008B408 // Key store size register This
- // register defines the size of the
- // keys that are written with DMA.
- // This register should be
- // configured before writing to the
- // KEY_STORE_WRITE_AREA register.
- #define AES_KEY_STORE_READ_AREA \
- 0x4008B40C // Key store read area register
- // This register selects the key
- // store RAM area from where the
- // key needs to be read that will
- // be used for an AES operation.
- // The operation directly starts
- // after writing this register.
- // When the operation is finished,
- // the status of the key store read
- // operation is available in the
- // interrupt status register. Key
- // store read error is asserted
- // when a RAM area is selected
- // which does not contain valid
- // written key.
- #define AES_AES_KEY2_0 0x4008B500 // AES_KEY2_0 / AES_GHASH_H_IN_0
- // Second Key / GHASH Key
- // (internal, but clearable) The
- // following registers are not
- // accessible through the host for
- // reading and writing. They are
- // used to store internally
- // calculated key information and
- // intermediate results. However,
- // when the host performs a write
- // to the any of the respective
- // AES_KEY2_n or AES_KEY3_n
- // addresses, respectively the
- // whole 128-bit AES_KEY2_n or
- // AES_KEY3_n register is cleared
- // to 0s. The AES_GHASH_H_IN_n
- // registers (required for GHASH,
- // which is part of GCM) are mapped
- // to the AES_KEY2_n registers. The
- // (intermediate) authentication
- // result for GCM and CCM is stored
- // in the AES_KEY3_n register.
- #define AES_AES_KEY2_1 0x4008B504 // AES_KEY2_1 / AES_GHASH_H_IN_1
- // Second Key / GHASH Key
- // (internal, but clearable) The
- // following registers are not
- // accessible through the host for
- // reading and writing. They are
- // used to store internally
- // calculated key information and
- // intermediate results. However,
- // when the host performs a write
- // to the any of the respective
- // AES_KEY2_n or AES_KEY3_n
- // addresses, respectively the
- // whole 128-bit AES_KEY2_n or
- // AES_KEY3_n register is cleared
- // to 0s. The AES_GHASH_H_IN_n
- // registers (required for GHASH,
- // which is part of GCM) are mapped
- // to the AES_KEY2_n registers. The
- // (intermediate) authentication
- // result for GCM and CCM is stored
- // in the AES_KEY3_n register.
- #define AES_AES_KEY2_2 0x4008B508 // AES_KEY2_2 / AES_GHASH_H_IN_2
- // Second Key / GHASH Key
- // (internal, but clearable) The
- // following registers are not
- // accessible through the host for
- // reading and writing. They are
- // used to store internally
- // calculated key information and
- // intermediate results. However,
- // when the host performs a write
- // to the any of the respective
- // AES_KEY2_n or AES_KEY3_n
- // addresses, respectively the
- // whole 128-bit AES_KEY2_n or
- // AES_KEY3_n register is cleared
- // to 0s. The AES_GHASH_H_IN_n
- // registers (required for GHASH,
- // which is part of GCM) are mapped
- // to the AES_KEY2_n registers. The
- // (intermediate) authentication
- // result for GCM and CCM is stored
- // in the AES_KEY3_n register.
- #define AES_AES_KEY2_3 0x4008B50C // AES_KEY2_3 / AES_GHASH_H_IN_3
- // Second Key / GHASH Key
- // (internal, but clearable) The
- // following registers are not
- // accessible through the host for
- // reading and writing. They are
- // used to store internally
- // calculated key information and
- // intermediate results. However,
- // when the host performs a write
- // to the any of the respective
- // AES_KEY2_n or AES_KEY3_n
- // addresses, respectively the
- // whole 128-bit AES_KEY2_n or
- // AES_KEY3_n register is cleared
- // to 0s. The AES_GHASH_H_IN_n
- // registers (required for GHASH,
- // which is part of GCM) are mapped
- // to the AES_KEY2_n registers. The
- // (intermediate) authentication
- // result for GCM and CCM is stored
- // in the AES_KEY3_n register.
- #define AES_AES_KEY3_0 0x4008B510 // AES_KEY3_0 / AES_KEY2_4 Third
- // Key / Second Key (internal, but
- // clearable) The following
- // registers are not accessible
- // through the host for reading and
- // writing. They are used to store
- // internally calculated key
- // information and intermediate
- // results. However, when the host
- // performs a write to the any of
- // the respective AES_KEY2_n or
- // AES_KEY3_n addresses,
- // respectively the whole 128-bit
- // AES_KEY2_n or AES_KEY3_n
- // register is cleared to 0s. The
- // AES_GHASH_H_IN_n registers
- // (required for GHASH, which is
- // part of GCM) are mapped to the
- // AES_KEY2_n registers. The
- // (intermediate) authentication
- // result for GCM and CCM is stored
- // in the AES_KEY3_n register.
- #define AES_AES_KEY3_1 0x4008B514 // AES_KEY3_1 / AES_KEY2_5 Third
- // Key / Second Key (internal, but
- // clearable) The following
- // registers are not accessible
- // through the host for reading and
- // writing. They are used to store
- // internally calculated key
- // information and intermediate
- // results. However, when the host
- // performs a write to the any of
- // the respective AES_KEY2_n or
- // AES_KEY3_n addresses,
- // respectively the whole 128-bit
- // AES_KEY2_n or AES_KEY3_n
- // register is cleared to 0s. The
- // AES_GHASH_H_IN_n registers
- // (required for GHASH, which is
- // part of GCM) are mapped to the
- // AES_KEY2_n registers. The
- // (intermediate) authentication
- // result for GCM and CCM is stored
- // in the AES_KEY3_n register.
- #define AES_AES_KEY3_2 0x4008B518 // AES_KEY3_2 / AES_KEY2_6 Third
- // Key / Second Key (internal, but
- // clearable) The following
- // registers are not accessible
- // through the host for reading and
- // writing. They are used to store
- // internally calculated key
- // information and intermediate
- // results. However, when the host
- // performs a write to the any of
- // the respective AES_KEY2_n or
- // AES_KEY3_n addresses,
- // respectively the whole 128-bit
- // AES_KEY2_n or AES_KEY3_n
- // register is cleared to 0s. The
- // AES_GHASH_H_IN_n registers
- // (required for GHASH, which is
- // part of GCM) are mapped to the
- // AES_KEY2_n registers. The
- // (intermediate) authentication
- // result for GCM and CCM is stored
- // in the AES_KEY3_n register.
- #define AES_AES_KEY3_3 0x4008B51C // AES_KEY3_3 / AES_KEY2_7 Third
- // Key / Second Key (internal, but
- // clearable) The following
- // registers are not accessible
- // through the host for reading and
- // writing. They are used to store
- // internally calculated key
- // information and intermediate
- // results. However, when the host
- // performs a write to the any of
- // the respective AES_KEY2_n or
- // AES_KEY3_n addresses,
- // respectively the whole 128-bit
- // AES_KEY2_n or AES_KEY3_n
- // register is cleared to 0s. The
- // AES_GHASH_H_IN_n registers
- // (required for GHASH, which is
- // part of GCM) are mapped to the
- // AES_KEY2_n registers. The
- // (intermediate) authentication
- // result for GCM and CCM is stored
- // in the AES_KEY3_n register.
- #define AES_AES_IV_0 0x4008B540 // AES initialization vector
- // registers These registers are
- // used to provide and read the IV
- // from the AES engine.
- #define AES_AES_IV_1 0x4008B544 // AES initialization vector
- // registers These registers are
- // used to provide and read the IV
- // from the AES engine.
- #define AES_AES_IV_2 0x4008B548 // AES initialization vector
- // registers These registers are
- // used to provide and read the IV
- // from the AES engine.
- #define AES_AES_IV_3 0x4008B54C // AES initialization vector
- // registers These registers are
- // used to provide and read the IV
- // from the AES engine.
- #define AES_AES_CTRL 0x4008B550 // AES input/output buffer control
- // and mode register This register
- // specifies the AES mode of
- // operation for the EIP-120t.
- // Electronic codebook (ECB) mode
- // is automatically selected if
- // bits [28:5] of this register are
- // all 0.
- #define AES_AES_C_LENGTH_0 0x4008B554 // AES crypto length registers
- // (LSW) These registers are used
- // to write the Length values to
- // the EIP-120t. While processing,
- // the length values decrement to
- // 0. If both lengths are 0, the
- // data stream is finished and a
- // new context is requested. For
- // basic AES modes (ECB, CBC, and
- // CTR), a crypto length of 0 can
- // be written if multiple streams
- // need to be processed with the
- // same key. Writing 0 length
- // results in continued data
- // requests until a new context is
- // written. For the other modes
- // (CBC-MAC, GCM, and CCM) no (new)
- // data requests are done if the
- // length decrements to or equals
- // 0. It is advised to write a new
- // length per packet. If the length
- // registers decrement to 0, no new
- // data is processed until a new
- // context or length value is
- // written. When writing a new mode
- // without writing the length
- // registers, the length register
- // values from the previous context
- // is reused.
- #define AES_AES_C_LENGTH_1 0x4008B558 // AES crypto length registers
- // (MSW) These registers are used
- // to write the Length values to
- // the EIP-120t. While processing,
- // the length values decrement to
- // 0. If both lengths are 0, the
- // data stream is finished and a
- // new context is requested. For
- // basic AES modes (ECB, CBC, and
- // CTR), a crypto length of 0 can
- // be written if multiple streams
- // need to be processed with the
- // same key. Writing 0 length
- // results in continued data
- // requests until a new context is
- // written. For the other modes
- // (CBC-MAC, GCM and CCM) no (new)
- // data requests are done if the
- // length decrements to or equals
- // 0. It is advised to write a new
- // length per packet. If the length
- // registers decrement to 0, no new
- // data is processed until a new
- // context or length value is
- // written. When writing a new mode
- // without writing the length
- // registers, the length register
- // values from the previous context
- // is reused.
- #define AES_AES_AUTH_LENGTH 0x4008B55C // Authentication length register
- #define AES_AES_DATA_IN_OUT_0 0x4008B560 // Data input/output registers The
- // data registers are typically
- // accessed through the DMA and not
- // with host writes and/or reads.
- // However, for debugging purposes
- // the data input/output registers
- // can be accessed via host write
- // and read operations. The
- // registers are used to buffer the
- // input/output data blocks to/from
- // the EIP-120t. Note: The data
- // input buffer (AES_DATA_IN_n) and
- // data output buffer
- // (AES_DATA_OUT_n) are mapped to
- // the same address locations.
- // Writes (both DMA and host) to
- // these addresses load the Input
- // Buffer while reads pull from the
- // Output Buffer. Therefore, for
- // write access, the data input
- // buffer is written; for read
- // access, the data output buffer
- // is read. The data input buffer
- // must be written before starting
- // an operation. The data output
- // buffer contains valid data on
- // completion of an operation.
- // Therefore, any 128-bit data
- // block can be split over multiple
- // 32-bit word transfers; these can
- // be mixed with other host
- // transfers over the external
- // interface.
- #define AES_AES_DATA_IN_OUT_1 0x4008B564 // Data Input/Output Registers The
- // data registers are typically
- // accessed via DMA and not with
- // host writes and/or reads.
- // However, for debugging purposes
- // the Data Input/Output Registers
- // can be accessed via host write
- // and read operations. The
- // registers are used to buffer the
- // input/output data blocks to/from
- // the EIP-120t. Note: The data
- // input buffer (AES_DATA_IN_n) and
- // data output buffer
- // (AES_DATA_OUT_n) are mapped to
- // the same address locations.
- // Writes (both DMA and host) to
- // these addresses load the Input
- // Buffer while reads pull from the
- // Output Buffer. Therefore, for
- // write access, the data input
- // buffer is written; for read
- // access, the data output buffer
- // is read. The data input buffer
- // must be written before starting
- // an operation. The data output
- // buffer contains valid data on
- // completion of an operation.
- // Therefore, any 128-bit data
- // block can be split over multiple
- // 32-bit word transfers; these can
- // be mixed with other host
- // transfers over the external
- // interface.
- #define AES_AES_DATA_IN_OUT_2 0x4008B568 // Data Input/Output Registers The
- // data registers are typically
- // accessed via DMA and not with
- // host writes and/or reads.
- // However, for debugging purposes
- // the Data Input/Output Registers
- // can be accessed via host write
- // and read operations. The
- // registers are used to buffer the
- // input/output data blocks to/from
- // the EIP-120t. Note: The data
- // input buffer (AES_DATA_IN_n) and
- // data output buffer
- // (AES_DATA_OUT_n) are mapped to
- // the same address locations.
- // Writes (both DMA and host) to
- // these addresses load the Input
- // Buffer while reads pull from the
- // Output Buffer. Therefore, for
- // write access, the data input
- // buffer is written; for read
- // access, the data output buffer
- // is read. The data input buffer
- // must be written before starting
- // an operation. The data output
- // buffer contains valid data on
- // completion of an operation.
- // Therefore, any 128-bit data
- // block can be split over multiple
- // 32-bit word transfers; these can
- // be mixed with other host
- // transfers over the external
- // interface.
- #define AES_AES_DATA_IN_OUT_3 0x4008B56C // Data Input/Output Registers The
- // data registers are typically
- // accessed via DMA and not with
- // host writes and/or reads.
- // However, for debugging purposes
- // the Data Input/Output Registers
- // can be accessed via host write
- // and read operations. The
- // registers are used to buffer the
- // input/output data blocks to/from
- // the EIP-120t. Note: The data
- // input buffer (AES_DATA_IN_n) and
- // data output buffer
- // (AES_DATA_OUT_n) are mapped to
- // the same address locations.
- // Writes (both DMA and host) to
- // these addresses load the Input
- // Buffer while reads pull from the
- // Output Buffer. Therefore, for
- // write access, the data input
- // buffer is written; for read
- // access, the data output buffer
- // is read. The data input buffer
- // must be written before starting
- // an operation. The data output
- // buffer contains valid data on
- // completion of an operation.
- // Therefore, any 128-bit data
- // block can be split over multiple
- // 32-bit word transfers; these can
- // be mixed with other host
- // transfers over the external
- // interface.
- #define AES_AES_TAG_OUT_0 0x4008B570 // TAG registers The tag registers
- // can be accessed via DMA or
- // directly with host reads. These
- // registers buffer the TAG from
- // the EIP-120t. The registers are
- // shared with the intermediate
- // authentication result registers,
- // but cannot be read until the
- // processing is finished. While
- // processing, a read from these
- // registers returns 0s. If an
- // operation does not return a TAG,
- // reading from these registers
- // returns an IV. If an operation
- // returns a TAG plus an IV and
- // both need to be read by the
- // host, the host must first read
- // the TAG followed by the IV.
- // Reading these in reverse order
- // will return the IV twice.
- #define AES_AES_TAG_OUT_1 0x4008B574 // TAG registers The tag registers
- // can be accessed via DMA or
- // directly with host reads. These
- // registers buffer the TAG from
- // the EIP-120t. The registers are
- // shared with the intermediate
- // authentication result registers,
- // but cannot be read until the
- // processing is finished. While
- // processing, a read from these
- // registers returns 0s. If an
- // operation does not return a TAG,
- // reading from these registers
- // returns an IV. If an operation
- // returns a TAG plus an IV and
- // both need to be read by the
- // host, the host must first read
- // the TAG followed by the IV.
- // Reading these in reverse order
- // returns the IV twice.
- #define AES_AES_TAG_OUT_2 0x4008B578 // TAG registers The tag registers
- // can be accessed via DMA or
- // directly with host reads. These
- // registers buffer the TAG from
- // the EIP-120t. The registers are
- // shared with the intermediate
- // authentication result registers,
- // but cannot be read until the
- // processing is finished. While
- // processing, a read from these
- // registers returns 0s. If an
- // operation does not return a TAG,
- // reading from these registers
- // returns an IV. If an operation
- // returns a TAG plus an IV and
- // both need to be read by the
- // host, the host must first read
- // the TAG followed by the IV.
- // Reading these in reverse order
- // returns the IV twice.
- #define AES_AES_TAG_OUT_3 0x4008B57C // TAG registers The tag registers
- // can be accessed via DMA or
- // directly with host reads. These
- // registers buffer the TAG from
- // the EIP-120t. The registers are
- // shared with the intermediate
- // authentication result registers,
- // but cannot be read until the
- // processing is finished. While
- // processing, a read from these
- // registers returns 0s. If an
- // operation does not return a TAG,
- // reading from these registers
- // returns an IV. If an operation
- // returns a TAG plus an IV and
- // both need to be read by the
- // host, the host must first read
- // the TAG followed by the IV.
- // Reading these in reverse order
- // returns the IV twice.
- #define AES_HASH_DATA_IN_0 0x4008B600 // HASH data input registers The
- // data input registers should be
- // used to provide input data to
- // the hash module through the
- // slave interface.
- #define AES_HASH_DATA_IN_1 0x4008B604 // HASH data input registers The
- // data input registers should be
- // used to provide input data to
- // the hash module through the
- // slave interface.
- #define AES_HASH_DATA_IN_2 0x4008B608 // HASH data input registers The
- // data input registers should be
- // used to provide input data to
- // the hash module through the
- // slave interface.
- #define AES_HASH_DATA_IN_3 0x4008B60C // HASH data input registers The
- // data input registers should be
- // used to provide input data to
- // the hash module through the
- // slave interface.
- #define AES_HASH_DATA_IN_4 0x4008B610 // HASH data input registers The
- // data input registers should be
- // used to provide input data to
- // the hash module through the
- // slave interface.
- #define AES_HASH_DATA_IN_5 0x4008B614 // HASH data input registers The
- // data input registers should be
- // used to provide input data to
- // the hash module through the
- // slave interface.
- #define AES_HASH_DATA_IN_6 0x4008B618 // HASH data input registers The
- // data input registers should be
- // used to provide input data to
- // the hash module through the
- // slave interface.
- #define AES_HASH_DATA_IN_7 0x4008B61C // HASH data input registers The
- // data input registers should be
- // used to provide input data to
- // the hash module through the
- // slave interface.
- #define AES_HASH_DATA_IN_8 0x4008B620 // HASH data input registers The
- // data input registers should be
- // used to provide input data to
- // the hash module through the
- // slave interface.
- #define AES_HASH_DATA_IN_9 0x4008B624 // HASH data input registers The
- // data input registers should be
- // used to provide input data to
- // the hash module through the
- // slave interface.
- #define AES_HASH_DATA_IN_10 0x4008B628 // HASH data input registers The
- // data input registers should be
- // used to provide input data to
- // the hash module through the
- // slave interface.
- #define AES_HASH_DATA_IN_11 0x4008B62C // HASH data input registers The
- // data input registers should be
- // used to provide input data to
- // the hash module through the
- // slave interface.
- #define AES_HASH_DATA_IN_12 0x4008B630 // HASH data input registers The
- // data input registers should be
- // used to provide input data to
- // the hash module through the
- // slave interface.
- #define AES_HASH_DATA_IN_13 0x4008B634 // HASH data input registers The
- // data input registers should be
- // used to provide input data to
- // the hash module through the
- // slave interface.
- #define AES_HASH_DATA_IN_14 0x4008B638 // HASH data input registers The
- // data input registers should be
- // used to provide input data to
- // the hash module through the
- // slave interface.
- #define AES_HASH_DATA_IN_15 0x4008B63C // HASH data input registers The
- // data input registers should be
- // used to provide input data to
- // the hash module through the
- // slave interface.
- #define AES_HASH_IO_BUF_CTRL 0x4008B640 // Input/output buffer control and
- // status register This register
- // pair shares a single address
- // location and contains bits that
- // control and monitor the data
- // flow between the host and the
- // hash engine.
- #define AES_HASH_MODE_IN 0x4008B644 // Hash mode register
- #define AES_HASH_LENGTH_IN_L 0x4008B648 // Hash length register
- #define AES_HASH_LENGTH_IN_H 0x4008B64C // Hash length register
- #define AES_HASH_DIGEST_A 0x4008B650 // Hash digest registers The hash
- // digest registers consist of
- // eight 32-bit registers, named
- // HASH_DIGEST_A to HASH_DIGEST_H.
- // After processing a message, the
- // output digest can be read from
- // these registers. These registers
- // can be written with an
- // intermediate hash result for
- // continued hash operations.
- #define AES_HASH_DIGEST_B 0x4008B654 // Hash digest registers The hash
- // digest registers consist of
- // eight 32-bit registers, named
- // HASH_DIGEST_A to HASH_DIGEST_H.
- // After processing a message, the
- // output digest can be read from
- // these registers. These registers
- // can be written with an
- // intermediate hash result for
- // continued hash operations.
- #define AES_HASH_DIGEST_C 0x4008B658 // Hash digest registers The hash
- // digest registers consist of
- // eight 32-bit registers, named
- // HASH_DIGEST_A to HASH_DIGEST_H.
- // After processing a message, the
- // output digest can be read from
- // these registers. These registers
- // can be written with an
- // intermediate hash result for
- // continued hash operations.
- #define AES_HASH_DIGEST_D 0x4008B65C // Hash digest registers The hash
- // digest registers consist of
- // eight 32-bit registers, named
- // HASH_DIGEST_A to HASH_DIGEST_H.
- // After processing a message, the
- // output digest can be read from
- // these registers. These registers
- // can be written with an
- // intermediate hash result for
- // continued hash operations.
- #define AES_HASH_DIGEST_E 0x4008B660 // Hash digest registers The hash
- // digest registers consist of
- // eight 32-bit registers, named
- // HASH_DIGEST_A to HASH_DIGEST_H.
- // After processing a message, the
- // output digest can be read from
- // these registers. These registers
- // can be written with an
- // intermediate hash result for
- // continued hash operations.
- #define AES_HASH_DIGEST_F 0x4008B664 // Hash digest registers The hash
- // digest registers consist of
- // eight 32-bit registers, named
- // HASH_DIGEST_A to HASH_DIGEST_H.
- // After processing a message, the
- // output digest can be read from
- // these registers. These registers
- // can be written with an
- // intermediate hash result for
- // continued hash operations.
- #define AES_HASH_DIGEST_G 0x4008B668 // Hash digest registers The hash
- // digest registers consist of
- // eight 32-bit registers, named
- // HASH_DIGEST_A to HASH_DIGEST_H.
- // After processing a message, the
- // output digest can be read from
- // these registers. These registers
- // can be written with an
- // intermediate hash result for
- // continued hash operations.
- #define AES_HASH_DIGEST_H 0x4008B66C // Hash digest registers The hash
- // digest registers consist of
- // eight 32-bit registers, named
- // HASH_DIGEST_A to HASH_DIGEST_H.
- // After processing a message, the
- // output digest can be read from
- // these registers. These registers
- // can be written with an
- // intermediate hash result for
- // continued hash operations.
- #define AES_CTRL_ALG_SEL 0x4008B700 // Algorithm select This algorithm
- // selection register configures
- // the internal destination of the
- // DMA controller.
- #define AES_CTRL_PROT_EN 0x4008B704 // Master PROT privileged access
- // enable This register enables the
- // second bit (bit [1]) of the AHB
- // HPROT bus of the AHB master
- // interface when a read action of
- // key(s) is performed on the AHB
- // master interface for writing
- // keys into the store module.
- #define AES_CTRL_SW_RESET 0x4008B740 // Software reset
- #define AES_CTRL_INT_CFG 0x4008B780 // Interrupt configuration
- #define AES_CTRL_INT_EN 0x4008B784 // Interrupt enable
- #define AES_CTRL_INT_CLR 0x4008B788 // Interrupt clear
- #define AES_CTRL_INT_SET 0x4008B78C // Interrupt set
- #define AES_CTRL_INT_STAT 0x4008B790 // Interrupt status
- #define AES_CTRL_OPTIONS 0x4008B7F8 // Options register
- #define AES_CTRL_VERSION 0x4008B7FC // Version register
- //*****************************************************************************
- //
- // The following are defines for the bit fields in the
- // AES_DMAC_CH0_CTRL register.
- //
- //*****************************************************************************
- #define AES_DMAC_CH0_CTRL_PRIO 0x00000002 // Channel priority 0: Low 1: High
- // If both channels have the same
- // priority, access of the channels
- // to the external port is
- // arbitrated using the round robin
- // scheme. If one channel has a
- // high priority and another one
- // low, the channel with the high
- // priority is served first, in
- // case of simultaneous access
- // requests.
- #define AES_DMAC_CH0_CTRL_PRIO_M \
- 0x00000002
- #define AES_DMAC_CH0_CTRL_PRIO_S 1
- #define AES_DMAC_CH0_CTRL_EN 0x00000001 // Channel enable 0: Disabled 1:
- // Enable Note: Disabling an active
- // channel interrupts the DMA
- // operation. The ongoing block
- // transfer completes, but no new
- // transfers are requested.
- #define AES_DMAC_CH0_CTRL_EN_M 0x00000001
- #define AES_DMAC_CH0_CTRL_EN_S 0
- //*****************************************************************************
- //
- // The following are defines for the bit fields in the
- // AES_DMAC_CH0_EXTADDR register.
- //
- //*****************************************************************************
- #define AES_DMAC_CH0_EXTADDR_ADDR_M \
- 0xFFFFFFFF // Channel external address value
- // When read during operation, it
- // holds the last updated external
- // address after being sent to the
- // master interface.
- #define AES_DMAC_CH0_EXTADDR_ADDR_S 0
- //*****************************************************************************
- //
- // The following are defines for the bit fields in the
- // AES_DMAC_CH0_DMALENGTH register.
- //
- //*****************************************************************************
- #define AES_DMAC_CH0_DMALENGTH_DMALEN_M \
- 0x0000FFFF // Channel DMA length in bytes
- // During configuration, this
- // register contains the DMA
- // transfer length in bytes. During
- // operation, it contains the last
- // updated value of the DMA
- // transfer length after being sent
- // to the master interface. Note:
- // Setting this register to a
- // nonzero value starts the
- // transfer if the channel is
- // enabled. Therefore, this
- // register must be written last
- // when setting up a DMA channel.
- #define AES_DMAC_CH0_DMALENGTH_DMALEN_S 0
- //*****************************************************************************
- //
- // The following are defines for the bit fields in the
- // AES_DMAC_STATUS register.
- //
- //*****************************************************************************
- #define AES_DMAC_STATUS_PORT_ERR \
- 0x00020000 // Reflects possible transfer
- // errors on the AHB port.
- #define AES_DMAC_STATUS_PORT_ERR_M \
- 0x00020000
- #define AES_DMAC_STATUS_PORT_ERR_S 17
- #define AES_DMAC_STATUS_CH1_ACT 0x00000002 // A value of 1 indicates that
- // channel 1 is active (DMA
- // transfer on-going).
- #define AES_DMAC_STATUS_CH1_ACT_M \
- 0x00000002
- #define AES_DMAC_STATUS_CH1_ACT_S 1
- #define AES_DMAC_STATUS_CH0_ACT 0x00000001 // A value of 1 indicates that
- // channel 0 is active (DMA
- // transfer on-going).
- #define AES_DMAC_STATUS_CH0_ACT_M \
- 0x00000001
- #define AES_DMAC_STATUS_CH0_ACT_S 0
- //*****************************************************************************
- //
- // The following are defines for the bit fields in the
- // AES_DMAC_SWRES register.
- //
- //*****************************************************************************
- #define AES_DMAC_SWRES_SWRES 0x00000001 // Software reset enable 0 =
- // Disabled 1 = Enabled
- // (self-cleared to 0) Completion
- // of the software reset must be
- // checked through the DMAC_STATUS
- // register.
- #define AES_DMAC_SWRES_SWRES_M 0x00000001
- #define AES_DMAC_SWRES_SWRES_S 0
- //*****************************************************************************
- //
- // The following are defines for the bit fields in the
- // AES_DMAC_CH1_CTRL register.
- //
- //*****************************************************************************
- #define AES_DMAC_CH1_CTRL_PRIO 0x00000002 // Channel priority 0: Low 1: High
- // If both channels have the same
- // priority, access of the channels
- // to the external port is
- // arbitrated using the round robin
- // scheme. If one channel has a
- // high priority and another one
- // low, the channel with the high
- // priority is served first, in
- // case of simultaneous access
- // requests.
- #define AES_DMAC_CH1_CTRL_PRIO_M \
- 0x00000002
- #define AES_DMAC_CH1_CTRL_PRIO_S 1
- #define AES_DMAC_CH1_CTRL_EN 0x00000001 // Channel enable 0: Disabled 1:
- // Enable Note: Disabling an active
- // channel interrupts the DMA
- // operation. The ongoing block
- // transfer completes, but no new
- // transfers are requested.
- #define AES_DMAC_CH1_CTRL_EN_M 0x00000001
- #define AES_DMAC_CH1_CTRL_EN_S 0
- //*****************************************************************************
- //
- // The following are defines for the bit fields in the
- // AES_DMAC_CH1_EXTADDR register.
- //
- //*****************************************************************************
- #define AES_DMAC_CH1_EXTADDR_ADDR_M \
- 0xFFFFFFFF // Channel external address value.
- // When read during operation, it
- // holds the last updated external
- // address after being sent to the
- // master interface.
- #define AES_DMAC_CH1_EXTADDR_ADDR_S 0
- //*****************************************************************************
- //
- // The following are defines for the bit fields in the
- // AES_DMAC_CH1_DMALENGTH register.
- //
- //*****************************************************************************
- #define AES_DMAC_CH1_DMALENGTH_DMALEN_M \
- 0x0000FFFF // Channel DMA length in bytes.
- // During configuration, this
- // register contains the DMA
- // transfer length in bytes. During
- // operation, it contains the last
- // updated value of the DMA
- // transfer length after being sent
- // to the master interface. Note:
- // Setting this register to a
- // nonzero value starts the
- // transfer if the channel is
- // enabled. Therefore, this
- // register must be written last
- // when setting up a DMA channel.
- #define AES_DMAC_CH1_DMALENGTH_DMALEN_S 0
- //*****************************************************************************
- //
- // The following are defines for the bit fields in the
- // AES_DMAC_MST_RUNPARAMS register.
- //
- //*****************************************************************************
- #define AES_DMAC_MST_RUNPARAMS_AHB_MST1_BURST_SIZE_M \
- 0x0000F000 // Maximum burst size that can be
- // performed on the AHB bus 0010b =
- // 4 bytes (default) 0011b = 8
- // bytes 0100b = 16 bytes 0101b =
- // 32 bytes 0110b = 64 bytes Others
- // = Reserved
- #define AES_DMAC_MST_RUNPARAMS_AHB_MST1_BURST_SIZE_S 12
- #define AES_DMAC_MST_RUNPARAMS_AHB_MST1_IDLE_EN \
- 0x00000800 // Idle insertion between
- // consecutive burst transfers on
- // AHB 0: No Idle insertion 1: Idle
- // insertion
- #define AES_DMAC_MST_RUNPARAMS_AHB_MST1_IDLE_EN_M \
- 0x00000800
- #define AES_DMAC_MST_RUNPARAMS_AHB_MST1_IDLE_EN_S 11
- #define AES_DMAC_MST_RUNPARAMS_AHB_MST1_INCR_EN \
- 0x00000400 // Burst length type of AHB
- // transfer 0: Unspecified length
- // burst transfers 1: Fixed length
- // burst or single transfers
- #define AES_DMAC_MST_RUNPARAMS_AHB_MST1_INCR_EN_M \
- 0x00000400
- #define AES_DMAC_MST_RUNPARAMS_AHB_MST1_INCR_EN_S 10
- #define AES_DMAC_MST_RUNPARAMS_AHB_MST1_LOCK_EN \
- 0x00000200 // Locked transform on AHB 0:
- // Transfers are not locked 1:
- // Transfers are locked
- #define AES_DMAC_MST_RUNPARAMS_AHB_MST1_LOCK_EN_M \
- 0x00000200
- #define AES_DMAC_MST_RUNPARAMS_AHB_MST1_LOCK_EN_S 9
- #define AES_DMAC_MST_RUNPARAMS_AHB_MST1_BIGEND \
- 0x00000100 // Endianess for the AHB master 0:
- // Little endian 1: Big endian
- #define AES_DMAC_MST_RUNPARAMS_AHB_MST1_BIGEND_M \
- 0x00000100
- #define AES_DMAC_MST_RUNPARAMS_AHB_MST1_BIGEND_S 8
- //*****************************************************************************
- //
- // The following are defines for the bit fields in the
- // AES_DMAC_PERSR register.
- //
- //*****************************************************************************
- #define AES_DMAC_PERSR_PORT1_AHB_ERROR \
- 0x00001000 // A value of 1 indicates that the
- // EIP-101 has detected an AHB bus
- // error
- #define AES_DMAC_PERSR_PORT1_AHB_ERROR_M \
- 0x00001000
- #define AES_DMAC_PERSR_PORT1_AHB_ERROR_S 12
- #define AES_DMAC_PERSR_PORT1_CHANNEL \
- 0x00000200 // Indicates which channel has
- // serviced last (channel 0 or
- // channel 1) by AHB master port.
- #define AES_DMAC_PERSR_PORT1_CHANNEL_M \
- 0x00000200
- #define AES_DMAC_PERSR_PORT1_CHANNEL_S 9
- //*****************************************************************************
- //
- // The following are defines for the bit fields in the
- // AES_DMAC_OPTIONS register.
- //
- //*****************************************************************************
- #define AES_DMAC_OPTIONS_NR_OF_CHANNELS_M \
- 0x00000F00 // Number of channels implemented,
- // value in the range 1-8.
- #define AES_DMAC_OPTIONS_NR_OF_CHANNELS_S 8
- #define AES_DMAC_OPTIONS_NR_OF_PORTS_M \
- 0x00000007 // Number of ports implemented,
- // value in range 1-4.
- #define AES_DMAC_OPTIONS_NR_OF_PORTS_S 0
- //*****************************************************************************
- //
- // The following are defines for the bit fields in the
- // AES_DMAC_VERSION register.
- //
- //*****************************************************************************
- #define AES_DMAC_VERSION_HW_MAJOR_VERSION_M \
- 0x0F000000 // Major version number
- #define AES_DMAC_VERSION_HW_MAJOR_VERSION_S 24
- #define AES_DMAC_VERSION_HW_MINOR_VERSION_M \
- 0x00F00000 // Minor version number
- #define AES_DMAC_VERSION_HW_MINOR_VERSION_S 20
- #define AES_DMAC_VERSION_HW_PATCH_LEVEL_M \
- 0x000F0000 // Patch level Starts at 0 at
- // first delivery of this version
- #define AES_DMAC_VERSION_HW_PATCH_LEVEL_S 16
- #define AES_DMAC_VERSION_EIP_NUMBER_COMPL_M \
- 0x0000FF00 // Bit-by-bit complement of the
- // EIP_NUMBER field bits.
- #define AES_DMAC_VERSION_EIP_NUMBER_COMPL_S 8
- #define AES_DMAC_VERSION_EIP_NUMBER_M \
- 0x000000FF // Binary encoding of the
- // EIP-number of this DMA
- // controller (209)
- #define AES_DMAC_VERSION_EIP_NUMBER_S 0
- //*****************************************************************************
- //
- // The following are defines for the bit fields in the
- // AES_KEY_STORE_WRITE_AREA register.
- //
- //*****************************************************************************
- #define AES_KEY_STORE_WRITE_AREA_RAM_AREA7 \
- 0x00000080 // Each RAM_AREAx represents an
- // area of 128 bits. Select the key
- // store RAM area(s) where the
- // key(s) needs to be written 0:
- // RAM_AREA7 is not selected to be
- // written. 1: RAM_AREA7 is
- // selected to be written. Writing
- // to multiple RAM locations is
- // possible only when the selected
- // RAM areas are sequential. Keys
- // that require more than one RAM
- // locations (key size is 192 or
- // 256 bits), must start at one of
- // the following areas: RAM_AREA0,
- // RAM_AREA2, RAM_AREA4, or
- // RAM_AREA6.
- #define AES_KEY_STORE_WRITE_AREA_RAM_AREA7_M \
- 0x00000080
- #define AES_KEY_STORE_WRITE_AREA_RAM_AREA7_S 7
- #define AES_KEY_STORE_WRITE_AREA_RAM_AREA6 \
- 0x00000040 // Each RAM_AREAx represents an
- // area of 128 bits. Select the key
- // store RAM area(s) where the
- // key(s) needs to be written 0:
- // RAM_AREA6 is not selected to be
- // written. 1: RAM_AREA6 is
- // selected to be written. Writing
- // to multiple RAM locations is
- // possible only when the selected
- // RAM areas are sequential. Keys
- // that require more than one RAM
- // locations (key size is 192 or
- // 256 bits), must start at one of
- // the following areas: RAM_AREA0,
- // RAM_AREA2, RAM_AREA4, or
- // RAM_AREA6.
- #define AES_KEY_STORE_WRITE_AREA_RAM_AREA6_M \
- 0x00000040
- #define AES_KEY_STORE_WRITE_AREA_RAM_AREA6_S 6
- #define AES_KEY_STORE_WRITE_AREA_RAM_AREA5 \
- 0x00000020 // Each RAM_AREAx represents an
- // area of 128 bits. Select the key
- // store RAM area(s) where the
- // key(s) needs to be written 0:
- // RAM_AREA5 is not selected to be
- // written. 1: RAM_AREA5 is
- // selected to be written. Writing
- // to multiple RAM locations is
- // possible only when the selected
- // RAM areas are sequential. Keys
- // that require more than one RAM
- // locations (key size is 192 or
- // 256 bits), must start at one of
- // the following areas: RAM_AREA0,
- // RAM_AREA2, RAM_AREA4, or
- // RAM_AREA6.
- #define AES_KEY_STORE_WRITE_AREA_RAM_AREA5_M \
- 0x00000020
- #define AES_KEY_STORE_WRITE_AREA_RAM_AREA5_S 5
- #define AES_KEY_STORE_WRITE_AREA_RAM_AREA4 \
- 0x00000010 // Each RAM_AREAx represents an
- // area of 128 bits. Select the key
- // store RAM area(s) where the
- // key(s) needs to be written 0:
- // RAM_AREA4 is not selected to be
- // written. 1: RAM_AREA4 is
- // selected to be written. Writing
- // to multiple RAM locations is
- // possible only when the selected
- // RAM areas are sequential. Keys
- // that require more than one RAM
- // locations (key size is 192 or
- // 256 bits), must start at one of
- // the following areas: RAM_AREA0,
- // RAM_AREA2, RAM_AREA4, or
- // RAM_AREA6.
- #define AES_KEY_STORE_WRITE_AREA_RAM_AREA4_M \
- 0x00000010
- #define AES_KEY_STORE_WRITE_AREA_RAM_AREA4_S 4
- #define AES_KEY_STORE_WRITE_AREA_RAM_AREA3 \
- 0x00000008 // Each RAM_AREAx represents an
- // area of 128 bits. Select the key
- // store RAM area(s) where the
- // key(s) needs to be written 0:
- // RAM_AREA3 is not selected to be
- // written. 1: RAM_AREA3 is
- // selected to be written. Writing
- // to multiple RAM locations is
- // possible only when the selected
- // RAM areas are sequential. Keys
- // that require more than one RAM
- // locations (key size is 192 or
- // 256 bits), must start at one of
- // the following areas: RAM_AREA0,
- // RAM_AREA2, RAM_AREA4, or
- // RAM_AREA6.
- #define AES_KEY_STORE_WRITE_AREA_RAM_AREA3_M \
- 0x00000008
- #define AES_KEY_STORE_WRITE_AREA_RAM_AREA3_S 3
- #define AES_KEY_STORE_WRITE_AREA_RAM_AREA2 \
- 0x00000004 // Each RAM_AREAx represents an
- // area of 128 bits. Select the key
- // store RAM area(s) where the
- // key(s) needs to be written 0:
- // RAM_AREA2 is not selected to be
- // written. 1: RAM_AREA2 is
- // selected to be written. Writing
- // to multiple RAM locations is
- // possible only when the selected
- // RAM areas are sequential. Keys
- // that require more than one RAM
- // locations (key size is 192 or
- // 256 bits), must start at one of
- // the following areas: RAM_AREA0,
- // RAM_AREA2, RAM_AREA4, or
- // RAM_AREA6.
- #define AES_KEY_STORE_WRITE_AREA_RAM_AREA2_M \
- 0x00000004
- #define AES_KEY_STORE_WRITE_AREA_RAM_AREA2_S 2
- #define AES_KEY_STORE_WRITE_AREA_RAM_AREA1 \
- 0x00000002 // Each RAM_AREAx represents an
- // area of 128 bits. Select the key
- // store RAM area(s) where the
- // key(s) needs to be written 0:
- // RAM_AREA1 is not selected to be
- // written. 1: RAM_AREA1 is
- // selected to be written. Writing
- // to multiple RAM locations is
- // possible only when the selected
- // RAM areas are sequential. Keys
- // that require more than one RAM
- // locations (key size is 192 or
- // 256 bits), must start at one of
- // the following areas: RAM_AREA0,
- // RAM_AREA2, RAM_AREA4, or
- // RAM_AREA6.
- #define AES_KEY_STORE_WRITE_AREA_RAM_AREA1_M \
- 0x00000002
- #define AES_KEY_STORE_WRITE_AREA_RAM_AREA1_S 1
- #define AES_KEY_STORE_WRITE_AREA_RAM_AREA0 \
- 0x00000001 // Each RAM_AREAx represents an
- // area of 128 bits. Select the key
- // store RAM area(s) where the
- // key(s) needs to be written 0:
- // RAM_AREA0 is not selected to be
- // written. 1: RAM_AREA0 is
- // selected to be written. Writing
- // to multiple RAM locations is
- // possible only when the selected
- // RAM areas are sequential. Keys
- // that require more than one RAM
- // locations (key size is 192 or
- // 256 bits), must start at one of
- // the following areas: RAM_AREA0,
- // RAM_AREA2, RAM_AREA4, or
- // RAM_AREA6.
- #define AES_KEY_STORE_WRITE_AREA_RAM_AREA0_M \
- 0x00000001
- #define AES_KEY_STORE_WRITE_AREA_RAM_AREA0_S 0
- //*****************************************************************************
- //
- // The following are defines for the bit fields in the
- // AES_KEY_STORE_WRITTEN_AREA register.
- //
- //*****************************************************************************
- #define AES_KEY_STORE_WRITTEN_AREA_RAM_AREA_WRITTEN7 \
- 0x00000080 // Read operation: 0: This RAM
- // area is not written with valid
- // key information. 1: This RAM
- // area is written with valid key
- // information. Each individual
- // ram_area_writtenx bit can be
- // reset by writing 1. Note: This
- // register is reset on a soft
- // reset from the master control
- // module. After a soft reset, all
- // keys must be rewritten to the
- // key store memory.
- #define AES_KEY_STORE_WRITTEN_AREA_RAM_AREA_WRITTEN7_M \
- 0x00000080
- #define AES_KEY_STORE_WRITTEN_AREA_RAM_AREA_WRITTEN7_S 7
- #define AES_KEY_STORE_WRITTEN_AREA_RAM_AREA_WRITTEN6 \
- 0x00000040 // Read operation: 0: This RAM
- // area is not written with valid
- // key information. 1: This RAM
- // area is written with valid key
- // information. Each individual
- // ram_area_writtenx bit can be
- // reset by writing 1. Note: This
- // register is reset on a soft
- // reset from the master control
- // module. After a soft reset, all
- // keys must be rewritten to the
- // key store memory.
- #define AES_KEY_STORE_WRITTEN_AREA_RAM_AREA_WRITTEN6_M \
- 0x00000040
- #define AES_KEY_STORE_WRITTEN_AREA_RAM_AREA_WRITTEN6_S 6
- #define AES_KEY_STORE_WRITTEN_AREA_RAM_AREA_WRITTEN5 \
- 0x00000020 // Read operation: 0: This RAM
- // area is not written with valid
- // key information. 1: This RAM
- // area is written with valid key
- // information. Each individual
- // ram_area_writtenx bit can be
- // reset by writing 1. Note: This
- // register is reset on a soft
- // reset from the master control
- // module. After a soft reset, all
- // keys must be rewritten to the
- // key store memory.
- #define AES_KEY_STORE_WRITTEN_AREA_RAM_AREA_WRITTEN5_M \
- 0x00000020
- #define AES_KEY_STORE_WRITTEN_AREA_RAM_AREA_WRITTEN5_S 5
- #define AES_KEY_STORE_WRITTEN_AREA_RAM_AREA_WRITTEN4 \
- 0x00000010 // Read operation: 0: This RAM
- // area is not written with valid
- // key information. 1: This RAM
- // area is written with valid key
- // information. Each individual
- // ram_area_writtenx bit can be
- // reset by writing 1. Note: This
- // register is reset on a soft
- // reset from the master control
- // module. After a soft reset, all
- // keys must be rewritten to the
- // key store memory.
- #define AES_KEY_STORE_WRITTEN_AREA_RAM_AREA_WRITTEN4_M \
- 0x00000010
- #define AES_KEY_STORE_WRITTEN_AREA_RAM_AREA_WRITTEN4_S 4
- #define AES_KEY_STORE_WRITTEN_AREA_RAM_AREA_WRITTEN3 \
- 0x00000008 // Read operation: 0: This RAM
- // area is not written with valid
- // key information. 1: This RAM
- // area is written with valid key
- // information. Each individual
- // ram_area_writtenx bit can be
- // reset by writing 1. Note: This
- // register is reset on a soft
- // reset from the master control
- // module. After a soft reset, all
- // keys must be rewritten to the
- // key store memory.
- #define AES_KEY_STORE_WRITTEN_AREA_RAM_AREA_WRITTEN3_M \
- 0x00000008
- #define AES_KEY_STORE_WRITTEN_AREA_RAM_AREA_WRITTEN3_S 3
- #define AES_KEY_STORE_WRITTEN_AREA_RAM_AREA_WRITTEN2 \
- 0x00000004 // Read operation: 0: This RAM
- // area is not written with valid
- // key information. 1: This RAM
- // area is written with valid key
- // information. Each individual
- // ram_area_writtenx bit can be
- // reset by writing 1. Note: This
- // register is reset on a soft
- // reset from the master control
- // module. After a soft reset, all
- // keys must be rewritten to the
- // key store memory.
- #define AES_KEY_STORE_WRITTEN_AREA_RAM_AREA_WRITTEN2_M \
- 0x00000004
- #define AES_KEY_STORE_WRITTEN_AREA_RAM_AREA_WRITTEN2_S 2
- #define AES_KEY_STORE_WRITTEN_AREA_RAM_AREA_WRITTEN1 \
- 0x00000002 // Read operation: 0: This RAM
- // area is not written with valid
- // key information. 1: This RAM
- // area is written with valid key
- // information. Each individual
- // ram_area_writtenx bit can be
- // reset by writing 1. Note: This
- // register is reset on a soft
- // reset from the master control
- // module. After a soft reset, all
- // keys must be rewritten to the
- // key store memory.
- #define AES_KEY_STORE_WRITTEN_AREA_RAM_AREA_WRITTEN1_M \
- 0x00000002
- #define AES_KEY_STORE_WRITTEN_AREA_RAM_AREA_WRITTEN1_S 1
- #define AES_KEY_STORE_WRITTEN_AREA_RAM_AREA_WRITTEN0 \
- 0x00000001 // Read operation: 0: This RAM
- // area is not written with valid
- // key information. 1: This RAM
- // area is written with valid key
- // information. Each individual
- // ram_area_writtenx bit can be
- // reset by writing 1. Note: This
- // register is reset on a soft
- // reset from the master control
- // module. After a soft reset, all
- // keys must be rewritten to the
- // key store memory.
- #define AES_KEY_STORE_WRITTEN_AREA_RAM_AREA_WRITTEN0_M \
- 0x00000001
- #define AES_KEY_STORE_WRITTEN_AREA_RAM_AREA_WRITTEN0_S 0
- //*****************************************************************************
- //
- // The following are defines for the bit fields in the
- // AES_KEY_STORE_SIZE register.
- //
- //*****************************************************************************
- #define AES_KEY_STORE_SIZE_KEY_SIZE_M \
- 0x00000003 // Key size: 00: Reserved 01: 128
- // bits 10: 192 bits 11: 256 bits
- // When writing this to this
- // register, the
- // KEY_STORE_WRITTEN_AREA register
- // is reset.
- #define AES_KEY_STORE_SIZE_KEY_SIZE_S 0
- //*****************************************************************************
- //
- // The following are defines for the bit fields in the
- // AES_KEY_STORE_READ_AREA register.
- //
- //*****************************************************************************
- #define AES_KEY_STORE_READ_AREA_BUSY \
- 0x80000000 // Key store operation busy status
- // flag (read only): 0: Operation
- // is complete. 1: Operation is not
- // completed and the key store is
- // busy.
- #define AES_KEY_STORE_READ_AREA_BUSY_M \
- 0x80000000
- #define AES_KEY_STORE_READ_AREA_BUSY_S 31
- #define AES_KEY_STORE_READ_AREA_RAM_AREA_M \
- 0x0000000F // Selects the area of the key
- // store RAM from where the key
- // needs to be read that will be
- // writen to the AES engine
- // RAM_AREA: 0000: RAM_AREA0 0001:
- // RAM_AREA1 0010: RAM_AREA2 0011:
- // RAM_AREA3 0100: RAM_AREA4 0101:
- // RAM_AREA5 0110: RAM_AREA6 0111:
- // RAM_AREA7 1000: no RAM area
- // selected 1001-1111: Reserved RAM
- // areas RAM_AREA0, RAM_AREA2,
- // RAM_AREA4 and RAM_AREA6 are the
- // only valid read areas for 192
- // and 256 bits key sizes. Only RAM
- // areas that contain valid written
- // keys can be selected.
- #define AES_KEY_STORE_READ_AREA_RAM_AREA_S 0
- //*****************************************************************************
- //
- // The following are defines for the bit fields in the
- // AES_AES_KEY2_0 register.
- //
- //*****************************************************************************
- #define AES_AES_KEY2_0_AES_KEY2_M \
- 0xFFFFFFFF // AES_KEY2/AES_GHASH_H[31:0] For
- // GCM: -[127:0] - GHASH_H - The
- // internally calculated GHASH key
- // is stored in these registers.
- // Only used for modes that use the
- // GHASH function (GCM). -[255:128]
- // - This register is used to store
- // intermediate values and is
- // initialized with 0s when loading
- // a new key. For CCM: -[255:0] -
- // This register is used to store
- // intermediate values. For
- // CBC-MAC: -[255:0] - ZEROES -
- // This register must remain 0.
- #define AES_AES_KEY2_0_AES_KEY2_S 0
- //*****************************************************************************
- //
- // The following are defines for the bit fields in the
- // AES_AES_KEY2_1 register.
- //
- //*****************************************************************************
- #define AES_AES_KEY2_1_AES_KEY2_M \
- 0xFFFFFFFF // AES_KEY2/AES_GHASH_H[63:32] For
- // GCM: -[127:0] - GHASH_H - The
- // internally calculated GHASH key
- // is stored in these registers.
- // Only used for modes that use the
- // GHASH function (GCM). -[255:128]
- // - This register is used to store
- // intermediate values and is
- // initialized with 0s when loading
- // a new key. For CCM: -[255:0] -
- // This register is used to store
- // intermediate values. For
- // CBC-MAC: -[255:0] - ZEROES -
- // This register must remain 0.
- #define AES_AES_KEY2_1_AES_KEY2_S 0
- //*****************************************************************************
- //
- // The following are defines for the bit fields in the
- // AES_AES_KEY2_2 register.
- //
- //*****************************************************************************
- #define AES_AES_KEY2_2_AES_KEY2_M \
- 0xFFFFFFFF // AES_KEY2/AES_GHASH_H[95:64] For
- // GCM: -[127:0] - GHASH_H - The
- // internally calculated GHASH key
- // is stored in these registers.
- // Only used for modes that use the
- // GHASH function (GCM). -[255:128]
- // - This register is used to store
- // intermediate values and is
- // initialized with 0s when loading
- // a new key. For CCM: -[255:0] -
- // This register is used to store
- // intermediate values. For
- // CBC-MAC: -[255:0] - ZEROES -
- // This register must remain 0.
- #define AES_AES_KEY2_2_AES_KEY2_S 0
- //*****************************************************************************
- //
- // The following are defines for the bit fields in the
- // AES_AES_KEY2_3 register.
- //
- //*****************************************************************************
- #define AES_AES_KEY2_3_AES_KEY2_M \
- 0xFFFFFFFF // AES_KEY2/AES_GHASH_H[127:96]
- // For GCM: -[127:0] - GHASH_H -
- // The internally calculated GHASH
- // key is stored in these
- // registers. Only used for modes
- // that use the GHASH function
- // (GCM). -[255:128] - This
- // register is used to store
- // intermediate values and is
- // initialized with 0s when loading
- // a new key. For CCM: -[255:0] -
- // This register is used to store
- // intermediate values. For
- // CBC-MAC: -[255:0] - ZEROES -
- // This register must remain 0.
- #define AES_AES_KEY2_3_AES_KEY2_S 0
- //*****************************************************************************
- //
- // The following are defines for the bit fields in the
- // AES_AES_KEY3_0 register.
- //
- //*****************************************************************************
- #define AES_AES_KEY3_0_AES_KEY3_M \
- 0xFFFFFFFF //
- // AES_KEY3[31:0]/AES_KEY2[159:128]
- // For GCM: -[127:0] - GHASH_H -
- // The internally calculated GHASH
- // key is stored in these
- // registers. Only used for modes
- // that use the GHASH function
- // (GCM). -[255:128] - This
- // register is used to store
- // intermediate values and is
- // initialized with 0s when loading
- // a new key. For CCM: -[255:0] -
- // This register is used to store
- // intermediate values. For
- // CBC-MAC: -[255:0] - ZEROES -
- // This register must remain 0.
- #define AES_AES_KEY3_0_AES_KEY3_S 0
- //*****************************************************************************
- //
- // The following are defines for the bit fields in the
- // AES_AES_KEY3_1 register.
- //
- //*****************************************************************************
- #define AES_AES_KEY3_1_AES_KEY3_M \
- 0xFFFFFFFF //
- // AES_KEY3[63:32]/AES_KEY2[191:160]
- // For GCM: -[127:0] - GHASH_H -
- // The internally calculated GHASH
- // key is stored in these
- // registers. Only used for modes
- // that use the GHASH function
- // (GCM). -[255:128] - This
- // register is used to store
- // intermediate values and is
- // initialized with 0s when loading
- // a new key. For CCM: -[255:0] -
- // This register is used to store
- // intermediate values. For
- // CBC-MAC: -[255:0] - ZEROES -
- // This register must remain 0.
- #define AES_AES_KEY3_1_AES_KEY3_S 0
- //*****************************************************************************
- //
- // The following are defines for the bit fields in the
- // AES_AES_KEY3_2 register.
- //
- //*****************************************************************************
- #define AES_AES_KEY3_2_AES_KEY3_M \
- 0xFFFFFFFF //
- // AES_KEY3[95:64]/AES_KEY2[223:192]
- // For GCM: -[127:0] - GHASH_H -
- // The internally calculated GHASH
- // key is stored in these
- // registers. Only used for modes
- // that use the GHASH function
- // (GCM). -[255:128] - This
- // register is used to store
- // intermediate values and is
- // initialized with 0s when loading
- // a new key. For CCM: -[255:0] -
- // This register is used to store
- // intermediate values. For
- // CBC-MAC: -[255:0] - ZEROES -
- // This register must remain 0.
- #define AES_AES_KEY3_2_AES_KEY3_S 0
- //*****************************************************************************
- //
- // The following are defines for the bit fields in the
- // AES_AES_KEY3_3 register.
- //
- //*****************************************************************************
- #define AES_AES_KEY3_3_AES_KEY3_M \
- 0xFFFFFFFF //
- // AES_KEY3[127:96]/AES_KEY2[255:224]
- // For GCM: -[127:0] - GHASH_H -
- // The internally calculated GHASH
- // key is stored in these
- // registers. Only used for modes
- // that use the GHASH function
- // (GCM). -[255:128] - This
- // register is used to store
- // intermediate values and is
- // initialized with 0s when loading
- // a new key. For CCM: -[255:0] -
- // This register is used to store
- // intermediate values. For
- // CBC-MAC: -[255:0] - ZEROES -
- // This register must remain 0.
- #define AES_AES_KEY3_3_AES_KEY3_S 0
- //*****************************************************************************
- //
- // The following are defines for the bit fields in the AES_AES_IV_0 register.
- //
- //*****************************************************************************
- #define AES_AES_IV_0_AES_IV_M 0xFFFFFFFF // AES_IV[31:0] Initialization
- // vector Used for regular non-ECB
- // modes (CBC/CTR): -[127:0] -
- // AES_IV - For regular AES
- // operations (CBC and CTR) these
- // registers must be written with a
- // new 128-bit IV. After an
- // operation, these registers
- // contain the latest 128-bit
- // result IV, generated by the
- // EIP-120t. If CTR mode is
- // selected, this value is
- // incremented with 0x1: After
- // first use - When a new data
- // block is submitted to the engine
- // For GCM: -[127:0] - AES_IV - For
- // GCM operations, these registers
- // must be written with a new
- // 128-bit IV. After an operation,
- // these registers contain the
- // updated 128-bit result IV,
- // generated by the EIP-120t. Note
- // that bits [127:96] of the IV
- // represent the initial counter
- // value (which is 1 for GCM) and
- // must therefore be initialized to
- // 0x01000000. This value is
- // incremented with 0x1: After
- // first use - When a new data
- // block is submitted to the
- // engine. For CCM: -[127:0] - A0:
- // For CCM this field must be
- // written with value A0, this
- // value is the concatenation of:
- // A0-flags (5-bits of 0 and 3-bits
- // 'L'), Nonce and counter value.
- // 'L' must be a copy from the 'L'
- // value of the AES_CTRL register.
- // This 'L' indicates the width of
- // the Nonce and counter. The
- // loaded counter must be
- // initialized to 0. The total
- // width of A0 is 128-bit. For
- // CBC-MAC: -[127:0] - Zeroes - For
- // CBC-MAC this register must be
- // written with 0s at the start of
- // each operation. After an
- // operation, these registers
- // contain the 128-bit TAG output,
- // generated by the EIP-120t.
- #define AES_AES_IV_0_AES_IV_S 0
- //*****************************************************************************
- //
- // The following are defines for the bit fields in the AES_AES_IV_1 register.
- //
- //*****************************************************************************
- #define AES_AES_IV_1_AES_IV_M 0xFFFFFFFF // AES_IV[63:32] Initialization
- // vector Used for regular non-ECB
- // modes (CBC/CTR): -[127:0] -
- // AES_IV - For regular AES
- // operations (CBC and CTR) these
- // registers must be written with a
- // new 128-bit IV. After an
- // operation, these registers
- // contain the latest 128-bit
- // result IV, generated by the
- // EIP-120t. If CTR mode is
- // selected, this value is
- // incremented with 0x1: After
- // first use - When a new data
- // block is submitted to the engine
- // For GCM: -[127:0] - AES_IV - For
- // GCM operations, these registers
- // must be written with a new
- // 128-bit IV. After an operation,
- // these registers contain the
- // updated 128-bit result IV,
- // generated by the EIP-120t. Note
- // that bits [127:96] of the IV
- // represent the initial counter
- // value (which is 1 for GCM) and
- // must therefore be initialized to
- // 0x01000000. This value is
- // incremented with 0x1: After
- // first use - When a new data
- // block is submitted to the
- // engine. For CCM: -[127:0] - A0:
- // For CCM this field must be
- // written with value A0, this
- // value is the concatenation of:
- // A0-flags (5-bits of 0 and 3-bits
- // 'L'), Nonce and counter value.
- // 'L' must be a copy from the 'L'
- // value of the AES_CTRL register.
- // This 'L' indicates the width of
- // the Nonce and counter. The
- // loaded counter must be
- // initialized to 0. The total
- // width of A0 is 128-bit. For
- // CBC-MAC: -[127:0] - Zeroes - For
- // CBC-MAC this register must be
- // written with 0s at the start of
- // each operation. After an
- // operation, these registers
- // contain the 128-bit TAG output,
- // generated by the EIP-120t.
- #define AES_AES_IV_1_AES_IV_S 0
- //*****************************************************************************
- //
- // The following are defines for the bit fields in the AES_AES_IV_2 register.
- //
- //*****************************************************************************
- #define AES_AES_IV_2_AES_IV_M 0xFFFFFFFF // AES_IV[95:64] Initialization
- // vector Used for regular non-ECB
- // modes (CBC/CTR): -[127:0] -
- // AES_IV - For regular AES
- // operations (CBC and CTR) these
- // registers must be written with a
- // new 128-bit IV. After an
- // operation, these registers
- // contain the latest 128-bit
- // result IV, generated by the
- // EIP-120t. If CTR mode is
- // selected, this value is
- // incremented with 0x1: After
- // first use - When a new data
- // block is submitted to the engine
- // For GCM: -[127:0] - AES_IV - For
- // GCM operations, these registers
- // must be written with a new
- // 128-bit IV. After an operation,
- // these registers contain the
- // updated 128-bit result IV,
- // generated by the EIP-120t. Note
- // that bits [127:96] of the IV
- // represent the initial counter
- // value (which is 1 for GCM) and
- // must therefore be initialized to
- // 0x01000000. This value is
- // incremented with 0x1: After
- // first use - When a new data
- // block is submitted to the
- // engine. For CCM: -[127:0] - A0:
- // For CCM this field must be
- // written with value A0, this
- // value is the concatenation of:
- // A0-flags (5-bits of 0 and 3-bits
- // 'L'), Nonce and counter value.
- // 'L' must be a copy from the 'L'
- // value of the AES_CTRL register.
- // This 'L' indicates the width of
- // the Nonce and counter. The
- // loaded counter must be
- // initialized to 0. The total
- // width of A0 is 128-bit. For
- // CBC-MAC: -[127:0] - Zeroes - For
- // CBC-MAC this register must be
- // written with 0s at the start of
- // each operation. After an
- // operation, these registers
- // contain the 128-bit TAG output,
- // generated by the EIP-120t.
- #define AES_AES_IV_2_AES_IV_S 0
- //*****************************************************************************
- //
- // The following are defines for the bit fields in the AES_AES_IV_3 register.
- //
- //*****************************************************************************
- #define AES_AES_IV_3_AES_IV_M 0xFFFFFFFF // AES_IV[127:96] Initialization
- // vector Used for regular non-ECB
- // modes (CBC/CTR): -[127:0] -
- // AES_IV - For regular AES
- // operations (CBC and CTR) these
- // registers must be written with a
- // new 128-bit IV. After an
- // operation, these registers
- // contain the latest 128-bit
- // result IV, generated by the
- // EIP-120t. If CTR mode is
- // selected, this value is
- // incremented with 0x1: After
- // first use - When a new data
- // block is submitted to the engine
- // For GCM: -[127:0] - AES_IV - For
- // GCM operations, these registers
- // must be written with a new
- // 128-bit IV. After an operation,
- // these registers contain the
- // updated 128-bit result IV,
- // generated by the EIP-120t. Note
- // that bits [127:96] of the IV
- // represent the initial counter
- // value (which is 1 for GCM) and
- // must therefore be initialized to
- // 0x01000000. This value is
- // incremented with 0x1: After
- // first use - When a new data
- // block is submitted to the
- // engine. For CCM: -[127:0] - A0:
- // For CCM this field must be
- // written with value A0, this
- // value is the concatenation of:
- // A0-flags (5-bits of 0 and 3-bits
- // 'L'), Nonce and counter value.
- // 'L' must be a copy from the 'L'
- // value of the AES_CTRL register.
- // This 'L' indicates the width of
- // the Nonce and counter. The
- // loaded counter must be
- // initialized to 0. The total
- // width of A0 is 128-bit. For
- // CBC-MAC: -[127:0] - Zeroes - For
- // CBC-MAC this register must be
- // written with 0s at the start of
- // each operation. After an
- // operation, these registers
- // contain the 128-bit TAG output,
- // generated by the EIP-120t.
- #define AES_AES_IV_3_AES_IV_S 0
- //*****************************************************************************
- //
- // The following are defines for the bit fields in the AES_AES_CTRL register.
- //
- //*****************************************************************************
- #define AES_AES_CTRL_context_ready \
- 0x80000000 // If 1, this read-only status bit
- // indicates that the context data
- // registers can be overwritten and
- // the host is permitted to write
- // the next context.
- #define AES_AES_CTRL_context_ready_M \
- 0x80000000
- #define AES_AES_CTRL_context_ready_S 31
- #define AES_AES_CTRL_saved_context_ready \
- 0x40000000 // If 1, this status bit indicates
- // that an AES authentication TAG
- // and/or IV block(s) is/are
- // available for the host to
- // retrieve. This bit is only
- // asserted if the save_context bit
- // is set to 1. The bit is mutual
- // exclusive with the context_ready
- // bit. Writing one clears the bit
- // to 0, indicating the AES core
- // can start its next operation.
- // This bit is also cleared when
- // the 4th word of the output TAG
- // and/or IV is read. Note: All
- // other mode bit writes are
- // ignored when this mode bit is
- // written with 1. Note: This bit
- // is controlled automatically by
- // the EIP-120t for TAG read DMA
- // operations.
- #define AES_AES_CTRL_saved_context_ready_M \
- 0x40000000
- #define AES_AES_CTRL_saved_context_ready_S 30
- #define AES_AES_CTRL_save_context \
- 0x20000000 // This bit indicates that an
- // authentication TAG or result IV
- // needs to be stored as a result
- // context. Typically this bit must
- // be set for authentication modes
- // returning a TAG (CBC-MAC, GCM
- // and CCM), or for basic
- // encryption modes that require
- // future continuation with the
- // current result IV. If this bit
- // is set, the engine retains its
- // full context until the TAG
- // and/or IV registers are read.
- // The TAG or IV must be read
- // before the AES engine can start
- // a new operation.
- #define AES_AES_CTRL_save_context_M \
- 0x20000000
- #define AES_AES_CTRL_save_context_S 29
- #define AES_AES_CTRL_CCM_M_M 0x01C00000 // Defines M, which indicates the
- // length of the authentication
- // field for CCM operations; the
- // authentication field length
- // equals two times (the value of
- // CCM-M plus one). Note: The
- // EIP-120t always returns a
- // 128-bit authentication field, of
- // which the M least significant
- // bytes are valid. All values are
- // supported.
- #define AES_AES_CTRL_CCM_M_S 22
- #define AES_AES_CTRL_CCM_L_M 0x00380000 // Defines L, which indicates the
- // width of the length field for
- // CCM operations; the length field
- // in bytes equals the value of
- // CMM-L plus one. All values are
- // supported.
- #define AES_AES_CTRL_CCM_L_S 19
- #define AES_AES_CTRL_CCM 0x00040000 // If set to 1, AES-CCM is
- // selected AES-CCM is a combined
- // mode, using AES for
- // authentication and encryption.
- // Note: Selecting AES-CCM mode
- // requires writing of the AAD
- // length register after all other
- // registers. Note: The CTR mode
- // bit in this register must also
- // be set to 1 to enable AES-CTR;
- // selecting other AES modes than
- // CTR mode is invalid.
- #define AES_AES_CTRL_CCM_M 0x00040000
- #define AES_AES_CTRL_CCM_S 18
- #define AES_AES_CTRL_GCM_M 0x00030000 // Set these bits to 11 to select
- // AES-GCM mode. AES-GCM is a
- // combined mode, using the Galois
- // field multiplier GF(2 to the
- // power of 128) for authentication
- // and AES-CTR mode for encryption.
- // Note: The CTR mode bit in this
- // register must also be set to 1
- // to enable AES-CTR Bit
- // combination description: 00 = No
- // GCM mode 01 = Reserved, do not
- // select 10 = Reserved, do not
- // select 11 = Autonomous GHASH
- // (both H- and Y0-encrypted
- // calculated internally) Note: The
- // EIP-120t-1 configuration only
- // supports mode 11 (autonomous
- // GHASH), other GCM modes are not
- // allowed.
- #define AES_AES_CTRL_GCM_S 16
- #define AES_AES_CTRL_CBC_MAC 0x00008000 // Set to 1 to select AES-CBC MAC
- // mode. The direction bit must be
- // set to 1 for this mode.
- // Selecting this mode requires
- // writing the length register
- // after all other registers.
- #define AES_AES_CTRL_CBC_MAC_M 0x00008000
- #define AES_AES_CTRL_CBC_MAC_S 15
- #define AES_AES_CTRL_ctr_width_M \
- 0x00000180 // Specifies the counter width for
- // AES-CTR mode 00 = 32-bit counter
- // 01 = 64-bit counter 10 = 96-bit
- // counter 11 = 128-bit counter
- #define AES_AES_CTRL_ctr_width_S 7
- #define AES_AES_CTRL_CTR 0x00000040 // If set to 1, AES counter mode
- // (CTR) is selected. Note: This
- // bit must also be set for GCM and
- // CCM, when encryption/decryption
- // is required.
- #define AES_AES_CTRL_CTR_M 0x00000040
- #define AES_AES_CTRL_CTR_S 6
- #define AES_AES_CTRL_CBC 0x00000020 // If set to 1,
- // cipher-block-chaining (CBC) mode
- // is selected.
- #define AES_AES_CTRL_CBC_M 0x00000020
- #define AES_AES_CTRL_CBC_S 5
- #define AES_AES_CTRL_key_size_M 0x00000018 // This read-only field specifies
- // the key size. The key size is
- // automatically configured when a
- // new key is loaded through the
- // key store module. 00 = N/A -
- // Reserved 01 = 128-bit 10 =
- // 192-bit 11 = 256-bit
- #define AES_AES_CTRL_key_size_S 3
- #define AES_AES_CTRL_direction 0x00000004 // If set to 1 an encrypt
- // operation is performed. If set
- // to 0 a decrypt operation is
- // performed. This bit must be
- // written with a 1 when CBC-MAC is
- // selected.
- #define AES_AES_CTRL_direction_M \
- 0x00000004
- #define AES_AES_CTRL_direction_S 2
- #define AES_AES_CTRL_input_ready \
- 0x00000002 // If 1, this status bit indicates
- // that the 16-byte AES input
- // buffer is empty. The host is
- // permitted to write the next
- // block of data. Writing 0 clears
- // the bit to 0 and indicates that
- // the AES core can use the
- // provided input data block.
- // Writing 1 to this bit is
- // ignored. Note: For DMA
- // operations, this bit is
- // automatically controlled by the
- // EIP-120t. After reset, this bit
- // is 0. After writing a context,
- // this bit becomes 1.
- #define AES_AES_CTRL_input_ready_M \
- 0x00000002
- #define AES_AES_CTRL_input_ready_S 1
- #define AES_AES_CTRL_output_ready \
- 0x00000001 // If 1, this status bit indicates
- // that an AES output block is
- // available to be retrieved by the
- // host. Writing 0 clears the bit
- // to 0 and indicates that output
- // data is read by the host. The
- // AES core can provide a next
- // output data block. Writing 1 to
- // this bit is ignored. Note: For
- // DMA operations, this bit is
- // automatically controlled by the
- // EIP-120t.
- #define AES_AES_CTRL_output_ready_M \
- 0x00000001
- #define AES_AES_CTRL_output_ready_S 0
- //*****************************************************************************
- //
- // The following are defines for the bit fields in the
- // AES_AES_C_LENGTH_0 register.
- //
- //*****************************************************************************
- #define AES_AES_C_LENGTH_0_C_LENGTH_M \
- 0xFFFFFFFF // C_LENGTH[31:0] Bits [60:0] of
- // the crypto length registers (LSW
- // and MSW) store the cryptographic
- // data length in bytes for all
- // modes. Once processing with this
- // context is started, this length
- // decrements to 0. Data lengths up
- // to (261: 1) bytes are allowed.
- // For GCM, any value up to 236 -
- // 32 bytes can be used. This is
- // because a 32-bit counter mode is
- // used; the maximum number of
- // 128-bit blocks is 232 - 2,
- // resulting in a maximum number of
- // bytes of 236 - 32. A write to
- // this register triggers the
- // engine to start using this
- // context. This is valid for all
- // modes except GCM and CCM. Note:
- // For the combined modes (GCM and
- // CCM), this length does not
- // include the authentication only
- // data; the authentication length
- // is specified in the
- // AES_AUTH_LENGTH register below.
- // All modes must have a length
- // greater than 0. For the combined
- // modes, it is allowed to have one
- // of the lengths equal to 0. For
- // the basic encryption modes (ECB,
- // CBC, and CTR) it is allowed to
- // program zero to the length
- // field; in that case the length
- // is assumed infinite. All data
- // must be byte (8-bit) aligned for
- // stream cipher modes; bit aligned
- // data streams are not supported
- // by the EIP-120t. For block
- // cipher modes, the data length
- // must be programmed in multiples
- // of the block cipher size, 16
- // bytes. For a host read
- // operation, these registers
- // return all-0s.
- #define AES_AES_C_LENGTH_0_C_LENGTH_S 0
- //*****************************************************************************
- //
- // The following are defines for the bit fields in the
- // AES_AES_C_LENGTH_1 register.
- //
- //*****************************************************************************
- #define AES_AES_C_LENGTH_1_C_LENGTH_M \
- 0x1FFFFFFF // C_LENGTH[60:32] Bits [60:0] of
- // the crypto length registers (LSW
- // and MSW) store the cryptographic
- // data length in bytes for all
- // modes. Once processing with this
- // context is started, this length
- // decrements to 0. Data lengths up
- // to (261: 1) bytes are allowed.
- // For GCM, any value up to 236 -
- // 32 bytes can be used. This is
- // because a 32-bit counter mode is
- // used; the maximum number of
- // 128-bit blocks is 232 - 2,
- // resulting in a maximum number of
- // bytes of 236 - 32. A write to
- // this register triggers the
- // engine to start using this
- // context. This is valid for all
- // modes except GCM and CCM. Note:
- // For the combined modes (GCM and
- // CCM), this length does not
- // include the authentication only
- // data; the authentication length
- // is specified in the
- // AES_AUTH_LENGTH register below.
- // All modes must have a length
- // greater than 0. For the combined
- // modes, it is allowed to have one
- // of the lengths equal to 0. For
- // the basic encryption modes (ECB,
- // CBC, and CTR) it is allowed to
- // program zero to the length
- // field; in that case the length
- // is assumed infinite. All data
- // must be byte (8-bit) aligned for
- // stream cipher modes; bit aligned
- // data streams are not supported
- // by the EIP-120t. For block
- // cipher modes, the data length
- // must be programmed in multiples
- // of the block cipher size, 16
- // bytes. For a host read
- // operation, these registers
- // return all-0s.
- #define AES_AES_C_LENGTH_1_C_LENGTH_S 0
- //*****************************************************************************
- //
- // The following are defines for the bit fields in the
- // AES_AES_AUTH_LENGTH register.
- //
- //*****************************************************************************
- #define AES_AES_AUTH_LENGTH_AUTH_LENGTH_M \
- 0xFFFFFFFF // Bits [31:0] of the
- // authentication length register
- // store the authentication data
- // length in bytes for combined
- // modes only (GCM or CCM).
- // Supported AAD-lengths for CCM
- // are from 0 to (2^16 - 2^8)
- // bytes. For GCM any value up to
- // (2^32 - 1) bytes can be used.
- // Once processing with this
- // context is started, this length
- // decrements to 0. A write to this
- // register triggers the engine to
- // start using this context for GCM
- // and CCM. For a host read
- // operation, these registers
- // return all-0s.
- #define AES_AES_AUTH_LENGTH_AUTH_LENGTH_S 0
- //*****************************************************************************
- //
- // The following are defines for the bit fields in the
- // AES_AES_DATA_IN_OUT_0 register.
- //
- //*****************************************************************************
- #define AES_AES_DATA_IN_OUT_0_AES_DATA_IN_OUT_M \
- 0xFFFFFFFF // AES input data[31:0] / AES
- // output data[31:0] Data registers
- // for input/output block data
- // to/from the EIP-120t. For normal
- // operations, this register is not
- // used, since data input and
- // output is transferred from and
- // to the AES core via DMA. For a
- // host write operation, these
- // registers must be written with
- // the 128-bit input block for the
- // next AES operation. Writing at a
- // word-aligned offset within this
- // address range stores the word (4
- // bytes) of data into the
- // corresponding position of 4-word
- // deep (16 bytes = 128-bit AES
- // block) data input buffer. This
- // buffer is used for the next AES
- // operation. If the last data
- // block is not completely filled
- // with valid data (see notes
- // below), it is allowed to write
- // only the words with valid data.
- // Next AES operation is triggered
- // by writing to the input_ready
- // flag of the AES_CTRL register.
- // For a host read operation, these
- // registers contain the 128-bit
- // output block from the latest AES
- // operation. Reading from a
- // word-aligned offset within this
- // address range reads one word (4
- // bytes) of data out the 4-word
- // deep (16 bytes = 128-bits AES
- // block) data output buffer. The
- // words (4 words, one full block)
- // should be read before the core
- // will move the next block to the
- // data output buffer. To empty the
- // data output buffer, the
- // output_ready flag of the
- // AES_CTRL register must be
- // written. For the modes with
- // authentication (CBC-MAC, GCM and
- // CCM), the invalid (message)
- // bytes/words can be written with
- // any data. Note: AES typically
- // operates on 128 bits block
- // multiple input data. The CTR,
- // GCM and CCM modes form an
- // exception. The last block of a
- // CTR-mode message may contain
- // less than 128 bits (refer to
- // [NIST 800-38A]). For GCM/CCM,
- // the last block of both AAD and
- // message data may contain less
- // than 128 bits (refer to [NIST
- // 800-38D]). The EIP-120t
- // automatically pads or masks
- // misaligned ending data blocks
- // with 0s for GCM, CCM and
- // CBC-MAC. For CTR mode, the
- // remaining data in an unaligned
- // data block is ignored. Note: The
- // AAD / authentication only data
- // is not copied to the output
- // buffer but only used for
- // authentication.
- #define AES_AES_DATA_IN_OUT_0_AES_DATA_IN_OUT_S 0
- //*****************************************************************************
- //
- // The following are defines for the bit fields in the
- // AES_AES_DATA_IN_OUT_1 register.
- //
- //*****************************************************************************
- #define AES_AES_DATA_IN_OUT_1_AES_DATA_IN_OUT_M \
- 0xFFFFFFFF // AES input data[63:32] / AES
- // output data[63:32] Data
- // registers for input/output block
- // data to/from the EIP-120t. For
- // normal operations, this register
- // is not used, since data input
- // and output is transferred from
- // and to the AES core via DMA. For
- // a host write operation, these
- // registers must be written with
- // the 128-bit input block for the
- // next AES operation. Writing at a
- // word-aligned offset within this
- // address range stores the word (4
- // bytes) of data into the
- // corresponding position of 4-word
- // deep (16 bytes = 128-bit AES
- // block) data input buffer. This
- // buffer is used for the next AES
- // operation. If the last data
- // block is not completely filled
- // with valid data (see notes
- // below), it is allowed to write
- // only the words with valid data.
- // Next AES operation is triggered
- // by writing to the input_ready
- // flag of the AES_CTRL register.
- // For a host read operation, these
- // registers contain the 128-bit
- // output block from the latest AES
- // operation. Reading from a
- // word-aligned offset within this
- // address range reads one word (4
- // bytes) of data out the 4-word
- // deep (16 bytes = 128-bits AES
- // block) data output buffer. The
- // words (4 words, one full block)
- // should be read before the core
- // will move the next block to the
- // data output buffer. To empty the
- // data output buffer, the
- // output_ready flag of the
- // AES_CTRL register must be
- // written. For the modes with
- // authentication (CBC-MAC, GCM and
- // CCM), the invalid (message)
- // bytes/words can be written with
- // any data. Note: AES typically
- // operates on 128 bits block
- // multiple input data. The CTR,
- // GCM and CCM modes form an
- // exception. The last block of a
- // CTR-mode message may contain
- // less than 128 bits (refer to
- // [NIST 800-38A]). For GCM/CCM,
- // the last block of both AAD and
- // message data may contain less
- // than 128 bits (refer to [NIST
- // 800-38D]). The EIP-120t
- // automatically pads or masks
- // misaligned ending data blocks
- // with 0s for GCM, CCM and
- // CBC-MAC. For CTR mode, the
- // remaining data in an unaligned
- // data block is ignored. Note: The
- // AAD / authentication only data
- // is not copied to the output
- // buffer but only used for
- // authentication.
- #define AES_AES_DATA_IN_OUT_1_AES_DATA_IN_OUT_S 0
- //*****************************************************************************
- //
- // The following are defines for the bit fields in the
- // AES_AES_DATA_IN_OUT_2 register.
- //
- //*****************************************************************************
- #define AES_AES_DATA_IN_OUT_2_AES_DATA_IN_OUT_M \
- 0xFFFFFFFF // AES input data[95:64] / AES
- // output data[95:64] Data
- // registers for input/output block
- // data to/from the EIP-120t. For
- // normal operations, this register
- // is not used, since data input
- // and output is transferred from
- // and to the AES core via DMA. For
- // a host write operation, these
- // registers must be written with
- // the 128-bit input block for the
- // next AES operation. Writing at a
- // word-aligned offset within this
- // address range stores the word (4
- // bytes) of data into the
- // corresponding position of 4-word
- // deep (16 bytes = 128-bit AES
- // block) data input buffer. This
- // buffer is used for the next AES
- // operation. If the last data
- // block is not completely filled
- // with valid data (see notes
- // below), it is allowed to write
- // only the words with valid data.
- // Next AES operation is triggered
- // by writing to the input_ready
- // flag of the AES_CTRL register.
- // For a host read operation, these
- // registers contain the 128-bit
- // output block from the latest AES
- // operation. Reading from a
- // word-aligned offset within this
- // address range reads one word (4
- // bytes) of data out the 4-word
- // deep (16 bytes = 128-bits AES
- // block) data output buffer. The
- // words (4 words, one full block)
- // should be read before the core
- // will move the next block to the
- // data output buffer. To empty the
- // data output buffer, the
- // output_ready flag of the
- // AES_CTRL register must be
- // written. For the modes with
- // authentication (CBC-MAC, GCM and
- // CCM), the invalid (message)
- // bytes/words can be written with
- // any data. Note: AES typically
- // operates on 128 bits block
- // multiple input data. The CTR,
- // GCM and CCM modes form an
- // exception. The last block of a
- // CTR-mode message may contain
- // less than 128 bits (refer to
- // [NIST 800-38A]). For GCM/CCM,
- // the last block of both AAD and
- // message data may contain less
- // than 128 bits (refer to [NIST
- // 800-38D]). The EIP-120t
- // automatically pads or masks
- // misaligned ending data blocks
- // with 0s for GCM, CCM and
- // CBC-MAC. For CTR mode, the
- // remaining data in an unaligned
- // data block is ignored. Note: The
- // AAD / authentication only data
- // is not copied to the output
- // buffer but only used for
- // authentication.
- #define AES_AES_DATA_IN_OUT_2_AES_DATA_IN_OUT_S 0
- //*****************************************************************************
- //
- // The following are defines for the bit fields in the
- // AES_AES_DATA_IN_OUT_3 register.
- //
- //*****************************************************************************
- #define AES_AES_DATA_IN_OUT_3_AES_DATA_IN_OUT_M \
- 0xFFFFFFFF // AES input data[127:96] / AES
- // output data[127:96] Data
- // registers for input/output block
- // data to/from the EIP-120t. For
- // normal operations, this register
- // is not used, since data input
- // and output is transferred from
- // and to the AES core via DMA. For
- // a host write operation, these
- // registers must be written with
- // the 128-bit input block for the
- // next AES operation. Writing at a
- // word-aligned offset within this
- // address range stores the word (4
- // bytes) of data into the
- // corresponding position of 4-word
- // deep (16 bytes = 128-bit AES
- // block) data input buffer. This
- // buffer is used for the next AES
- // operation. If the last data
- // block is not completely filled
- // with valid data (see notes
- // below), it is allowed to write
- // only the words with valid data.
- // Next AES operation is triggered
- // by writing to the input_ready
- // flag of the AES_CTRL register.
- // For a host read operation, these
- // registers contain the 128-bit
- // output block from the latest AES
- // operation. Reading from a
- // word-aligned offset within this
- // address range reads one word (4
- // bytes) of data out the 4-word
- // deep (16 bytes = 128-bits AES
- // block) data output buffer. The
- // words (4 words, one full block)
- // should be read before the core
- // will move the next block to the
- // data output buffer. To empty the
- // data output buffer, the
- // output_ready flag of the
- // AES_CTRL register must be
- // written. For the modes with
- // authentication (CBC-MAC, GCM and
- // CCM), the invalid (message)
- // bytes/words can be written with
- // any data. Note: AES typically
- // operates on 128 bits block
- // multiple input data. The CTR,
- // GCM and CCM modes form an
- // exception. The last block of a
- // CTR-mode message may contain
- // less than 128 bits (refer to
- // [NIST 800-38A]). For GCM/CCM,
- // the last block of both AAD and
- // message data may contain less
- // than 128 bits (refer to [NIST
- // 800-38D]). The EIP-120t
- // automatically pads or masks
- // misaligned ending data blocks
- // with 0s for GCM, CCM and
- // CBC-MAC. For CTR mode, the
- // remaining data in an unaligned
- // data block is ignored. Note: The
- // AAD / authentication only data
- // is not copied to the output
- // buffer but only used for
- // authentication.
- #define AES_AES_DATA_IN_OUT_3_AES_DATA_IN_OUT_S 0
- //*****************************************************************************
- //
- // The following are defines for the bit fields in the
- // AES_AES_TAG_OUT_0 register.
- //
- //*****************************************************************************
- #define AES_AES_TAG_OUT_0_AES_TAG_M \
- 0xFFFFFFFF // AES_TAG[31:0] Bits [31:0] of
- // the AES_TAG registers store the
- // authentication value for the
- // combined and authentication only
- // modes. For a host read
- // operation, these registers
- // contain the last 128-bit TAG
- // output of the EIP-120t; the TAG
- // is available until the next
- // context is written. This
- // register will only contain valid
- // data if the TAG is available and
- // when the store_ready bit from
- // AES_CTRL register is set. During
- // processing or for
- // operations/modes that do not
- // return a TAG, reads from this
- // register return data from the IV
- // register.
- #define AES_AES_TAG_OUT_0_AES_TAG_S 0
- //*****************************************************************************
- //
- // The following are defines for the bit fields in the
- // AES_AES_TAG_OUT_1 register.
- //
- //*****************************************************************************
- #define AES_AES_TAG_OUT_1_AES_TAG_M \
- 0xFFFFFFFF // AES_TAG[63:32] For a host read
- // operation, these registers
- // contain the last 128-bit TAG
- // output of the EIP-120t; the TAG
- // is available until the next
- // context is written. This
- // register contains valid data
- // only if the TAG is available and
- // when the store_ready bit from
- // AES_CTRL register is set. During
- // processing or for
- // operations/modes that do not
- // return a TAG, reads from this
- // register return data from the IV
- // register.
- #define AES_AES_TAG_OUT_1_AES_TAG_S 0
- //*****************************************************************************
- //
- // The following are defines for the bit fields in the
- // AES_AES_TAG_OUT_2 register.
- //
- //*****************************************************************************
- #define AES_AES_TAG_OUT_2_AES_TAG_M \
- 0xFFFFFFFF // AES_TAG[95:64] For a host read
- // operation, these registers
- // contain the last 128-bit TAG
- // output of the EIP-120t; the TAG
- // is available until the next
- // context is written. This
- // register contains valid data
- // only if the TAG is available and
- // when the store_ready bit from
- // AES_CTRL register is set. During
- // processing or for
- // operations/modes that do not
- // return a TAG, reads from this
- // register return data from the IV
- // register.
- #define AES_AES_TAG_OUT_2_AES_TAG_S 0
- //*****************************************************************************
- //
- // The following are defines for the bit fields in the
- // AES_AES_TAG_OUT_3 register.
- //
- //*****************************************************************************
- #define AES_AES_TAG_OUT_3_AES_TAG_M \
- 0xFFFFFFFF // AES_TAG[127:96] For a host read
- // operation, these registers
- // contain the last 128-bit TAG
- // output of the EIP-120t; the TAG
- // is available until the next
- // context is written. This
- // register contains valid data
- // only if the TAG is available and
- // when the store_ready bit from
- // AES_CTRL register is set. During
- // processing or for
- // operations/modes that do not
- // return a TAG, reads from this
- // register return data from the IV
- // register.
- #define AES_AES_TAG_OUT_3_AES_TAG_S 0
- //*****************************************************************************
- //
- // The following are defines for the bit fields in the
- // AES_HASH_DATA_IN_0 register.
- //
- //*****************************************************************************
- #define AES_HASH_DATA_IN_0_HASH_DATA_IN_M \
- 0xFFFFFFFF // HASH_DATA_IN[31:0] These
- // registers must be written with
- // the 512-bit input data. The data
- // lines are connected directly to
- // the data input of the hash
- // module and hence into the
- // engine's internal data buffer.
- // Writing to each of the registers
- // triggers a corresponding 32-bit
- // write enable to the internal
- // buffer. Note: The host may only
- // write the input data buffer when
- // the rfd_in bit of the
- // HASH_IO_BUF_CTRL register is
- // high. If the rfd_in bit is 0,
- // the engine is busy with
- // processing. During processing,
- // it is not allowed to write new
- // input data. For message lengths
- // larger than 64 bytes, multiple
- // blocks of data are written to
- // this input buffer using a
- // handshake through flags of the
- // HASH_IO_BUF_CTRL register. All
- // blocks except the last are
- // required to be 512 bits in size.
- // If the last block is not 512
- // bits long, only the least
- // significant bits of data must be
- // written, but they must be padded
- // with 0s to the next 32-bit
- // boundary. Host read operations
- // from these register addresses
- // return 0s.
- #define AES_HASH_DATA_IN_0_HASH_DATA_IN_S 0
- //*****************************************************************************
- //
- // The following are defines for the bit fields in the
- // AES_HASH_DATA_IN_1 register.
- //
- //*****************************************************************************
- #define AES_HASH_DATA_IN_1_HASH_DATA_IN_M \
- 0xFFFFFFFF // HASH_DATA_IN[63:32] These
- // registers must be written with
- // the 512-bit input data. The data
- // lines are connected directly to
- // the data input of the hash
- // module and hence into the
- // engine's internal data buffer.
- // Writing to each of the registers
- // triggers a corresponding 32-bit
- // write enable to the internal
- // buffer. Note: The host may only
- // write the input data buffer when
- // the rfd_in bit of the
- // HASH_IO_BUF_CTRL register is
- // high. If the rfd_in bit is 0,
- // the engine is busy with
- // processing. During processing,
- // it is not allowed to write new
- // input data. For message lengths
- // larger than 64 bytes, multiple
- // blocks of data are written to
- // this input buffer using a
- // handshake through flags of the
- // HASH_IO_BUF_CTRL register. All
- // blocks except the last are
- // required to be 512 bits in size.
- // If the last block is not 512
- // bits long, only the least
- // significant bits of data must be
- // written, but they must be padded
- // with 0s to the next 32-bit
- // boundary. Host read operations
- // from these register addresses
- // return 0s.
- #define AES_HASH_DATA_IN_1_HASH_DATA_IN_S 0
- //*****************************************************************************
- //
- // The following are defines for the bit fields in the
- // AES_HASH_DATA_IN_2 register.
- //
- //*****************************************************************************
- #define AES_HASH_DATA_IN_2_HASH_DATA_IN_M \
- 0xFFFFFFFF // HASH_DATA_IN[95:64] These
- // registers must be written with
- // the 512-bit input data. The data
- // lines are connected directly to
- // the data input of the hash
- // module and hence into the
- // engine's internal data buffer.
- // Writing to each of the registers
- // triggers a corresponding 32-bit
- // write enable to the internal
- // buffer. Note: The host may only
- // write the input data buffer when
- // the rfd_in bit of the
- // HASH_IO_BUF_CTRL register is
- // high. If the rfd_in bit is 0,
- // the engine is busy with
- // processing. During processing,
- // it is not allowed to write new
- // input data. For message lengths
- // larger than 64 bytes, multiple
- // blocks of data are written to
- // this input buffer using a
- // handshake through flags of the
- // HASH_IO_BUF_CTRL register. All
- // blocks except the last are
- // required to be 512 bits in size.
- // If the last block is not 512
- // bits long, only the least
- // significant bits of data must be
- // written, but they must be padded
- // with 0s to the next 32-bit
- // boundary. Host read operations
- // from these register addresses
- // return 0s.
- #define AES_HASH_DATA_IN_2_HASH_DATA_IN_S 0
- //*****************************************************************************
- //
- // The following are defines for the bit fields in the
- // AES_HASH_DATA_IN_3 register.
- //
- //*****************************************************************************
- #define AES_HASH_DATA_IN_3_HASH_DATA_IN_M \
- 0xFFFFFFFF // HASH_DATA_IN[127:96] These
- // registers must be written with
- // the 512-bit input data. The data
- // lines are connected directly to
- // the data input of the hash
- // module and hence into the
- // engine's internal data buffer.
- // Writing to each of the registers
- // triggers a corresponding 32-bit
- // write enable to the internal
- // buffer. Note: The host may only
- // write the input data buffer when
- // the rfd_in bit of the
- // HASH_IO_BUF_CTRL register is
- // high. If the rfd_in bit is 0,
- // the engine is busy with
- // processing. During processing,
- // it is not allowed to write new
- // input data. For message lengths
- // larger than 64 bytes, multiple
- // blocks of data are written to
- // this input buffer using a
- // handshake through flags of the
- // HASH_IO_BUF_CTRL register. All
- // blocks except the last are
- // required to be 512 bits in size.
- // If the last block is not 512
- // bits long, only the least
- // significant bits of data must be
- // written, but they must be padded
- // with 0s to the next 32-bit
- // boundary. Host read operations
- // from these register addresses
- // return 0s.
- #define AES_HASH_DATA_IN_3_HASH_DATA_IN_S 0
- //*****************************************************************************
- //
- // The following are defines for the bit fields in the
- // AES_HASH_DATA_IN_4 register.
- //
- //*****************************************************************************
- #define AES_HASH_DATA_IN_4_HASH_DATA_IN_M \
- 0xFFFFFFFF // HASH_DATA_IN[159:128] These
- // registers must be written with
- // the 512-bit input data. The data
- // lines are connected directly to
- // the data input of the hash
- // module and hence into the
- // engine's internal data buffer.
- // Writing to each of the registers
- // triggers a corresponding 32-bit
- // write enable to the internal
- // buffer. Note: The host may only
- // write the input data buffer when
- // the rfd_in bit of the
- // HASH_IO_BUF_CTRL register is
- // high. If the rfd_in bit is 0,
- // the engine is busy with
- // processing. During processing,
- // it is not allowed to write new
- // input data. For message lengths
- // larger than 64 bytes, multiple
- // blocks of data are written to
- // this input buffer using a
- // handshake through flags of the
- // HASH_IO_BUF_CTRL register. All
- // blocks except the last are
- // required to be 512 bits in size.
- // If the last block is not 512
- // bits long, only the least
- // significant bits of data must be
- // written, but they must be padded
- // with 0s to the next 32-bit
- // boundary. Host read operations
- // from these register addresses
- // return 0s.
- #define AES_HASH_DATA_IN_4_HASH_DATA_IN_S 0
- //*****************************************************************************
- //
- // The following are defines for the bit fields in the
- // AES_HASH_DATA_IN_5 register.
- //
- //*****************************************************************************
- #define AES_HASH_DATA_IN_5_HASH_DATA_IN_M \
- 0xFFFFFFFF // HASH_DATA_IN[191:160] These
- // registers must be written with
- // the 512-bit input data. The data
- // lines are connected directly to
- // the data input of the hash
- // module and hence into the
- // engine's internal data buffer.
- // Writing to each of the registers
- // triggers a corresponding 32-bit
- // write enable to the internal
- // buffer. Note: The host may only
- // write the input data buffer when
- // the rfd_in bit of the
- // HASH_IO_BUF_CTRL register is
- // high. If the rfd_in bit is 0,
- // the engine is busy with
- // processing. During processing,
- // it is not allowed to write new
- // input data. For message lengths
- // larger than 64 bytes, multiple
- // blocks of data are written to
- // this input buffer using a
- // handshake through flags of the
- // HASH_IO_BUF_CTRL register. All
- // blocks except the last are
- // required to be 512 bits in size.
- // If the last block is not 512
- // bits long, only the least
- // significant bits of data must be
- // written, but they must be padded
- // with 0s to the next 32-bit
- // boundary. Host read operations
- // from these register addresses
- // return 0s.
- #define AES_HASH_DATA_IN_5_HASH_DATA_IN_S 0
- //*****************************************************************************
- //
- // The following are defines for the bit fields in the
- // AES_HASH_DATA_IN_6 register.
- //
- //*****************************************************************************
- #define AES_HASH_DATA_IN_6_HASH_DATA_IN_M \
- 0xFFFFFFFF // HASH_DATA_IN[223:192] These
- // registers must be written with
- // the 512-bit input data. The data
- // lines are connected directly to
- // the data input of the hash
- // module and hence into the
- // engine's internal data buffer.
- // Writing to each of the registers
- // triggers a corresponding 32-bit
- // write enable to the internal
- // buffer. Note: The host may only
- // write the input data buffer when
- // the rfd_in bit of the
- // HASH_IO_BUF_CTRL register is
- // high. If the rfd_in bit is 0,
- // the engine is busy with
- // processing. During processing,
- // it is not allowed to write new
- // input data. For message lengths
- // larger than 64 bytes, multiple
- // blocks of data are written to
- // this input buffer using a
- // handshake through flags of the
- // HASH_IO_BUF_CTRL register. All
- // blocks except the last are
- // required to be 512 bits in size.
- // If the last block is not 512
- // bits long, only the least
- // significant bits of data must be
- // written, but they must be padded
- // with 0s to the next 32-bit
- // boundary. Host read operations
- // from these register addresses
- // return 0s.
- #define AES_HASH_DATA_IN_6_HASH_DATA_IN_S 0
- //*****************************************************************************
- //
- // The following are defines for the bit fields in the
- // AES_HASH_DATA_IN_7 register.
- //
- //*****************************************************************************
- #define AES_HASH_DATA_IN_7_HASH_DATA_IN_M \
- 0xFFFFFFFF // HASH_DATA_IN[255:224] These
- // registers must be written with
- // the 512-bit input data. The data
- // lines are connected directly to
- // the data input of the hash
- // module and hence into the
- // engine's internal data buffer.
- // Writing to each of the registers
- // triggers a corresponding 32-bit
- // write enable to the internal
- // buffer. Note: The host may only
- // write the input data buffer when
- // the rfd_in bit of the
- // HASH_IO_BUF_CTRL register is
- // high. If the rfd_in bit is 0,
- // the engine is busy with
- // processing. During processing,
- // it is not allowed to write new
- // input data. For message lengths
- // larger than 64 bytes, multiple
- // blocks of data are written to
- // this input buffer using a
- // handshake through flags of the
- // HASH_IO_BUF_CTRL register. All
- // blocks except the last are
- // required to be 512 bits in size.
- // If the last block is not 512
- // bits long, only the least
- // significant bits of data must be
- // written, but they must be padded
- // with 0s to the next 32-bit
- // boundary. Host read operations
- // from these register addresses
- // return 0s.
- #define AES_HASH_DATA_IN_7_HASH_DATA_IN_S 0
- //*****************************************************************************
- //
- // The following are defines for the bit fields in the
- // AES_HASH_DATA_IN_8 register.
- //
- //*****************************************************************************
- #define AES_HASH_DATA_IN_8_HASH_DATA_IN_M \
- 0xFFFFFFFF // HASH_DATA_IN[287:256] These
- // registers must be written with
- // the 512-bit input data. The data
- // lines are connected directly to
- // the data input of the hash
- // module and hence into the
- // engine's internal data buffer.
- // Writing to each of the registers
- // triggers a corresponding 32-bit
- // write enable to the internal
- // buffer. Note: The host may only
- // write the input data buffer when
- // the rfd_in bit of the
- // HASH_IO_BUF_CTRL register is
- // high. If the rfd_in bit is 0,
- // the engine is busy with
- // processing. During processing,
- // it is not allowed to write new
- // input data. For message lengths
- // larger than 64 bytes, multiple
- // blocks of data are written to
- // this input buffer using a
- // handshake through flags of the
- // HASH_IO_BUF_CTRL register. All
- // blocks except the last are
- // required to be 512 bits in size.
- // If the last block is not 512
- // bits long, only the least
- // significant bits of data must be
- // written, but they must be padded
- // with 0s to the next 32-bit
- // boundary. Host read operations
- // from these register addresses
- // return 0s.
- #define AES_HASH_DATA_IN_8_HASH_DATA_IN_S 0
- //*****************************************************************************
- //
- // The following are defines for the bit fields in the
- // AES_HASH_DATA_IN_9 register.
- //
- //*****************************************************************************
- #define AES_HASH_DATA_IN_9_HASH_DATA_IN_M \
- 0xFFFFFFFF // HASH_DATA_IN[319:288] These
- // registers must be written with
- // the 512-bit input data. The data
- // lines are connected directly to
- // the data input of the hash
- // module and hence into the
- // engine's internal data buffer.
- // Writing to each of the registers
- // triggers a corresponding 32-bit
- // write enable to the internal
- // buffer. Note: The host may only
- // write the input data buffer when
- // the rfd_in bit of the
- // HASH_IO_BUF_CTRL register is
- // high. If the rfd_in bit is 0,
- // the engine is busy with
- // processing. During processing,
- // it is not allowed to write new
- // input data. For message lengths
- // larger than 64 bytes, multiple
- // blocks of data are written to
- // this input buffer using a
- // handshake through flags of the
- // HASH_IO_BUF_CTRL register. All
- // blocks except the last are
- // required to be 512 bits in size.
- // If the last block is not 512
- // bits long, only the least
- // significant bits of data must be
- // written, but they must be padded
- // with 0s to the next 32-bit
- // boundary. Host read operations
- // from these register addresses
- // return 0s.
- #define AES_HASH_DATA_IN_9_HASH_DATA_IN_S 0
- //*****************************************************************************
- //
- // The following are defines for the bit fields in the
- // AES_HASH_DATA_IN_10 register.
- //
- //*****************************************************************************
- #define AES_HASH_DATA_IN_10_HASH_DATA_IN_M \
- 0xFFFFFFFF // HASH_DATA_IN[351:320] These
- // registers must be written with
- // the 512-bit input data. The data
- // lines are connected directly to
- // the data input of the hash
- // module and hence into the
- // engine's internal data buffer.
- // Writing to each of the registers
- // triggers a corresponding 32-bit
- // write enable to the internal
- // buffer. Note: The host may only
- // write the input data buffer when
- // the rfd_in bit of the
- // HASH_IO_BUF_CTRL register is
- // high. If the rfd_in bit is 0,
- // the engine is busy with
- // processing. During processing,
- // it is not allowed to write new
- // input data. For message lengths
- // larger than 64 bytes, multiple
- // blocks of data are written to
- // this input buffer using a
- // handshake through flags of the
- // HASH_IO_BUF_CTRL register. All
- // blocks except the last are
- // required to be 512 bits in size.
- // If the last block is not 512
- // bits long, only the least
- // significant bits of data must be
- // written, but they must be padded
- // with 0s to the next 32-bit
- // boundary. Host read operations
- // from these register addresses
- // return 0s.
- #define AES_HASH_DATA_IN_10_HASH_DATA_IN_S 0
- //*****************************************************************************
- //
- // The following are defines for the bit fields in the
- // AES_HASH_DATA_IN_11 register.
- //
- //*****************************************************************************
- #define AES_HASH_DATA_IN_11_HASH_DATA_IN_M \
- 0xFFFFFFFF // HASH_DATA_IN[383:352] These
- // registers must be written with
- // the 512-bit input data. The data
- // lines are connected directly to
- // the data input of the hash
- // module and hence into the
- // engine's internal data buffer.
- // Writing to each of the registers
- // triggers a corresponding 32-bit
- // write enable to the internal
- // buffer. Note: The host may only
- // write the input data buffer when
- // the rfd_in bit of the
- // HASH_IO_BUF_CTRL register is
- // high. If the rfd_in bit is 0,
- // the engine is busy with
- // processing. During processing,
- // it is not allowed to write new
- // input data. For message lengths
- // larger than 64 bytes, multiple
- // blocks of data are written to
- // this input buffer using a
- // handshake through flags of the
- // HASH_IO_BUF_CTRL register. All
- // blocks except the last are
- // required to be 512 bits in size.
- // If the last block is not 512
- // bits long, only the least
- // significant bits of data must be
- // written, but they must be padded
- // with 0s to the next 32-bit
- // boundary. Host read operations
- // from these register addresses
- // return 0s.
- #define AES_HASH_DATA_IN_11_HASH_DATA_IN_S 0
- //*****************************************************************************
- //
- // The following are defines for the bit fields in the
- // AES_HASH_DATA_IN_12 register.
- //
- //*****************************************************************************
- #define AES_HASH_DATA_IN_12_HASH_DATA_IN_M \
- 0xFFFFFFFF // HASH_DATA_IN[415:384] These
- // registers must be written with
- // the 512-bit input data. The data
- // lines are connected directly to
- // the data input of the hash
- // module and hence into the
- // engine's internal data buffer.
- // Writing to each of the registers
- // triggers a corresponding 32-bit
- // write enable to the internal
- // buffer. Note: The host may only
- // write the input data buffer when
- // the rfd_in bit of the
- // HASH_IO_BUF_CTRL register is
- // high. If the rfd_in bit is 0,
- // the engine is busy with
- // processing. During processing,
- // it is not allowed to write new
- // input data. For message lengths
- // larger than 64 bytes, multiple
- // blocks of data are written to
- // this input buffer using a
- // handshake through flags of the
- // HASH_IO_BUF_CTRL register. All
- // blocks except the last are
- // required to be 512 bits in size.
- // If the last block is not 512
- // bits long, only the least
- // significant bits of data must be
- // written, but they must be padded
- // with 0s to the next 32-bit
- // boundary. Host read operations
- // from these register addresses
- // return 0s.
- #define AES_HASH_DATA_IN_12_HASH_DATA_IN_S 0
- //*****************************************************************************
- //
- // The following are defines for the bit fields in the
- // AES_HASH_DATA_IN_13 register.
- //
- //*****************************************************************************
- #define AES_HASH_DATA_IN_13_HASH_DATA_IN_M \
- 0xFFFFFFFF // HASH_DATA_IN[447:416] These
- // registers must be written with
- // the 512-bit input data. The data
- // lines are connected directly to
- // the data input of the hash
- // module and hence into the
- // engine's internal data buffer.
- // Writing to each of the registers
- // triggers a corresponding 32-bit
- // write enable to the internal
- // buffer. Note: The host may only
- // write the input data buffer when
- // the rfd_in bit of the
- // HASH_IO_BUF_CTRL register is
- // high. If the rfd_in bit is 0,
- // the engine is busy with
- // processing. During processing,
- // it is not allowed to write new
- // input data. For message lengths
- // larger than 64 bytes, multiple
- // blocks of data are written to
- // this input buffer using a
- // handshake through flags of the
- // HASH_IO_BUF_CTRL register. All
- // blocks except the last are
- // required to be 512 bits in size.
- // If the last block is not 512
- // bits long, only the least
- // significant bits of data must be
- // written, but they must be padded
- // with 0s to the next 32-bit
- // boundary. Host read operations
- // from these register addresses
- // return 0s.
- #define AES_HASH_DATA_IN_13_HASH_DATA_IN_S 0
- //*****************************************************************************
- //
- // The following are defines for the bit fields in the
- // AES_HASH_DATA_IN_14 register.
- //
- //*****************************************************************************
- #define AES_HASH_DATA_IN_14_HASH_DATA_IN_M \
- 0xFFFFFFFF // HASH_DATA_IN[479:448] These
- // registers must be written with
- // the 512-bit input data. The data
- // lines are connected directly to
- // the data input of the hash
- // module and hence into the
- // engine's internal data buffer.
- // Writing to each of the registers
- // triggers a corresponding 32-bit
- // write enable to the internal
- // buffer. Note: The host may only
- // write the input data buffer when
- // the rfd_in bit of the
- // HASH_IO_BUF_CTRL register is
- // high. If the rfd_in bit is 0,
- // the engine is busy with
- // processing. During processing,
- // it is not allowed to write new
- // input data. For message lengths
- // larger than 64 bytes, multiple
- // blocks of data are written to
- // this input buffer using a
- // handshake through flags of the
- // HASH_IO_BUF_CTRL register. All
- // blocks except the last are
- // required to be 512 bits in size.
- // If the last block is not 512
- // bits long, only the least
- // significant bits of data must be
- // written, but they must be padded
- // with 0s to the next 32-bit
- // boundary. Host read operations
- // from these register addresses
- // return 0s.
- #define AES_HASH_DATA_IN_14_HASH_DATA_IN_S 0
- //*****************************************************************************
- //
- // The following are defines for the bit fields in the
- // AES_HASH_DATA_IN_15 register.
- //
- //*****************************************************************************
- #define AES_HASH_DATA_IN_15_HASH_DATA_IN_M \
- 0xFFFFFFFF // HASH_DATA_IN[511:480] These
- // registers must be written with
- // the 512-bit input data. The data
- // lines are connected directly to
- // the data input of the hash
- // module and hence into the
- // engine's internal data buffer.
- // Writing to each of the registers
- // triggers a corresponding 32-bit
- // write enable to the internal
- // buffer. Note: The host may only
- // write the input data buffer when
- // the rfd_in bit of the
- // HASH_IO_BUF_CTRL register is
- // high. If the rfd_in bit is 0,
- // the engine is busy with
- // processing. During processing,
- // it is not allowed to write new
- // input data. For message lengths
- // larger than 64 bytes, multiple
- // blocks of data are written to
- // this input buffer using a
- // handshake through flags of the
- // HASH_IO_BUF_CTRL register. All
- // blocks except the last are
- // required to be 512 bits in size.
- // If the last block is not 512
- // bits long, only the least
- // significant bits of data must be
- // written, but they must be padded
- // with 0s to the next 32-bit
- // boundary. Host read operations
- // from these register addresses
- // return 0s.
- #define AES_HASH_DATA_IN_15_HASH_DATA_IN_S 0
- //*****************************************************************************
- //
- // The following are defines for the bit fields in the
- // AES_HASH_IO_BUF_CTRL register.
- //
- //*****************************************************************************
- #define AES_HASH_IO_BUF_CTRL_PAD_DMA_MESSAGE \
- 0x00000080 // Note: This bit must only be
- // used when data is supplied
- // through the DMA. It should not
- // be used when data is supplied
- // through the slave interface.
- // This bit indicates whether the
- // hash engine has to pad the
- // message, received through the
- // DMA and finalize the hash. When
- // set to 1, the hash engine pads
- // the last block using the
- // programmed length. After
- // padding, the final hash result
- // is calculated. When set to 0,
- // the hash engine treats the last
- // written block as block-size
- // aligned and calculates the
- // intermediate digest. This bit is
- // automatically cleared when the
- // last DMA data block is arrived
- // in the hash engine.
- #define AES_HASH_IO_BUF_CTRL_PAD_DMA_MESSAGE_M \
- 0x00000080
- #define AES_HASH_IO_BUF_CTRL_PAD_DMA_MESSAGE_S 7
- #define AES_HASH_IO_BUF_CTRL_GET_DIGEST \
- 0x00000040 // Note: The bit description below
- // is only applicable when data is
- // sent through the slave
- // interface. This bit must be set
- // to 0 when data is received
- // through the DMA. This bit
- // indicates whether the hash
- // engine should provide the hash
- // digest. When provided
- // simultaneously with data_in_av,
- // the hash digest is provided
- // after processing the data that
- // is currently in the HASH_DATA_IN
- // register. When provided without
- // data_in_av, the current internal
- // digest buffer value is copied to
- // the HASH_DIGEST_n registers. The
- // host must write a 1 to this bit
- // to make the intermediate hash
- // digest available. Writing 0 to
- // this bit has no effect. This bit
- // is automatically cleared (that
- // is, reads 0) when the hash
- // engine has processed the
- // contents of the HASH_DATA_IN
- // register. In the period between
- // this bit is set by the host and
- // the actual HASH_DATA_IN
- // processing, this bit reads 1.
- #define AES_HASH_IO_BUF_CTRL_GET_DIGEST_M \
- 0x00000040
- #define AES_HASH_IO_BUF_CTRL_GET_DIGEST_S 6
- #define AES_HASH_IO_BUF_CTRL_PAD_MESSAGE \
- 0x00000020 // Note: The bit description below
- // is only applicable when data is
- // sent through the slave
- // interface. This bit must be set
- // to 0 when data is received
- // through the DMA. This bit
- // indicates that the HASH_DATA_IN
- // registers hold the last data of
- // the message and hash padding
- // must be applied. The host must
- // write this bit to 1 in order to
- // indicate to the hash engine that
- // the HASH_DATA_IN register
- // currently holds the last data of
- // the message. When pad_message is
- // set to 1, the hash engine will
- // add padding bits to the data
- // currently in the HASH_DATA_IN
- // register. When the last message
- // block is smaller than 512 bits,
- // the pad_message bit must be set
- // to 1 together with the
- // data_in_av bit. When the last
- // message block is equal to 512
- // bits, pad_message may be set
- // together with data_in_av. In
- // this case the pad_message bit
- // may also be set after the last
- // data block has been written to
- // the hash engine (so when the
- // rfd_in bit has become 1 again
- // after writing the last data
- // block). Writing 0 to this bit
- // has no effect. This bit is
- // automatically cleared (i.e.
- // reads 0) by the hash engine.
- // This bit reads 1 between the
- // time it was set by the host and
- // the hash engine interpreted its
- // value.
- #define AES_HASH_IO_BUF_CTRL_PAD_MESSAGE_M \
- 0x00000020
- #define AES_HASH_IO_BUF_CTRL_PAD_MESSAGE_S 5
- #define AES_HASH_IO_BUF_CTRL_RFD_IN \
- 0x00000004 // Note: The bit description below
- // is only applicable when data is
- // sent through the slave
- // interface. This bit can be
- // ignored when data is received
- // through the DMA. Read-only
- // status of the input buffer of
- // the hash engine. When 1, the
- // input buffer of the hash engine
- // can accept new data; the
- // HASH_DATA_IN registers can
- // safely be populated with new
- // data. When 0, the input buffer
- // of the hash engine is processing
- // the data that is currently in
- // HASH_DATA_IN; writing new data
- // to these registers is not
- // allowed.
- #define AES_HASH_IO_BUF_CTRL_RFD_IN_M \
- 0x00000004
- #define AES_HASH_IO_BUF_CTRL_RFD_IN_S 2
- #define AES_HASH_IO_BUF_CTRL_DATA_IN_AV \
- 0x00000002 // Note: The bit description below
- // is only applicable when data is
- // sent through the slave
- // interface. This bit must be set
- // to 0 when data is received
- // through the DMA. This bit
- // indicates that the HASH_DATA_IN
- // registers contain new input data
- // for processing. The host must
- // write a 1 to this bit to start
- // processing the data in
- // HASH_DATA_IN; the hash engine
- // will process the new data as
- // soon as it is ready for it
- // (rfd_in bit is 1). Writing 0 to
- // this bit has no effect. This bit
- // is automatically cleared (i.e.
- // reads as 0) when the hash engine
- // starts processing the
- // HASH_DATA_IN contents. This bit
- // reads 1 between the time it was
- // set by the host and the hash
- // engine actually starts
- // processing the input data block.
- #define AES_HASH_IO_BUF_CTRL_DATA_IN_AV_M \
- 0x00000002
- #define AES_HASH_IO_BUF_CTRL_DATA_IN_AV_S 1
- #define AES_HASH_IO_BUF_CTRL_OUTPUT_FULL \
- 0x00000001 // Indicates that the output
- // buffer registers (HASH_DIGEST_n)
- // are available for reading by the
- // host. When this bit reads 0, the
- // output buffer registers are
- // released; the hash engine is
- // allowed to write new data to it.
- // In this case, the registers
- // should not be read by the host.
- // When this bit reads 1, the hash
- // engine has stored the result of
- // the latest hash operation in the
- // output buffer registers. As long
- // as this bit reads 1, the host
- // may read output buffer registers
- // and the hash engine is prevented
- // from writing new data to the
- // output buffer. After retrieving
- // the hash result data from the
- // output buffer, the host must
- // write a 1 to this bit to clear
- // it. This makes the digest output
- // buffer available for the hash
- // engine to store new hash
- // results. Writing 0 to this bit
- // has no effect. Note: If this bit
- // is asserted (1) no new operation
- // should be started before the
- // digest is retrieved from the
- // hash engine and this bit is
- // cleared (0).
- #define AES_HASH_IO_BUF_CTRL_OUTPUT_FULL_M \
- 0x00000001
- #define AES_HASH_IO_BUF_CTRL_OUTPUT_FULL_S 0
- //*****************************************************************************
- //
- // The following are defines for the bit fields in the
- // AES_HASH_MODE_IN register.
- //
- //*****************************************************************************
- #define AES_HASH_MODE_IN_SHA256_MODE \
- 0x00000008 // The host must write this bit
- // with 1 before processing a hash
- // session.
- #define AES_HASH_MODE_IN_SHA256_MODE_M \
- 0x00000008
- #define AES_HASH_MODE_IN_SHA256_MODE_S 3
- #define AES_HASH_MODE_IN_NEW_HASH \
- 0x00000001 // When set to 1, it indicates
- // that the hash engine must start
- // processing a new hash session.
- // The HASH_DIGEST_n registers will
- // automatically be loaded with the
- // initial hash algorithm constants
- // of the selected hash algorithm.
- // When this bit is 0 while the
- // hash processing is started, the
- // initial hash algorithm constants
- // are not loaded in the
- // HASH_DIGEST_n registers. The
- // hash engine will start
- // processing with the digest that
- // is currently in its internal
- // HASH_DIGEST_n registers. This
- // bit is automatically cleared
- // when hash processing is started.
- #define AES_HASH_MODE_IN_NEW_HASH_M \
- 0x00000001
- #define AES_HASH_MODE_IN_NEW_HASH_S 0
- //*****************************************************************************
- //
- // The following are defines for the bit fields in the
- // AES_HASH_LENGTH_IN_L register.
- //
- //*****************************************************************************
- #define AES_HASH_LENGTH_IN_L_LENGTH_IN_M \
- 0xFFFFFFFF // LENGTH_IN[31:0] Message length
- // registers. The content of these
- // registers is used by the hash
- // engine during the message
- // padding phase of the hash
- // session. The data lines of this
- // registers are directly connected
- // to the interface of the hash
- // engine. For a write operation by
- // the host, these registers should
- // be written with the message
- // length in bits. Final hash
- // operations: The total input data
- // length must be programmed for
- // new hash operations that require
- // finalization (padding). The
- // input data must be provided
- // through the slave or DMA
- // interface. Continued hash
- // operations (finalized): For
- // continued hash operations that
- // require finalization, the total
- // message length must be
- // programmed, including the length
- // of previously hashed data that
- // corresponds to the written input
- // digest. Non-final hash
- // operations: For hash operations
- // that do not require finalization
- // (input data length is multiple
- // of 512-bits which is SHA-256
- // data block size), the length
- // field does not need to be
- // programmed since not used by the
- // operation. If the message length
- // in bits is below (2^32-1), then
- // only HASH_LENGTH_IN_L needs to
- // be written. The hardware
- // automatically sets
- // HASH_LENGTH_IN_H to 0s in this
- // case. The host may write the
- // length register at any time
- // during the hash session when the
- // rfd_in bit of the
- // HASH_IO_BUF_CTRL is high. The
- // length register must be written
- // before the last data of the
- // active hash session is written
- // into the hash engine. host read
- // operations from these register
- // locations will return 0s. Note:
- // When getting data from DMA, this
- // register must be programmed
- // before DMA is programmed to
- // start.
- #define AES_HASH_LENGTH_IN_L_LENGTH_IN_S 0
- //*****************************************************************************
- //
- // The following are defines for the bit fields in the
- // AES_HASH_LENGTH_IN_H register.
- //
- //*****************************************************************************
- #define AES_HASH_LENGTH_IN_H_LENGTH_IN_M \
- 0xFFFFFFFF // LENGTH_IN[63:32] Message length
- // registers. The content of these
- // registers is used by the hash
- // engine during the message
- // padding phase of the hash
- // session. The data lines of this
- // registers are directly connected
- // to the interface of the hash
- // engine. For a write operation by
- // the host, these registers should
- // be written with the message
- // length in bits. Final hash
- // operations: The total input data
- // length must be programmed for
- // new hash operations that require
- // finalization (padding). The
- // input data must be provided
- // through the slave or DMA
- // interface. Continued hash
- // operations (finalized): For
- // continued hash operations that
- // require finalization, the total
- // message length must be
- // programmed, including the length
- // of previously hashed data that
- // corresponds to the written input
- // digest. Non-final hash
- // operations: For hash operations
- // that do not require finalization
- // (input data length is multiple
- // of 512-bits which is SHA-256
- // data block size), the length
- // field does not need to be
- // programmed since not used by the
- // operation. If the message length
- // in bits is below (2^32-1), then
- // only HASH_LENGTH_IN_L needs to
- // be written. The hardware
- // automatically sets
- // HASH_LENGTH_IN_H to 0s in this
- // case. The host may write the
- // length register at any time
- // during the hash session when the
- // rfd_in bit of the
- // HASH_IO_BUF_CTRL is high. The
- // length register must be written
- // before the last data of the
- // active hash session is written
- // into the hash engine. host read
- // operations from these register
- // locations will return 0s. Note:
- // When getting data from DMA, this
- // register must be programmed
- // before DMA is programmed to
- // start.
- #define AES_HASH_LENGTH_IN_H_LENGTH_IN_S 0
- //*****************************************************************************
- //
- // The following are defines for the bit fields in the
- // AES_HASH_DIGEST_A register.
- //
- //*****************************************************************************
- #define AES_HASH_DIGEST_A_HASH_DIGEST_M \
- 0xFFFFFFFF // HASH_DIGEST[31:0] Hash digest
- // registers Write operation:
- // Continued hash: These registers
- // should be written with the
- // context data, before the start
- // of a resumed hash session (the
- // new_hash bit in the HASH_MODE
- // register is 0 when starting a
- // hash session). New hash: When
- // initiating a new hash session
- // (the new_hash bit in the
- // HASH_MODE register is high), the
- // internal digest registers are
- // automatically set to the SHA-256
- // algorithm constant and these
- // register should not be written.
- // Reading from these registers
- // provides the intermediate hash
- // result (non-final hash
- // operation) or the final hash
- // result (final hash operation)
- // after data processing.
- #define AES_HASH_DIGEST_A_HASH_DIGEST_S 0
- //*****************************************************************************
- //
- // The following are defines for the bit fields in the
- // AES_HASH_DIGEST_B register.
- //
- //*****************************************************************************
- #define AES_HASH_DIGEST_B_HASH_DIGEST_M \
- 0xFFFFFFFF // HASH_DIGEST[63:32] Hash digest
- // registers Write operation:
- // Continued hash: These registers
- // should be written with the
- // context data, before the start
- // of a resumed hash session (the
- // new_hash bit in the HASH_MODE
- // register is 0 when starting a
- // hash session). New hash: When
- // initiating a new hash session
- // (the new_hash bit in the
- // HASH_MODE register is high), the
- // internal digest registers are
- // automatically set to the SHA-256
- // algorithm constant and these
- // register should not be written.
- // Reading from these registers
- // provides the intermediate hash
- // result (non-final hash
- // operation) or the final hash
- // result (final hash operation)
- // after data processing.
- #define AES_HASH_DIGEST_B_HASH_DIGEST_S 0
- //*****************************************************************************
- //
- // The following are defines for the bit fields in the
- // AES_HASH_DIGEST_C register.
- //
- //*****************************************************************************
- #define AES_HASH_DIGEST_C_HASH_DIGEST_M \
- 0xFFFFFFFF // HASH_DIGEST[95:64] Hash digest
- // registers Write operation:
- // Continued hash: These registers
- // should be written with the
- // context data, before the start
- // of a resumed hash session (the
- // new_hash bit in the HASH_MODE
- // register is 0 when starting a
- // hash session). New hash: When
- // initiating a new hash session
- // (the new_hash bit in the
- // HASH_MODE register is high), the
- // internal digest registers are
- // automatically set to the SHA-256
- // algorithm constant and these
- // register should not be written.
- // Reading from these registers
- // provides the intermediate hash
- // result (non-final hash
- // operation) or the final hash
- // result (final hash operation)
- // after data processing.
- #define AES_HASH_DIGEST_C_HASH_DIGEST_S 0
- //*****************************************************************************
- //
- // The following are defines for the bit fields in the
- // AES_HASH_DIGEST_D register.
- //
- //*****************************************************************************
- #define AES_HASH_DIGEST_D_HASH_DIGEST_M \
- 0xFFFFFFFF // HASH_DIGEST[127:96] Hash digest
- // registers Write operation:
- // Continued hash: These registers
- // should be written with the
- // context data, before the start
- // of a resumed hash session (the
- // new_hash bit in the HASH_MODE
- // register is 0 when starting a
- // hash session). New hash: When
- // initiating a new hash session
- // (the new_hash bit in the
- // HASH_MODE register is high), the
- // internal digest registers are
- // automatically set to the SHA-256
- // algorithm constant and these
- // register should not be written.
- // Reading from these registers
- // provides the intermediate hash
- // result (non-final hash
- // operation) or the final hash
- // result (final hash operation)
- // after data processing.
- #define AES_HASH_DIGEST_D_HASH_DIGEST_S 0
- //*****************************************************************************
- //
- // The following are defines for the bit fields in the
- // AES_HASH_DIGEST_E register.
- //
- //*****************************************************************************
- #define AES_HASH_DIGEST_E_HASH_DIGEST_M \
- 0xFFFFFFFF // HASH_DIGEST[159:128] Hash
- // digest registers Write
- // operation: Continued hash: These
- // registers should be written with
- // the context data, before the
- // start of a resumed hash session
- // (the new_hash bit in the
- // HASH_MODE register is 0 when
- // starting a hash session). New
- // hash: When initiating a new hash
- // session (the new_hash bit in the
- // HASH_MODE register is high), the
- // internal digest registers are
- // automatically set to the SHA-256
- // algorithm constant and these
- // register should not be written.
- // Reading from these registers
- // provides the intermediate hash
- // result (non-final hash
- // operation) or the final hash
- // result (final hash operation)
- // after data processing.
- #define AES_HASH_DIGEST_E_HASH_DIGEST_S 0
- //*****************************************************************************
- //
- // The following are defines for the bit fields in the
- // AES_HASH_DIGEST_F register.
- //
- //*****************************************************************************
- #define AES_HASH_DIGEST_F_HASH_DIGEST_M \
- 0xFFFFFFFF // HASH_DIGEST[191:160] Hash
- // digest registers Write
- // operation: Continued hash: These
- // registers should be written with
- // the context data, before the
- // start of a resumed hash session
- // (the new_hash bit in the
- // HASH_MODE register is 0 when
- // starting a hash session). New
- // hash: When initiating a new hash
- // session (the new_hash bit in the
- // HASH_MODE register is high), the
- // internal digest registers are
- // automatically set to the SHA-256
- // algorithm constant and these
- // register should not be written.
- // Reading from these registers
- // provides the intermediate hash
- // result (non-final hash
- // operation) or the final hash
- // result (final hash operation)
- // after data processing.
- #define AES_HASH_DIGEST_F_HASH_DIGEST_S 0
- //*****************************************************************************
- //
- // The following are defines for the bit fields in the
- // AES_HASH_DIGEST_G register.
- //
- //*****************************************************************************
- #define AES_HASH_DIGEST_G_HASH_DIGEST_M \
- 0xFFFFFFFF // HASH_DIGEST[223:192] Hash
- // digest registers Write
- // operation: Continued hash: These
- // registers should be written with
- // the context data, before the
- // start of a resumed hash session
- // (the new_hash bit in the
- // HASH_MODE register is 0 when
- // starting a hash session). New
- // hash: When initiating a new hash
- // session (the new_hash bit in the
- // HASH_MODE register is high), the
- // internal digest registers are
- // automatically set to the SHA-256
- // algorithm constant and these
- // register should not be written.
- // Reading from these registers
- // provides the intermediate hash
- // result (non-final hash
- // operation) or the final hash
- // result (final hash operation)
- // after data processing.
- #define AES_HASH_DIGEST_G_HASH_DIGEST_S 0
- //*****************************************************************************
- //
- // The following are defines for the bit fields in the
- // AES_HASH_DIGEST_H register.
- //
- //*****************************************************************************
- #define AES_HASH_DIGEST_H_HASH_DIGEST_M \
- 0xFFFFFFFF // HASH_DIGEST[255:224] Hash
- // digest registers Write
- // operation: Continued hash: These
- // registers should be written with
- // the context data, before the
- // start of a resumed hash session
- // (the new_hash bit in the
- // HASH_MODE register is 0 when
- // starting a hash session). New
- // hash: When initiating a new hash
- // session (the new_hash bit in the
- // HASH_MODE register is high), the
- // internal digest registers are
- // automatically set to the SHA-256
- // algorithm constant and these
- // register should not be written.
- // Reading from these registers
- // provides the intermediate hash
- // result (non-final hash
- // operation) or the final hash
- // result (final hash operation)
- // after data processing.
- #define AES_HASH_DIGEST_H_HASH_DIGEST_S 0
- //*****************************************************************************
- //
- // The following are defines for the bit fields in the
- // AES_CTRL_ALG_SEL register.
- //
- //*****************************************************************************
- #define AES_CTRL_ALG_SEL_TAG 0x80000000 // If this bit is cleared to 0,
- // the DMA operation involves only
- // data. If this bit is set, the
- // DMA operation includes a TAG
- // (Authentication Result /
- // Digest). For SHA-256 operation,
- // a DMA must be set up for both
- // input data and TAG. For any
- // other selected module, setting
- // this bit only allows a DMA that
- // reads the TAG. No data allowed
- // to be transferred to or from the
- // selected module via the DMA.
- #define AES_CTRL_ALG_SEL_TAG_M 0x80000000
- #define AES_CTRL_ALG_SEL_TAG_S 31
- #define AES_CTRL_ALG_SEL_HASH 0x00000004 // If set to one, selects the hash
- // engine as destination for the
- // DMA The maximum transfer size to
- // DMA engine is set to 64 bytes
- // for reading and 32 bytes for
- // writing (the latter is only
- // applicable if the hash result is
- // written out through the DMA).
- #define AES_CTRL_ALG_SEL_HASH_M 0x00000004
- #define AES_CTRL_ALG_SEL_HASH_S 2
- #define AES_CTRL_ALG_SEL_AES 0x00000002 // If set to one, selects the AES
- // engine as source/destination for
- // the DMA The read and write
- // maximum transfer size to the DMA
- // engine is set to 16 bytes.
- #define AES_CTRL_ALG_SEL_AES_M 0x00000002
- #define AES_CTRL_ALG_SEL_AES_S 1
- #define AES_CTRL_ALG_SEL_KEYSTORE \
- 0x00000001 // If set to one, selects the Key
- // Store as destination for the DMA
- // The maximum transfer size to DMA
- // engine is set to 32 bytes
- // (however transfers of 16, 24 and
- // 32 bytes are allowed)
- #define AES_CTRL_ALG_SEL_KEYSTORE_M \
- 0x00000001
- #define AES_CTRL_ALG_SEL_KEYSTORE_S 0
- //*****************************************************************************
- //
- // The following are defines for the bit fields in the
- // AES_CTRL_PROT_EN register.
- //
- //*****************************************************************************
- #define AES_CTRL_PROT_EN_PROT_EN \
- 0x00000001 // If this bit is cleared to 0,
- // m_h_prot[1] on the AHB mater
- // interface always remains 0. If
- // this bit is set to one, the
- // m_h_prot[1] signal on the master
- // AHB bus is asserted to 1 if an
- // AHB read operation is performed,
- // using DMA, with the key store
- // module as destination.
- #define AES_CTRL_PROT_EN_PROT_EN_M \
- 0x00000001
- #define AES_CTRL_PROT_EN_PROT_EN_S 0
- //*****************************************************************************
- //
- // The following are defines for the bit fields in the
- // AES_CTRL_SW_RESET register.
- //
- //*****************************************************************************
- #define AES_CTRL_SW_RESET_SW_RESET \
- 0x00000001 // If this bit is set to 1, the
- // following modules are reset: -
- // Master control internal state is
- // reset. That includes interrupt,
- // error status register, and
- // result available interrupt
- // generation FSM. - Key store
- // module state is reset. That
- // includes clearing the written
- // area flags; therefore, the keys
- // must be reloaded to the key
- // store module. Writing 0 has no
- // effect. The bit is self cleared
- // after executing the reset.
- #define AES_CTRL_SW_RESET_SW_RESET_M \
- 0x00000001
- #define AES_CTRL_SW_RESET_SW_RESET_S 0
- //*****************************************************************************
- //
- // The following are defines for the bit fields in the
- // AES_CTRL_INT_CFG register.
- //
- //*****************************************************************************
- #define AES_CTRL_INT_CFG_LEVEL 0x00000001 // If this bit is 0, the interrupt
- // output is a pulse. If this bit
- // is set to 1, the interrupt is a
- // level interrupt that must be
- // cleared by writing the interrupt
- // clear register. This bit is
- // applicable for both interrupt
- // output signals.
- #define AES_CTRL_INT_CFG_LEVEL_M \
- 0x00000001
- #define AES_CTRL_INT_CFG_LEVEL_S 0
- //*****************************************************************************
- //
- // The following are defines for the bit fields in the
- // AES_CTRL_INT_EN register.
- //
- //*****************************************************************************
- #define AES_CTRL_INT_EN_DMA_IN_DONE \
- 0x00000002 // If this bit is set to 0, the
- // DMA input done (irq_dma_in_done)
- // interrupt output is disabled and
- // remains 0. If this bit is set to
- // 1, the DMA input done interrupt
- // output is enabled.
- #define AES_CTRL_INT_EN_DMA_IN_DONE_M \
- 0x00000002
- #define AES_CTRL_INT_EN_DMA_IN_DONE_S 1
- #define AES_CTRL_INT_EN_RESULT_AV \
- 0x00000001 // If this bit is set to 0, the
- // result available (irq_result_av)
- // interrupt output is disabled and
- // remains 0. If this bit is set to
- // 1, the result available
- // interrupt output is enabled.
- #define AES_CTRL_INT_EN_RESULT_AV_M \
- 0x00000001
- #define AES_CTRL_INT_EN_RESULT_AV_S 0
- //*****************************************************************************
- //
- // The following are defines for the bit fields in the
- // AES_CTRL_INT_CLR register.
- //
- //*****************************************************************************
- #define AES_CTRL_INT_CLR_DMA_BUS_ERR \
- 0x80000000 // If 1 is written to this bit,
- // the DMA bus error status is
- // cleared. Writing 0 has no
- // effect.
- #define AES_CTRL_INT_CLR_DMA_BUS_ERR_M \
- 0x80000000
- #define AES_CTRL_INT_CLR_DMA_BUS_ERR_S 31
- #define AES_CTRL_INT_CLR_KEY_ST_WR_ERR \
- 0x40000000 // If 1 is written to this bit,
- // the key store write error status
- // is cleared. Writing 0 has no
- // effect.
- #define AES_CTRL_INT_CLR_KEY_ST_WR_ERR_M \
- 0x40000000
- #define AES_CTRL_INT_CLR_KEY_ST_WR_ERR_S 30
- #define AES_CTRL_INT_CLR_KEY_ST_RD_ERR \
- 0x20000000 // If 1 is written to this bit,
- // the key store read error status
- // is cleared. Writing 0 has no
- // effect.
- #define AES_CTRL_INT_CLR_KEY_ST_RD_ERR_M \
- 0x20000000
- #define AES_CTRL_INT_CLR_KEY_ST_RD_ERR_S 29
- #define AES_CTRL_INT_CLR_DMA_IN_DONE \
- 0x00000002 // If 1 is written to this bit,
- // the DMA in done
- // (irq_dma_in_done) interrupt
- // output is cleared. Writing 0 has
- // no effect. Note that clearing an
- // interrupt makes sense only if
- // the interrupt output is
- // programmed as level (refer to
- // CTRL_INT_CFG).
- #define AES_CTRL_INT_CLR_DMA_IN_DONE_M \
- 0x00000002
- #define AES_CTRL_INT_CLR_DMA_IN_DONE_S 1
- #define AES_CTRL_INT_CLR_RESULT_AV \
- 0x00000001 // If 1 is written to this bit,
- // the result available
- // (irq_result_av) interrupt output
- // is cleared. Writing 0 has no
- // effect. Note that clearing an
- // interrupt makes sense only if
- // the interrupt output is
- // programmed as level (refer to
- // CTRL_INT_CFG).
- #define AES_CTRL_INT_CLR_RESULT_AV_M \
- 0x00000001
- #define AES_CTRL_INT_CLR_RESULT_AV_S 0
- //*****************************************************************************
- //
- // The following are defines for the bit fields in the
- // AES_CTRL_INT_SET register.
- //
- //*****************************************************************************
- #define AES_CTRL_INT_SET_DMA_IN_DONE \
- 0x00000002 // If 1 is written to this bit,
- // the DMA data in done
- // (irq_dma_in_done) interrupt
- // output is set to one. Writing 0
- // has no effect. If the interrupt
- // configuration register is
- // programmed to pulse, clearing
- // the DMA data in done
- // (irq_dma_in_done) interrupt is
- // not needed. If it is programmed
- // to level, clearing the interrupt
- // output should be done by writing
- // the interrupt clear register
- // (CTRL_INT_CLR).
- #define AES_CTRL_INT_SET_DMA_IN_DONE_M \
- 0x00000002
- #define AES_CTRL_INT_SET_DMA_IN_DONE_S 1
- #define AES_CTRL_INT_SET_RESULT_AV \
- 0x00000001 // If 1 is written to this bit,
- // the result available
- // (irq_result_av) interrupt output
- // is set to one. Writing 0 has no
- // effect. If the interrupt
- // configuration register is
- // programmed to pulse, clearing
- // the result available
- // (irq_result_av) interrupt is not
- // needed. If it is programmed to
- // level, clearing the interrupt
- // output should be done by writing
- // the interrupt clear register
- // (CTRL_INT_CLR).
- #define AES_CTRL_INT_SET_RESULT_AV_M \
- 0x00000001
- #define AES_CTRL_INT_SET_RESULT_AV_S 0
- //*****************************************************************************
- //
- // The following are defines for the bit fields in the
- // AES_CTRL_INT_STAT register.
- //
- //*****************************************************************************
- #define AES_CTRL_INT_STAT_DMA_BUS_ERR \
- 0x80000000 // This bit is set when a DMA bus
- // error is detected during a DMA
- // operation. The value of this
- // register is held until it is
- // cleared through the CTRL_INT_CLR
- // register. Note: This error is
- // asserted if an error is detected
- // on the AHB master interface
- // during a DMA operation.
- #define AES_CTRL_INT_STAT_DMA_BUS_ERR_M \
- 0x80000000
- #define AES_CTRL_INT_STAT_DMA_BUS_ERR_S 31
- #define AES_CTRL_INT_STAT_KEY_ST_WR_ERR \
- 0x40000000 // This bit is set when a write
- // error is detected during the DMA
- // write operation to the key store
- // memory. The value of this
- // register is held until it is
- // cleared through the CTRL_INT_CLR
- // register. Note: This error is
- // asserted if a DMA operation does
- // not cover a full key area or
- // more areas are written than
- // expected.
- #define AES_CTRL_INT_STAT_KEY_ST_WR_ERR_M \
- 0x40000000
- #define AES_CTRL_INT_STAT_KEY_ST_WR_ERR_S 30
- #define AES_CTRL_INT_STAT_KEY_ST_RD_ERR \
- 0x20000000 // This bit is set when a read
- // error is detected during the
- // read of a key from the key
- // store, while copying it to the
- // AES core. The value of this
- // register is held until it is
- // cleared through the CTRL_INT_CLR
- // register. Note: This error is
- // asserted if a key location is
- // selected in the key store that
- // is not available.
- #define AES_CTRL_INT_STAT_KEY_ST_RD_ERR_M \
- 0x20000000
- #define AES_CTRL_INT_STAT_KEY_ST_RD_ERR_S 29
- #define AES_CTRL_INT_STAT_DMA_IN_DONE \
- 0x00000002 // This read only bit returns the
- // actual DMA data in done
- // (irq_data_in_done) interrupt
- // status of the DMA data in done
- // interrupt output pin
- // (irq_data_in_done).
- #define AES_CTRL_INT_STAT_DMA_IN_DONE_M \
- 0x00000002
- #define AES_CTRL_INT_STAT_DMA_IN_DONE_S 1
- #define AES_CTRL_INT_STAT_RESULT_AV \
- 0x00000001 // This read only bit returns the
- // actual result available
- // (irq_result_av) interrupt status
- // of the result available
- // interrupt output pin
- // (irq_result_av).
- #define AES_CTRL_INT_STAT_RESULT_AV_M \
- 0x00000001
- #define AES_CTRL_INT_STAT_RESULT_AV_S 0
- //*****************************************************************************
- //
- // The following are defines for the bit fields in the
- // AES_CTRL_OPTIONS register.
- //
- //*****************************************************************************
- #define AES_CTRL_OPTIONS_TYPE_M 0xFF000000 // This field is 0x01 for the
- // TYPE1 device.
- #define AES_CTRL_OPTIONS_TYPE_S 24
- #define AES_CTRL_OPTIONS_AHBINTERFACE \
- 0x00010000 // AHB interface is available If
- // this bit is 0, the EIP-120t has
- // a TCM interface.
- #define AES_CTRL_OPTIONS_AHBINTERFACE_M \
- 0x00010000
- #define AES_CTRL_OPTIONS_AHBINTERFACE_S 16
- #define AES_CTRL_OPTIONS_SHA_256 \
- 0x00000100 // The HASH core supports SHA-256.
- #define AES_CTRL_OPTIONS_SHA_256_M \
- 0x00000100
- #define AES_CTRL_OPTIONS_SHA_256_S 8
- #define AES_CTRL_OPTIONS_AES_CCM \
- 0x00000080 // AES-CCM is available as a
- // single operation.
- #define AES_CTRL_OPTIONS_AES_CCM_M \
- 0x00000080
- #define AES_CTRL_OPTIONS_AES_CCM_S 7
- #define AES_CTRL_OPTIONS_AES_GCM \
- 0x00000040 // AES-GCM is available as a
- // single operation.
- #define AES_CTRL_OPTIONS_AES_GCM_M \
- 0x00000040
- #define AES_CTRL_OPTIONS_AES_GCM_S 6
- #define AES_CTRL_OPTIONS_AES_256 \
- 0x00000020 // AES core supports 256-bit keys
- // Note: If both AES-128 and
- // AES-256 are set to one, the AES
- // core supports 192-bit keys as
- // well.
- #define AES_CTRL_OPTIONS_AES_256_M \
- 0x00000020
- #define AES_CTRL_OPTIONS_AES_256_S 5
- #define AES_CTRL_OPTIONS_AES_128 \
- 0x00000010 // AES core supports 128-bit keys.
- #define AES_CTRL_OPTIONS_AES_128_M \
- 0x00000010
- #define AES_CTRL_OPTIONS_AES_128_S 4
- #define AES_CTRL_OPTIONS_HASH 0x00000004 // HASH Core is available.
- #define AES_CTRL_OPTIONS_HASH_M 0x00000004
- #define AES_CTRL_OPTIONS_HASH_S 2
- #define AES_CTRL_OPTIONS_AES 0x00000002 // AES core is available.
- #define AES_CTRL_OPTIONS_AES_M 0x00000002
- #define AES_CTRL_OPTIONS_AES_S 1
- #define AES_CTRL_OPTIONS_KEYSTORE \
- 0x00000001 // KEY STORE is available.
- #define AES_CTRL_OPTIONS_KEYSTORE_M \
- 0x00000001
- #define AES_CTRL_OPTIONS_KEYSTORE_S 0
- //*****************************************************************************
- //
- // The following are defines for the bit fields in the
- // AES_CTRL_VERSION register.
- //
- //*****************************************************************************
- #define AES_CTRL_VERSION_MAJOR_VERSION_M \
- 0x0F000000 // Major version number
- #define AES_CTRL_VERSION_MAJOR_VERSION_S 24
- #define AES_CTRL_VERSION_MINOR_VERSION_M \
- 0x00F00000 // Minor version number
- #define AES_CTRL_VERSION_MINOR_VERSION_S 20
- #define AES_CTRL_VERSION_PATCH_LEVEL_M \
- 0x000F0000 // Patch level Starts at 0 at
- // first delivery of this version
- #define AES_CTRL_VERSION_PATCH_LEVEL_S 16
- #define AES_CTRL_VERSION_EIP_NUMBER_COMPL_M \
- 0x0000FF00 // These bits simply contain the
- // complement of bits [7:0] (0x87),
- // used by a driver to ascertain
- // that the EIP-120t register is
- // indeed read.
- #define AES_CTRL_VERSION_EIP_NUMBER_COMPL_S 8
- #define AES_CTRL_VERSION_EIP_NUMBER_M \
- 0x000000FF // These bits encode the EIP
- // number for the EIP-120t, this
- // field contains the value 120
- // (decimal) or 0x78.
- #define AES_CTRL_VERSION_EIP_NUMBER_S 0
- #endif // __HW_AES_H__
|