09.12.2012 Views

RM0090: Reference manual - STMicroelectronics

RM0090: Reference manual - STMicroelectronics

RM0090: Reference manual - STMicroelectronics

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.

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

Figure 212. AES-CTR mode decryption<br />

AHB2 data write<br />

(before CRYP<br />

is enabled)<br />

+1<br />

K0...3<br />

(I + 1) is written<br />

back into IV<br />

at same time<br />

than P is pushed<br />

in OUT FIFO<br />

128, 192<br />

or 256<br />

DATATYPE<br />

IV0...1(L/R)<br />

AEA, encrypt<br />

DATATYPE<br />

IN FIFO<br />

ciphertext P<br />

C, 128 bits<br />

swapping<br />

I, 128 bits<br />

O, 128 bits<br />

OUT FIFO<br />

plaintext C<br />

Ps, 128 bits<br />

1. K: key; C: cipher text; I: input Block; o: output block; Ps: plain text before swapping (when decoding) or<br />

after swapping (when encoding); Cs: cipher text after swapping (when decoding) or before swapping (when<br />

encoding); P: plain text; IV: Initialization vectors.<br />

Figure 213 shows the structure of the IV block as defined by the standard [2]. It is composed<br />

of three distinct fields.<br />

Figure 213. Initial counter block structure for the Counter mode<br />

● Nonce is a 32-bit, single-use value. A new nonce should be assigned to each different<br />

communication.<br />

● The initialization vector (IV) is a 64-bit value and the standard specifies that the<br />

encryptor must choose IV so as to ensure that a given value is used only once for a<br />

given key<br />

● The counter is a 32-bit big-endian integer that is incremented each time a block has<br />

been encrypted. The initial value of the counter should be set to ‘1’.<br />

The block increments the least significant 32 bits, while it leaves the other (most significant)<br />

96 bits unchanged.<br />

+<br />

Cs, 128 bits<br />

swapping<br />

P, 128 bits<br />

Nonce 32 bits<br />

Initialization vector (IV)<br />

64 bits<br />

Counter 32 bits<br />

ai16074<br />

MS19025V1<br />

Doc ID 018909 Rev 3 558/1416

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

Saved successfully!

Ooh no, something went wrong!