09.12.2012 Views

RM0090: Reference manual - STMicroelectronics

RM0090: Reference manual - STMicroelectronics

RM0090: Reference manual - STMicroelectronics

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>RM0090</strong> Cryptographic processor (CRYP)<br />

before they are written into the OUT FIFO. For example, the operation would be byte<br />

swapping for an ASCII text stream.<br />

The kind of data to be processed is configured with the DATATYPE bitfield in the CRYP<br />

control register (CRYP_CR).<br />

Table 89. Data types<br />

DATATYPE in<br />

CRYP_CR<br />

Swapping performed<br />

00b No swapping<br />

01b<br />

Half-word (16-bit)<br />

swapping<br />

10b Byte (8-bit) swapping<br />

11b Bit swapping<br />

System memory data<br />

(plaintext or cypher)<br />

Example: TDES block value 0xABCD77206973FE01 is<br />

represented in system memory as:<br />

TDES block size = 64bit = 2x 32 bit<br />

0xABCD7720 6973FE01<br />

system memory<br />

0xABCD7720<br />

0x6973FE01<br />

Example: TDES block value 0xABCD77206973FE01 is<br />

represented in system memory as:<br />

TDES block size = 64bit = 2x 32 bit<br />

0xABCD 7720 6973 FE01<br />

0x7720 ABCD<br />

0xFE01 6973<br />

Example: TDES block value 0xABCD77206973FE01 is<br />

represented in system memory as:<br />

TDES block size = 64bit = 2x 32 bit<br />

0xAB CD 77 20 69 73 FE 01<br />

system memory<br />

0x 20 77 CD AB<br />

0x 01 FE 73 69<br />

TDES block value 0x4E6F772069732074 is represented in system<br />

memory as:<br />

TDES Bloc size = 64bit = 2x 32 bit<br />

0x4E 6F 77 20 69 73 20 74<br />

0100 1110 0110 1111 0111 0111 0010 0000<br />

0110 1001 0111 0011 0010 0000 0111 0100<br />

system memory<br />

system memory<br />

0x04 EE F6 72<br />

0x2E 04 CE 96<br />

Figure 214 shows how the 64-bit data block M1...64 is constructed from two consecutive 32bit<br />

words popped off the IN FIFO by the CRYP processor, according to the DATATYPE<br />

value. The same schematic can easily be extended to form the 128-bit block for the AES<br />

cryptographic algorithm (for the AES, the block length is four 32-bit words, but swapping only<br />

takes place at word level, so it is identical to the one described here for the TDES).<br />

Note: The same swapping is performed between the IN FIFO and the CRYP data block, and<br />

between the CRYP data block and the OUT FIFO.<br />

@<br />

@+4<br />

@<br />

@+4<br />

@<br />

@+4<br />

Doc ID 018909 Rev 3 564/1416<br />

@<br />

@+4<br />

0000 0100 1110 1110 1111 0110 0111 0010 @<br />

0010 1110 0000 0100 1100 1110 1001 0110 @+4

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

Saved successfully!

Ooh no, something went wrong!