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.9 Plat<strong>for</strong>m Binding Protocol<br />

374 MessageDigest myHashGen = MessageDigest . g e t I n s t a n c e<br />

375 ( MessageDigest .ALG_SHA_256, f a l s e ) ;<br />

376 tempLength = ( short )myHashGen . doFinal ( this . ClassDH . dhModulus ,<br />

( short ) 0 ,<br />

377 ( short ) this . ClassDH . dhModulus . length , r e c e i v i n g B u f f e r ,<br />

378 copyPointer ) ;<br />

379 this . r e c e i v i n g B u f f e r [ encryptedChildPointer ]++;<br />

380 this . shortToBytes ( this . r e c e i v i n g B u f f e r , generalLengthPointer ,<br />

381 ( short ) ( tempLength ) ) ;<br />

382 copyPointer += tempLength ;<br />

383 copyPointer = U t i l . arrayCopyNonAtomic ( this . U s e r I d e n t i t y , ( short )<br />

384 0 , this . r e c e i v i n g B u f f e r , copyPointer , ( short )<br />

385 this . U s e r I d e n t i t y . l e n g t h ) ;<br />

386 this . r e c e i v i n g B u f f e r [ encryptedChildPointer ]++;<br />

387 copyPointer = U t i l . arrayCopyNonAtomic ( this . SCBIdentity , ( short )<br />

388 0 , this . r e c e i v i n g B u f f e r , copyPointer , ( short )<br />

389 this . SCBIdentity . l e n g t h ) ;<br />

390 this . r e c e i v i n g B u f f e r [ encryptedChildPointer ]++;<br />

391 copyPointer = U t i l . arrayCopyNonAtomic ( this . SCARandomNumberArray ,<br />

392 ( short ) 0 , this . r e c e i v i n g B u f f e r , copyPointer , ( short )<br />

393 this . SCARandomNumberArray . l e n g t h ) ;<br />

394 this . r e c e i v i n g B u f f e r [ encryptedChildPointer ]++;<br />

395 copyPointer = U t i l . arrayCopyNonAtomic ( this . SCBRandomNumberArray ,<br />

396 ( short ) 0 , this . r e c e i v i n g B u f f e r , ( short ) copyPointer , ( short )<br />

397 this . SCBRandomNumberArray . l e n g t h ) ;<br />

398 this . r e c e i v i n g B u f f e r [ encryptedChildPointer ]++;<br />

399 try {<br />

400 this . signGenerate ( r e c e i v i n g B u f f e r , ( short ) ( e n c r y p t i o n O f f s e t ) ,<br />

401 ( short ) ( copyPointer − e n c r y p t i o n O f f s e t ) ,<br />

402 phSCAKeyPair . g e t P r i v a t e ( ) ,<br />

403 S i g n a t u r e .MODE_SIGN) ;<br />

404 this . r e c e i v i n g B u f f e r [ encryptedChildPointer ]++;<br />

405 } catch ( Exception cE ) {<br />

406 ISOException . throwIt ( ( short ) 0xFA17) ;<br />

407 }<br />

408 copyPointer = U t i l . arrayCopyNonAtomic ( this . SCACertificate ,<br />

409 ( short ) 0 , this . r e c e i v i n g B u f f e r , copyPointer , ( short )<br />

410 this . SCACertificate . l e n g t h ) ;<br />

411 this . r e c e i v i n g B u f f e r [ encryptedChildPointer ]++;<br />

412 try {<br />

413 this . messageEncryption ( r e c e i v i n g B u f f e r , ( short )<br />

414 ( encryptedChildPointer + ( short ) 1) ,<br />

415 ( short ) ( copyPointer −<br />

416 ( encryptedChildPointer + ( short ) 1) ) ) ;<br />

417 } catch ( Exception cE ) {<br />

418 ISOException . throwIt ( ( short ) ( copyPointer −<br />

419 encryptedChildPointer + ( short ) 1) ) ;<br />

420 }<br />

421 this . shortToBytes ( this . r e c e i v i n g B u f f e r , ( short )<br />

422 ( encryptedChildPointer − ( short ) 2) , ( short )<br />

423 ( copyPointer − ( short ) ( encryptedChildPointer<br />

412

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

Saved successfully!

Ooh no, something went wrong!