06.11.2014 Views

A User Centric Security Model for Tamper-Resistant Devices

A User Centric Security Model for Tamper-Resistant Devices

A User Centric Security Model for Tamper-Resistant Devices

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

C.2 Online Attestation Mechanism<br />

201 apdu . setOutgoing ( ) ;<br />

202 apdu . setOutgoingLength ( ( short ) r e s p o n s e B u f f e r . l e n g t h ) ;<br />

203 apdu . sendBytesLong ( r e s p o n s e B u f f e r , ( short ) 0 ,<br />

204 ( short ) r e s p o n s e B u f f e r . l e n g t h ) ;<br />

205 JCSystem . r e q u e s t O b j e c t D e l e t i o n ( ) ;<br />

206 }<br />

207<br />

208 void s e l f t e s t P r o c e s s ( ) {<br />

209 byte [ ] memoryWordRead = new byte [ 4 ] ;<br />

210 byte [ ] hashValue = new byte [ 3 2 ]<br />

211 byte rcount = ( byte ) 0x00 ;<br />

212 byte seedRef = ( byte ) 0x00 ;<br />

213 while ( rcount < r e c e i v i n g B u f f e r . l e n g t h ) {<br />

214 seedRef=(short ) ( r e c e i v i n g B u f f e r [ rcount ] %<br />

215 ( short ) ( MemoryContents . length −1) ) ;<br />

216 seedRef = ( byte ) (myPrngHMAC. generateRandom ( seedRef ) . [ 0 ]<br />

217 % ( MemoryContents . length −16) )<br />

218 U t i l . arrayCopyNonAtomic ( MemoryContents ,<br />

219 seedRef , hashValue , ( short ) 0 , ( short ) 16) ;<br />

220 U t i l . arrayCopyNonAtomic (mK,<br />

221 ( short ) 0 , hashValue , ( short ) 16 , ( short ) 16) ;<br />

222 SHA128 . doFinal ( hashValue , ( short ) 0 , ( short ) hashValue . length ,<br />

223 hashValue , ( short ) 0) ;<br />

224 <strong>for</strong> ( short i =0; i

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!