




版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
History文檔修訂記修正版修正日說作SeeAppendixAPreviousHistoryA過去的修Neil19SepChangeStaticMACtobeonlyUIDandserialPhillip19SepRemovedreferencestodiversificationonBII’sShane20Sep3.3.1UseofActiveStatusField-UpdatedActiveblockselectiondescriptiontomatchnewflow3.3.1activeStatusNeil24OctMovedhistoryforv2.16tov2.19toAppendixA2.162.19A中UpdatedcoversheetEngineeringandProject1Introduction–Added_CHsuffixtoallBEInumbers.3.2StaticArea–RenamedkeyVersionto3.2keyVersion3.3DynamicArea–Renamed‘status’to4CardSerialNumberDefinition–AddedinformationonCheckDigitcalculation.4卡序列號(hào)定義-StaticAreaMACCalculation–RenamedtoMACCalculation,added5.1.1&5.1.2todescribethenewStaticandDynamicAreaMACCalculation.UpdatedFig2.靜態(tài)區(qū)MAC計(jì)算-MAC5.1.12DetailedLayout–updatedtoreflectabovechanges.-TotalPurchaseValuerenamedto5.2詳細(xì)結(jié)構(gòu)-Neil13Nov3.2StaticData–testModeisnow13.2testMode1Neil14Novv3.5afterv3.5Neil22NovMovedhistoryforv2.20tov3.0toAppendixv2.20v3.01.3Terminology–MovedallTermsintotheTermscolumnandalldefinitionsintotheDefinitionscolumn.Neil修正版修正日說作1.3–把所有的術(shù)語移到術(shù)語列,把所有的定義移3.2StaticArea–ChangedtestModetotestCard,productTypetopurseOrProductTypeId,productCategorytopurseOrProductCategoryandproductIsserIdtopurseOrProductIssuerId.3.2靜態(tài)區(qū)–testModetestCardproductTypepurseOrProductTypeId,把productIsserIdpurseOrProductIssuerId。4CardSerialNumberDefinition-IndustryCodenowdefinedas:75135MACCalculation–SeperatedfromDetailedCardLayoutsectionwhichisnowsection6.5MAC66DetailedLayoutupdatedtoreflectabovechanges6–根據(jù)以上變更進(jìn)行了更新24Janv3.7afterGao25JanMadechangestosection1.4Referencesandcross-referenceformats.Re-appliedstyles.修改1.4參考文獻(xiàn)和交叉格式。重新應(yīng)用風(fēng)格J.Bluhm-30Janv3.9afterVersionedforReleaseHarry修正版修正日說作14Removeduseof(card)“serialnumber”toreferto刪除票卡“序列號(hào)”UID?!癇ig-endianonlyappliestonumericvalues.Renamed“UIDArea”to“UIDandLockArea”tomatchitscontents.RecedreferencestoSAMfunctionswithacompletespecificationoftheMACalgorithms.CleanedupMACcalculationstouseconsistent將SAM函數(shù)的內(nèi)容替換成完整的MAC算定。刪MAC計(jì)算以便適用一致的術(shù)語。Removed“Encryption”columnfromTable10:DetailedCardLayout,becausenocarddataisPaddingbitsaresettoallzeros,toallowforeasieruseinfuture.MiscellaneousotherminorcorrectionsandMitch19Notedequivalences/differencesbetweenISO/IEC9797-1MACalgorithmandthealgorithmdefinedintheConstructionMinistrystandardApplicationtechnologyforconstructioncauseICcard(NationwideExposureDraft).ISO/IEC9797-1MACAddedreferencestoBEI-00022_APPC_CHDeviceCardProcessingSpecificationAppendixC.Mitch30JulyChangessincev4.0havebeenrejectedandthecontentofthehasbeenrevertedbacktov4.0content.VersionedforRelease5.0HarryTableofIntroduction引 Purpose目 Scope范 Overview概 CardData卡數(shù) UIDAreaUID OneTime bleArea一次編程 UserRead/WriteArea用戶讀寫 StaticData(IssuerArea)靜態(tài)數(shù)據(jù)(區(qū) DynamicData動(dòng)態(tài)數(shù) PeriodProduct定期產(chǎn) PeriodProduct–DynamicData定期產(chǎn)品–動(dòng)態(tài)數(shù) MultirideProduct計(jì)次產(chǎn) MultirideProduct–DynamicData計(jì)次產(chǎn)品–動(dòng)態(tài)數(shù) PurseProduct錢包產(chǎn) PurseProduct–DynamicData錢包產(chǎn)品–動(dòng)態(tài)數(shù) CardSerialNumberDefinition卡序列 MACCalculationMAC計(jì) CRC-32AlgorithmCRC-32算 DetailedCardLayout票卡具體結(jié) Appendix PreviousHistory附錄A文檔歷 ListofTables表Table1:Abbreviations,TermsandDefinitions表1:縮寫、術(shù)語和定 TABLE2:CARDEEPROMMEMORYLAYOUT表2:卡的EEPROM結(jié) Table3:DataStoredintheOneTime bleArea表3:在一次編程區(qū)內(nèi)的數(shù) Table4:DataStoredintheUserRead/WriteArea表4:在用戶讀/寫區(qū)的數(shù) Table5:StaticData表5:靜態(tài)數(shù) Table6:DynamicData表6:動(dòng)態(tài)數(shù) Table7:PeriodProduct–DynamicData表7:定期產(chǎn)品–動(dòng)態(tài)數(shù) Table8:MultirideProduct–DynamicData表8:計(jì)次產(chǎn)品–動(dòng)態(tài)數(shù) Table9:PurseProduct–DynamicData表9:錢包產(chǎn)品–動(dòng)態(tài)數(shù) Table10:DetailedCardLayout表10:票卡具體結(jié) ListofFigures圖Figure1:DynamicAreaSelectionFlow圖1動(dòng)態(tài)區(qū)選擇流 Figure2:DynamicAreaMACCalculation動(dòng)態(tài)區(qū)MAC計(jì) Introduction引 isoneofasetof sthatdescribetheBeijingAFCClearingCentre(ACC)interfacespecifications.本文檔是描述軌道交通自動(dòng)售檢票系統(tǒng)(ACC)接口規(guī)范的一組文檔之Theset sBEI-00017_CHConfigurationDataDefinitionBEI-00019_CHMifareUltralightCardDataDefinitionBEI-00020_CHMifareStandard1KCardDataDefinitionBEI-00021_CHUsageDataDefinitionBEI-00022_CHDeviceCardProcessingSpecificationBEI-00022_APPC_CHDeviceCardProcessingSpecificationAppendixC設(shè)備票卡處理規(guī)范附錄CBEI-00023_CHDeviceMan-MachineInterfaceSpecification設(shè)備人-BEI-00033_CHBaseTypeDataDefinitionBEI-00037_CHSystemInterfacesOverviewBEI-00039_CHACCtoLCInterfaceACCLCBEI-00040_CHSystemInitialValuesBEI-00045_CHOnlineEnquiryFunctionalSpecification查詢功能說BEI-00054_CHSAMInterfaceSpecificationSAMPurpose目Thepurposeofthis istodefinethedatastructuresandelementsoftheMifareUltralightcontactlesscardfortheBeijingACCproject.本文檔定義了軌道交通自動(dòng)售檢票系統(tǒng)使用的MifareUltralight非接觸卡Scope范Thescopeofthis islimitedtoadefinitionofthedatafortheMifareUltralightContactlessSingle-TripTicketICMF0ICU1fortheBeijingproject.本文檔僅限于定義供項(xiàng)目使用的MifareUltralight非接觸式單程票ICMF01CU1的數(shù)ThedetaileddescriptionofhowthedeviceprocessesthecardiscontainedinBEI-Terminology術(shù)Table1listsabbreviations,termsanddefinitionsusedinthisTable1:Abbreviations,Termsand表1:縮寫、術(shù)語和定縮術(shù)定AutomatedFareTheuseroftheConfigurationCyclicRedundancyMultirideAprepaidproductwhichprovidesthecardholderwiththerighttotravelforaspecificnumberofPeriodAprepaidproductprovidesthewiththerighttotravelforspecificAformofcontractbetweentheproductissuerandcardholder.Agenerictermforthecollectionofspecificproducttypes,i.e.multiride,periodandpurseproducts.PurseAproductthatprovidescardholderwithunitsthatareusedtoforgoodsandUniqueReferences參考文Thefollowingmaterialsaretobeusedinconjunctionwithorarereferencedby.[Ref: ConfigurationData[Ref: Intentionally[Ref: MifareStandard1KCardData[Ref: UsageData[Ref: DeviceCardProcessing[Ref: DeviceMan-MachineInterface[Ref: BaseTypeData[Ref: SystemInterfaces[Ref: ACCtoLC[Ref: SystemInitial[Ref: OnlineEnquiryFunctional[Ref: SAMInterface[Ref:13] MifareUltralightContactlessSingle-TripTicketIC,MF0ICU1,FunctionalSpecification,Revision3.0,March2003,PhilipsSemiconductors[Ref:14] ANSX9.52-1998TripleDataEncryptionAlgorithmModesOfOperation,ApprovedJuly29,1998,AmericanBankersAssociationOverview概ThissectiondescribesthecontextoftheMifareUltralightsmartcardandhowdataisrepresentedonit.Context背TheMifareUltralightcardisasimplecontactlessmemorycarddbyPhilipsandspecificallydesignedfortransportapplications.DataRepresentation數(shù)據(jù)表Allnumericvaluesdefinedinthis arespecifiedusingdecimalnotationunlessexplicitlyspecifiedotherwise.Alldatafieldsdefinedin shallbestoredinbig-endianCardData卡數(shù)ThissectionincludesdescriptionsStaticDynamicMultiridePursePeriodOverview概TheMifareUltralightcardhasatotalof512bits(64bytes)ofEEPROM,whichisorganisedin16pagesof4byteseach.MifareUltralight512位(64字節(jié))EEPROM164字TheEEPROMispartitionedasshowninTable2.EEPROM2表示。Table2:CardEEPROMMemory表2:卡的EEPROM結(jié)區(qū)Size大?。ㄎ徽f1UIDUID2OneTimeProgrble(OTP)3UserRead/WriteTotal:Bits(64ThethreememoryareasdefinedinTable2aredescribedinmoredetailinthefollowingUIDAreaUIDThe96-bitUIDAreaismandatedbyPhilipsandcontainsthefollowingCardserialnumber(7bytes),agloballyuniquenumber,whichcomplieswiththeISO/IEC14443-3andISO/IEC7816-6AMD.1standards(7字節(jié))ISO/IEC14443-3ISO/IEC7816-6AMD.1Serialnumbercheckdigits(2bytes),complyingwiththeISO/IEC14443-3序列號(hào)校驗(yàn)位(2字節(jié))ISO/IEC14443-3Internalusedata(1數(shù)據(jù)(1字節(jié))Datalockbytes(2bytes),tolocktheOneTimeProgrbleAreaandUserRead/WriteAreatoread-only.RefertothePhilipsMifareUltralightFunctionalSpecification[Ref:13]formoreinformationontheUIDArea.UID的信息參見PhilipsMifareUltralight功能規(guī)范[Ref:13]OneTimeProgrbleArea一次編程TheOneTimeProgrbleAreawillbeusedtostorethecardserialnumber,whichiswrittenwhenthecardismanufacturedandmaynotbesubsequentlyupdated.Notethattheseven-byteserialnumberstoredbyPhilipsintheUIDArea(seesection3.1.1)isunnecessarilylarge.Forthisreason,a32-bitserialnumbersuitablefortheBeijingsystemisstoredintheOneTimeProgrbleArea.請(qǐng)注意,飛利浦公司在UID區(qū)(參見3.1.1節(jié))的7字節(jié)序列號(hào)太大了。因此,適用于系統(tǒng)的一個(gè)32位序列號(hào)被在一次編程區(qū)內(nèi)。Table3:DataStoredintheOneTimeProgrble表3:在一次編程區(qū)內(nèi)的數(shù)字Size大?。ㄎ徽fThecardserialnumber,whichallowsthecardtobeuniquelyidentifiedwithintheBeijingsystem.ThecardserialnumberisassignedbythecardmanufactureraccordingtoBeijingsystemRangeTotal:位UserRead/WriteArea用戶讀寫TheUserRead/WriteAreawillcontainthemajorityofthecarddata.Theareawillbesplitintothreeblocks,comprising:Block1:StaticDatathatiswrittentothecardwhentheproductitcontainsisBlocks2and3:DynamicDatathatiswrittentothecardwhentheproductisused.Theblocksaresizedanddefinedidentically,andtheyarewrittentoalternayinordertoprovideanti-tearsupportforthecard.23塊:動(dòng)態(tài)數(shù)據(jù),在使用產(chǎn)品時(shí)寫進(jìn)卡中。這兩塊區(qū)域是完全相同的,它們被Table4:DataStoredintheUserRead/Write表4:在用戶讀/寫區(qū)的數(shù)塊Size大?。ㄎ徽f1Static2DynamicDataBlock3DynamicDataBlockTotal:Bits(48StaticData(IssuerArea)靜態(tài)數(shù)據(jù)(區(qū)Table5:Static5:靜態(tài)數(shù)字Size大?。ㄎ徽fCard2SpecifiestheversionoftheMifareUltralightcardThecurrentversionisoneRangeMifareUltralight卡上數(shù)據(jù)格式的版本目前的版本是1字Size大?。ㄎ徽fSpecifiesthenumberoftimesthecardhasbeenre-Range卡被重新的次數(shù)3Specifiestheversionofthedataencryptionkeythatwasusedtoprotectthedatastoredonthecard.Range確保在卡上數(shù)據(jù)安全的數(shù)據(jù)密鑰的版本9Specifiesthedate/timeofthestartofthemonththecardwasinitialisedasfollows:0=1stJanuary20061=1stFebruary20062=1stMarch200600:00(witharangeofapproximay42020061112006212200631ThebatchnumberthecardwasissuedRange0to1Specifieswhetherthecardhasbeenissuedfornormaluseorfortestpurposesasfollows:0=Thecardhasbeenissuedfornormal1=Thecardhasbeenissuedfortestortraining指定此卡是否已經(jīng)被以供正常使用或供測(cè)試使用0=此卡已經(jīng)被供正常使用1=此卡已經(jīng)被供測(cè)試或培訓(xùn)使用6IdentifiesthetypeofproductasspecifiedbyitsRange0..63字Size大?。ㄎ徽f3Specifiesthetypeofpassengerinthetransitsystem,e.g.Adult,Child.Range0..72Specifiesthekindofproductstoredonthe0=NoProduct(productnotyet1=Purse2=Period3=Multiride0=無產(chǎn)品(產(chǎn)品尚未123Specifiesthemonetaryvaluepaidbythecardholdertopurchasetheperiod/multirideproduct,orthevaluelastaddedtothepurse.RangeRMB0.00toRMB范圍:0.00元至1310.711forfutureuse.64Endof88Uniquelyidentifiesthedevicethatissuedtheproduct(byusingtheSAMIDofitsISAM).產(chǎn)品的設(shè)備唯一性標(biāo)識(shí)(ISAMSAM2Specifiesthepaymentmethodofproductpurchase0=1=2=3=0123=字Size大小(位說2SpecifieswhethervalidityDurationisstoredasoneof0=1=2=3=Calendar0=1237Thenumberofminutes/hours/days/monthsamultirideor,periodorpurseproductisvalidforonceitisactivated.Range5Identifiestheissueroftheproduct,relativetotheapplicationissuerRange0..310forfutureuse.MAC-32oftheentirestaticdatablock(exceptMAC).Thisiscalculatedovertheunencrypted(intext)versionofthedata.Total:DynamicData動(dòng)態(tài)數(shù)Table6:Dynamic6:動(dòng)態(tài)數(shù)字Size大?。ㄎ徽fCard1AcycliccounterthatallowsthedevicetodeterminewhetherDynamicDataBlockAorBiscurrentlyactive.Thisisusedforanti-tearprotection.Seesection3.3.1formoreinformation.RangeA3.3.12Specifiestheblockingstatusofthecardas0=1=Not2=3=Blocked–Surrendered/Captured0123廢棄/8Asequencenumberthatisincrementedundercertainconditions(definedbytheproducttype).Range一個(gè)序列號(hào),在特定條件下增加(由產(chǎn)品類型確定)1Specifieswhetheranhasbeen0=not1=0=未打1=已打字Size大?。ㄎ徽fJourney旅Specifiesthedateandtimefromwhichthejourneyisvalid.UpdatedonthefirstlegofthecurrentpassengerSpecifiedasthenumberofminutessincecardBaseDateTime(witharangeofapproximay88年)。8SpecifiesthedateandtimewhentheproductwaslastSpecifiedasthenumberofminutesfromtheticketstartDateTime(witharangeofapproximay254mins/4分鐘/4小時(shí))SpecifiesthelocationatwhichtheproductwaslastTakenfromamaptablethatallowstheentryof4094Setto0xFFFiflocation2Specifiesthenumberoftransfersthathavebeentakenforthecurrentjourney.字Size大?。ㄎ徽f3Specifiesthevalidationstatusofthejourneyas0=Productnotyet1=Lastusedtocheck-2=Lastusedtocheck-3=Lastusedtocheck-outintrainmalfunction4=Lastusedforcompensationfare567012345670forfutureuse.DynamicProductThedynamicproductdatastructure,whichisdependantonproducttype(seesections3.4.1,3.5.1and3.6.1).3.4.1節(jié),.1節(jié))。MACofthestaticanddynamicdataTotal:位UseoftheactiveStatusFieldactiveStatusTheactiveStatusfieldisa1-bitcycliccounter(range0..1)thatallowsthedevicetodeterminewhetherDynamicDataBlockAorBiscurrentlyactive.Thisisusedforanti-tearprotection.activeStatus1位的循環(huán)計(jì)數(shù)器(0..1),設(shè)備通過它可以判斷目前動(dòng)態(tài)數(shù)據(jù)塊A或B是否處于激活狀態(tài)。它被用于防保護(hù)。Thisnumberisincrementedonceeverytimeatransactionupdatesthedynamicdataonthecard;oncethevaluereaches1,itwrapsaroundto0again.Attheendofthetransaction,theupdatedcarddatawillbecopiedintothespecifieddatablock(AorB),andthepreviouscopyofthedataintheotherdatablockwillbep.Ifthetransactionistornwhilethecardisbeingupdated,thepreviousdataisleft在結(jié)束時(shí),更新后的卡中數(shù)據(jù)將被到指定的數(shù)據(jù)塊(A或B)中,另一數(shù)據(jù)塊中上次的數(shù)據(jù)將被保留下來。如果當(dāng)卡正在被更新時(shí)被中斷,則上次的數(shù)據(jù)保持不AnexampleoftheprocessinglogicisasBothblockAandBactiveStatusvaluesstartat0whenthecardis當(dāng)卡被時(shí),A塊和B塊的激活狀態(tài)值均自0開始Read(A=0,B=0,A.status=0)writetoA,setAvalue=(A=0,B=0,A.status=0)A,A=1Read(A=1,B=0)indicatesAlastwritten,sowritetoB,setBvalue=(A1B0)ABB=1Read(A=1,B=1)indicatesBlastwritten,sowritetoA,setAvalue=(A1B1)BAA=0Read(A=0,B=1)indicatesAlastwritten,sowritetoB,setBvalue=(A0B1)ABB=0Read(A=0,B=0,A.status!=0)indicatesBlastwritten,sowritetoA,setA=(A0B0A.status!=0)BAA=1Read(A=1,B=0)(A=1,B=0)等等。Thisfield,plustheMAC,isusedtoverifythataparticulardatablockisthecurrentactiveone.Oncetheactiveblockhasbeendetermined(above),thedevicewillverifytheMACofoneorbothblocks.激活(如上所述),MAC。RefertoSection5fordetailsonhowtheMACisIfblockAwaslastwrittenanditsMACisvalidthenblockAwillbethecurrentactiveblockandblockBwillbewritten.如果A數(shù)據(jù)塊是最后寫入的,并且它的動(dòng)態(tài)區(qū)MAC是有效的,那么數(shù)據(jù)塊A將是當(dāng)前的激活塊,B數(shù)據(jù)塊將被改寫。IfblockAwaslastwrittenanditsMACisinvalidthenblockBMACwillbecheckedandifitisvalidthenblockBwillbethecurrentactiveblockandblockAwillbe如果A數(shù)據(jù)塊是最后寫入的,并且它的動(dòng)態(tài)區(qū)MAC是無效的,那么數(shù)據(jù)塊B的動(dòng)態(tài)區(qū)MAC將被檢查,如果有效,那么數(shù)據(jù)塊B將是當(dāng)前的激活塊,數(shù)據(jù)塊A將被IfblockBwaslastwrittenanditsMACisvalidthenblockBwillbethecurrentactiveblockandblockAwillbewritten.如果B數(shù)據(jù)塊是最后寫入的,并且它的動(dòng)態(tài)區(qū)MAC是有效的,那么數(shù)據(jù)塊B將是A將被改寫。IfblockBwaslastwrittenanditsMACisinvalidthenblockAMACwillbecheckedandifitisvalidthenblockAwillbethecurrentactiveblockandblockBwillbe如果數(shù)據(jù)塊B是最后寫入的,并且它的動(dòng)態(tài)區(qū)MAC是無效的,那么數(shù)據(jù)塊A的動(dòng)態(tài)區(qū)MAC將被檢查,如果有效,那么數(shù)據(jù)塊A將是當(dāng)前的激活塊,數(shù)據(jù)塊B將被IfbothMACsareinvalid,thenthecardiscorruptandcannotbeusedforaFareThefollowingdiagramshowsthelogicalflowfordeterminingwhichdynamicareaistobereadfromandwrittentoforthecurrenttransaction:Figure1DynamicAreaSelectionFlow1動(dòng)態(tài)區(qū)選擇A=DynamicAreaB=DynamicAreaReadCard(bothAandB)A.activeStatus0B.activeStatus0A.journey.status=0(Productnotyetused)? A=ActiveA=Backup11B.activeStatus0A=ActiveAreaB=Backup1B=ActiveAreaA=BackupActiveandBackupAreaMACofActiveArea MACofBackupAreaCardCorrupt:ReturntoReadfromActiveAreaWritetoBackupReadfromBackupAreaWritetoActiveAreaPeriodProduct定期產(chǎn)ThissectiondescribesthedynamicdatafortheperiodPeriodProductDynamicData定期產(chǎn)動(dòng)態(tài)數(shù)Table7:PeriodProduct–Dynamic7:定期產(chǎn)品–動(dòng)態(tài)數(shù)ThedateandtimefromwhichtheproductisSpecifiedasthenumberofminutessincecardBaseDateTime(witharangeofapproximay8cardBaseDateTime起的分鐘數(shù)來表示(范圍大約8年)Iftheproducthasnotyetbeenactivated,thisfieldspecifiestheshelflifeoftheproduct(i.e.thelastdate/timethattheproductmaybeactivated).Whentheproductisactivated,deviceswillcalculatevalidityEndDateTimebasedonvalidityDurationType,validityDurationandvalidityStartDateTime.validityDurationType、SpecifiesthevalidoriginlocationfortheTakenfromamaptablethatallowstheentryof4094Setto0xFFFiflocation0xFFFSpecifiesthevaliddestinationlocationfortheTakenfromamaptablethatallowstheentryof4094Setto0xFFFiflocation0xFFF1Ifsetto1,theproductisalreadyIfsetto0,theproductwillbeactivatedwhenitisfirstusedforfarepayment.Whenactivatingtheproduct,validityStartDateTimewillbesettothecurrentdate/time,andthisfieldwillbesetto1.forfutureuse.Total:MultirideProduct計(jì)次產(chǎn)ThissectiondescribesthedynamicdataforthemultirideMultirideProductDynamicData計(jì)次產(chǎn)動(dòng)態(tài)數(shù)Table8:MultirideProduct–Dynamic8:計(jì)次產(chǎn)品–動(dòng)態(tài)數(shù)ThedateandtimefromwhichtheproductisSpecifiedasthenumberofminutessincecardBaseDateTime(witharangeofapproximay88年Iftheproducthasnotyetbeenactivated,thisfieldspecifiestheshelflifeoftheproduct(i.e.thelastdate/timethattheproductmaybeactivated).Whentheproductisactivated,deviceswillcalculatevalidityEndDateTimebasedonvalidityDurationType,validityDurationandvalidityStartDateTime.validityDurationvalidityStartDateTime計(jì)算8ThenumberofridesremaininginthemultirideRange0..255SpecifiesthevalidoriginlocationfortheTakenfromamaptablethatallowstheentryof4094Setto0xFFFiflocation0xFFFSpecifiesthevaliddestinationlocationfortheTakenfromamaptablethatallowstheentryof4094Setto0xFFFiflocation0xFFF1Ifsetto1,theproductisalreadyIfsetto0,theproductwillbeactivatedwhenitisfirstusedforfarepayment.Whenactivatingtheproduct,validityStartDateTimewillbesettothecurrentdate/time,andthisfieldwillbesetto1.1Specifiesthetotalnumberofridesfromthemultirideproductdeductedforthecurrentjourney.Range0to011forfutureuse.Total:PurseProduct錢包產(chǎn)ThissectiondescribesthedynamicdataforthepursePurseProductDynamicData錢包產(chǎn)動(dòng)態(tài)數(shù)Table9:PurseProduct–Dynamic9:錢包產(chǎn)品–動(dòng)態(tài)數(shù)Product產(chǎn)ThedatefromwhichthePurseproductisSpecifiedasthenumberofdayssincecardBaseDateTime(witharangeofapproximay11years)產(chǎn)品有效日期。年)Specifiestheremainingvalueinthepurse(i.e.RangeRMB0.00toRMB范圍:0.00元至1310.711Ifsetto1,theproductisalreadyactivated.1,產(chǎn)品已Ifsetto0,theproductwillbeactivatedwhenitisfirstusedforfarepayment.值為0,產(chǎn)品將在第一次使用時(shí)激活Whenactivatingtheproduct,validityStartDatewillbesettothecurrentdate,andthisfieldwillbesetto1.1Journey旅Specifiesthetotalvaluedeductedfromthepurseforthecurrentjourney.RangeRMB0.00toRMB范圍:RMB0.00元至327.67SpecifiestheoriginlocationforthecurrentTakenfromamaptablethatallowstheentryof4094Setto0xFFFiflocation0xFFF0forfutureuse.Total:CardSerialNumberDefinition卡序列ThePhysicalSerialNumberisstoredinthecardintheserialNumberfieldintheOneTimeProgrble(OTP)Area.Itisa32bitnumberranging0x 0xFFFFFFFFgivingatotalof4,294,967,295uniquenumbers.Thereisnocheckdigitstoredinthe物理序列號(hào)存在卡上可編程區(qū)(OTP)的serialNumber字段。它是一個(gè)32位數(shù),從0x 到0xFFFFFFFF,總數(shù)為4,294,967,295。TheLogicalSerialNumberisacombinationofthePhysicalSerialNumber(above)andthelifecycleCountfield.ThePrintedSerialNumberisthenumberprintedbythecardmanufactureronthesurfaceofthecard.Theinformationprintedisasfollows:4digitCityCode–Beijing=1000(AAAA)4位城市代碼4digitIndustryCode7513(BBBB)4ACC確定10digitPhysicalSerialNumberasstoredintheserialNumberNNNNNNNNNN)10serialNumber存的一樣(NNNNNNNNNN)1digitCheckDigitcalculatedacrosstheCityCodeIndustryCodeandPhysicalSerialNumber.(D)1(D)TheCheckDigitiscalculatedusingtheLuhnformula.PleaserefertotheISO7812校驗(yàn)位使用Luhn計(jì)算。請(qǐng)參見ISO7812標(biāo)準(zhǔn)Thenumberwillbeprintedinthefollowingformat:AAAABBBB印刷的數(shù)字如下格式:AAAABBBBNNNNNNNNNNDMACCalculationMAC計(jì)TheStatic(Issuer)areaMACiscalculatedovertheUIDandtheOTPserialNumber靜態(tài)區(qū)(區(qū))MAC在UID和OTP的序列號(hào)(serialNumber)字段的基礎(chǔ)上進(jìn)行計(jì)算TheDynamicareaMACsaregeneratedfromtheCRCcalculatedovertheUID,CSN,staticdataandthedynamicdata(AorB).動(dòng)態(tài)區(qū)MAC根據(jù)覆蓋UID、CSN、靜態(tài)區(qū)數(shù)據(jù)和動(dòng)態(tài)區(qū)數(shù)據(jù)(A或B)計(jì)算的CRCTheStaticAreaandDynamicAreaMACsuseseparateThereisnodiversificationontheMACs.MAC上不進(jìn)行分散。The80FCcommand(see[Ref:12])willbeusedtoverifytheStaticMACandgeneratetheDynamicMACinasinglecommandtotheSAM.80FC指令(12MACMAC,這SAM中用一條指令實(shí)現(xiàn)的。StaticAreaMACCalculationMAC計(jì)NOTE:ThisisonlydonebytheCard注:由卡商完成Calculatethe8inputbytes(M0toM7)fortheStaticAreaMACgenerationfromtheUIDandCSNisasfollows:MACUIDCSN8個(gè)輸入字節(jié)(M0M7),如下所示:M1[0]=UID[0]^UID[6]M1[1]=UID[1]^M1[2]=UID[2]^UID[4]M1[3]=UID[3]M1[4]=M1[5]=M1[6]=M1[7]=DynamicAreaMACCalculation動(dòng)態(tài)MAC計(jì)TheDynamicareaMACiscalculatedasInitiallyachecksumiscalculatedusingtheCRC-32algorithmdefinedinsection5.1.3.ThechecksumiscalculatedovertheUID,CSN,staticareaandthedynamicareawhichtheMACisin.ThusifthestaticareaisupdatedbothdynamicareaAandBwillneedtohavetheirMACrecalculated.This,however,onlyoccursduringcardissueorreissue,andnotatagate,soisnotaperformanceissueforgates.首先,先利用5.1.3節(jié)中的CRC-32算法計(jì)算一個(gè)校驗(yàn)和。該校驗(yàn)和將覆蓋UID,CSN,靜MACAB都必須重新計(jì)算他們的MAC。這只會(huì)發(fā)生在卡或者重新時(shí),不是在閘機(jī)商,所以不會(huì)對(duì)閘機(jī)的TheinputstotheMACvalidationfunctionM1[0]=UID[0]^M1[1]=UID[1]^M1[2]=UID[2]^UID[4]M1[3]=UID[3]M1[4]=M1[5]=M1[6]=M1[7]=M1[8]=StaticAreaMAC>>24M1[9]=StaticAreaMAC>>16M1[10]=StaticAreaMAC>>8M1[11]=StaticAreaMACM1[12]=crc>>24M1[13]=crc>>16M1[14]=crc>>8M1[15]=crcM1[16]=M1[12]^M1[13]^M1[14]^TheM1dataispassedtotheSAMaspartofthe80FCcommand(see[Ref:12]).Thisresultsin5SectorIDs(of6byteseach)beinggeneratediftheStaticAreaMACisvalid.M180FC命令的一部分送往SAM(12】)MAC有5ID(6字節(jié))。Usingthese30bytesasastringof240bits(m[0]tom[239])a12bitMACisgeneratedasshownbelow.使用這30個(gè)字節(jié)作為一個(gè)240bit的數(shù)組(m[0]到m[239]),一個(gè)12bit的MACA[x]andBholds12bit m[11]thatis m[23]thatis m[239]thatisso A[20];thatisBistheresultant12bitFigure2DynamicAreaMACCalculation動(dòng)態(tài)區(qū)MAC計(jì)CRC-32AlgorithmCRC-32算CRC-32isanalgorithminwhichapolynomialisusedtocalculateaCRCvaluethatcanbeusedtodetecterrorsinan ingbitstream.CRC-32CRC值,使用該值來發(fā)現(xiàn)進(jìn)來的位Theoutputofthealgorithmis32bitsinTheinputtothealgorithm(themessage)isaseriesof8-bitThegeneratorpolynomialusedfortheCRC-32algorithmisasfollows:CRC-32算法使用的生成多項(xiàng)式是:Polynomial=x32+x26+x23+x22+x16+x12+x11+x10+x8+x7+x5+x4+x2+x1+x0Polynomial=ThestartvalueisCRC-32ImplementationCRC-32實(shí)constU32_tcrc32_tab[]= /*CRCpolynomial0xEDB88320 , ,0xEE0E612C,0x990951BA,0x076DC419,0xE963A535,0x9E6495A3,0x0EDB8832,0x79DCB8A4,0xE0D5E91E,0x09B64C2B,0x7EB17CBD,0xE7B82D07,0x90BF1D91,0x1DB71064,0xF3B97148,0x84BE41DE,0x1ADAD47D,0x6DDDE4EB,0xF4D4B551,0x136C9856,0x646BA8C0,0xFD62F97A,0x8A65C9EC,0x14015C4F,0xFA0F3D63,0x8D080DF5,0x3B6E20C8,0x4C69105E,0xD56041E4, 0x3C03E4D1,0x4B04D447,0xD20D85FD,0xA50AB56B,0x35B5A8FA,0xDBBBC9D6,0xACBCF940,0x32D86CE3,0x45DF5C75,0xDCD60DCF,0x26D930AC,0x51DE003A,0xC8D75180,0xBFD06116,0x21B4F4B5,0xCFBA9599,0xB8BDA50F,0x2802B89E,0x5F058808,0xC60CD9B2,0x2F6F7C87,0x58684C11,0xC1611DAB,0xB6662D3D,0x76DC4190,0x98D220BC,0xEFD5102A,0x71B18589,0x06B6B51F,0x9FBFE4A5,0x7807C9A2,0x0F00F934,0x9609A88E,0xE10E9818,0x7F6A0DBB,0x91646C97,0xE6635C01,0x6B6B51F4,0x1C6C6162,0x856530D8,0x6C0695ED,0x1B01A57B,0x8208F4C1,0xF50FC457,0x65B0D9C6,0x8BBEB8EA,0xFCB9887C,0x62DD1DDF,0x15DA2D49,0x8CD37CF3,0x4DB26158,0x3AB551CE,0xA3BC0074,0xD4BB30E2,0x4ADFA541,0xA4D1C46D,0xD3D6F4FB,0x4369E96A,0x346ED9FC,0xAD678846,0x44042D73,0x33031DE5,0xAA0A4C5F,0xDD0D7CC9, C,0xBE0B1010,0xC90C2086,0x5768B525,0x206F85B3,0xB966D409,0x5EDEF90E,0x29D9C998,0xB0D09822,0xC7D7A8B4,0x59B33D17,0xB7BD5C3B,0xC0BA6CAD,0xEDB88320,0x9ABFB3B6,0x03B6E20C,0xEAD54739,0x9DD277AF,0x04DB2615,0x73DC1683,0xE3630B12,0x0D6D6A3E,0x7A6A5AA8,0xE40ECF0B,0x9309FF9D,0x0A00AE27,0xF00F9344,0x8708A3D2,0x1E01F268,0x6906C2FE,0xF762575D,0x196C3671,0x6E6B06E7,0xFED41B76,0x89D32BE0,0x10DA7A5A,0xF9B9DF6F,0x8EBEEFF9,0x17B7BE43,0x60B08ED5,0xD6D6A3E8,0x38D8C2C4,0x4FDFF252,0xD1BB67F1,0xA6BC5767,0x3FB506DD,0xD80D2BDA,0xAF0A1B4C,0x36034AF6,0x41047A60,0xDF60EFC3,0x316E8EEF,0x4669BE79,0xCB61B38C,0xBC66831A,0x256FD2A0,0xCC0C7795,0xBB0B4703,0x220216B9, F,0xC5BA3BBE,0x2BB45A92,0x5CB36A04,0xC2D7FFA7,0xB5D0CF31,0x2CD99E8B,0x9B64C2B0,0xEC63F226,0x756AA39C,0x026D930A,0x9C0906A9, , ,0x95BF4A82,0xE2B87A14,0x7BB12BAE,0x92D28E9B,0xE5D5BE0D,0x7CDCEFB7,0x0BDBDF21,0x86D3D2D4,0x68DDB3F8,0x1FDA836E,0x81BE16CD,0xF6B9265B,0x6FB077E1,0x88085AE6,0xFF0F6A70,0x66063BCA,0x11010B5C,0x8F659EFF,0x616BFFD3,0x166CCF45,0xA00AE278,0xD70DD2EE,0x4E048354, ,0xD06016F7, D,0x3E6E77DB,0xAED16A4A,0x40DF0B66,0x37D83BF0,0xA9BCAE53,0xDEBB9EC5,0x47B2CF7F,0xBDBDF21C,0xCABAC28A,0x53B39330,0x24B4A3A6,0xBAD03605,0x54DE5729,0x23D967BF,0xB3667A2E,0xC4614AB8,0x5D681B02,0xB40BBE37,0xC30C8EA1,0x5A05DF1B,******ComputestheCRC32onablockof****void Thestartingaddressoftheblockof**U32_t Thelengthofthememory**U32_t InitalvectorforcalculatedCRC**** ReturnstheCRC****ThisCRCemploysthereverse-polynomialcalculationU32_tCrc32(void*pStart,U32_tlength,U32_t{ U8_t =registerconstU32_t =while(--length){crc32=p_crc32_tab[(*pS++^(U8_t)crc32)&0xFF]^(crc32>>}return}DetailedCardLayout票卡具體結(jié)Table10definesthedetailedcardlayout,includingtheoffsetandlengthinbitsofeachdatafield.Table10:DetailedCard表10:票卡具體結(jié)字偏移(位長(位加UIDUID0NotNotNotOneTimeProgrble一次可編程N(yùn)otUserRead/Write用戶讀寫Static靜態(tài)數(shù)2NotNot3Not9NotNot1Not6Not3Not2NotNot1NotNot2Not2Not7Not5Not0Not字偏移(位長(位加NotDynamicDataBlock動(dòng)態(tài)數(shù)據(jù)1Not2Not8Not1NotNot8NotNot2Not3Not0NotPeriodProductDynamicData(ifcardcontainsthistypeof定期產(chǎn)品動(dòng)態(tài)數(shù)據(jù)(如果卡包含該類型產(chǎn)品NotNotNot1NotNotMultirideProductDynamicData(ifcardcontainsthistypeof計(jì)次產(chǎn)品動(dòng)態(tài)數(shù)據(jù)(如果卡包含該類型產(chǎn)品Not8NotNotNot1Not1Not1NotPurseProductDynamicData(ifcardcontainsthistypeof錢包產(chǎn)品動(dòng)態(tài)數(shù)據(jù)(如果卡包含該類型產(chǎn)品NotNot1NotNotNot0Not字偏移(位長(位加MACforDynamicDataBlock動(dòng)態(tài)數(shù)據(jù)ADynamicDataBlock動(dòng)態(tài)數(shù)據(jù)1Not2Not8Not1NotNot8NotNot2Not3Not0NotPeriodProductDynamicData(ifcardcontainsthistypeof定期產(chǎn)品動(dòng)態(tài)數(shù)據(jù)(如果卡包含該類型產(chǎn)品NotNotNot1NotNotMultirideProductDynamicData(ifcardcontainsthistypeof計(jì)次產(chǎn)品動(dòng)態(tài)數(shù)據(jù)(如果卡包含該類型產(chǎn)品Not8NotNotNot1Not1Not1NotPurseProductDynamicData(ifcardcontainsthistypeof錢包產(chǎn)品動(dòng)態(tài)數(shù)據(jù)(如果卡包含該類型產(chǎn)品NotNot1NotNotNot0Not字偏移(位長(位加MACforDynamicDataBlock動(dòng)態(tài)數(shù)據(jù)BAppendix PreviousHistoryA文檔歷修正版修正日描Author作17JanInitialdraft(tableof初稿 Al20JanUpdatedafterinternalShane18FebIncorporatedcarddataLeon25FebElaboratedcarddataLeon25FebVersionedfor版Shane15MarchChangedlastLocation,origin&destinationfieldsto14bitsandadjustedpaddingbitstocompensatelastLocationorigin&destination14位,并Neil27Correctedunspecifiedvaluesfor’lastLocation’nowitis14bits.Neil27VersionedforRelease2oftheACCInterfaceShane12AprilAdded3.6-PurseNeil12April3.6-PurseProduct–UpdatedafterRemovedcurrencyanddepositfieldsandaddedorigin,destinationandpaddingfields.Reducedremainingfieldsizes.3.6currency&depositorigin,destination&paddingremaining字段的Neil13April3.6-PurseProduct–Updatedafterfurtherorigin,destinationnolongerneeded,restoredendDateTimeto24bits,remainingValueto17bitsandadjustedpaddingsize.3.6OrigindestinationendDateTime24位,remaining17位,并padding大Neil21April3.3DynamicData-AddedprintedflagandchangedblockingStatusto3bits.Table11–UpdatedforabovechangesandaddedP
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 食品超市企業(yè)ESG實(shí)踐與創(chuàng)新戰(zhàn)略研究報(bào)告
- 豇豆及菜豆罐頭企業(yè)數(shù)字化轉(zhuǎn)型與智慧升級(jí)戰(zhàn)略研究報(bào)告
- 生物發(fā)酵制品企業(yè)數(shù)字化轉(zhuǎn)型與智慧升級(jí)戰(zhàn)略研究報(bào)告
- 道路旅客運(yùn)輸企業(yè)數(shù)字化轉(zhuǎn)型與智慧升級(jí)戰(zhàn)略研究報(bào)告
- 直流離子風(fēng)機(jī)行業(yè)相關(guān)投資計(jì)劃提議
- 汽車燈相關(guān)行業(yè)投資規(guī)劃報(bào)告
- 2025年教學(xué)專用儀器合作協(xié)議書
- 利用微藻處理蔬菜加工廢水及其資源化利用的藻種篩選和效果評(píng)估
- 氣固兩相高溫系統(tǒng)中紅外輻射傳熱過程的研究
- 時(shí)空協(xié)同的車聯(lián)網(wǎng)群智感知技術(shù)研究
- 外浮頂儲(chǔ)罐·內(nèi)浮頂儲(chǔ)罐泡沫堰PPT
- 魏晉南北朝時(shí)期園林-課件
- 甘肅省平?jīng)鍪懈骺h區(qū)鄉(xiāng)鎮(zhèn)行政村村莊村名明細(xì)及行政區(qū)劃代碼
- (完整版)初中道德與法治課程標(biāo)準(zhǔn)
- 自動(dòng)化腹膜透析(APD)的臨床應(yīng)用課件
- 滌綸長絲生產(chǎn)標(biāo)準(zhǔn)工藝簡(jiǎn)介
- 數(shù)字圖像處理-6第六章圖像去噪課件
- 監(jiān)理施工設(shè)計(jì)圖紙簽發(fā)表
- GB∕T 38058-2019 民用多旋翼無人機(jī)系統(tǒng)試驗(yàn)方法
- DB43∕T 801-2013 二次張拉低回縮鋼絞線豎向預(yù)應(yīng)力短索錨固體系設(shè)計(jì)、施工和驗(yàn)收規(guī)范
- 附表1:網(wǎng)絡(luò)及信息安全自查表
評(píng)論
0/150
提交評(píng)論