AES Engine: Difference between revisions
mostly courtesy of neimod. someone needs to wikify those tables a bit :P |
|||
| (4 intermediate revisions by 4 users not shown) | |||
| Line 1: | Line 1: | ||
== Registers == | == Registers == | ||
{| class="wikitable" border="1" | {| class="wikitable" border="1" | ||
! NAME | ! NAME | ||
! ADDRESS | ! ADDRESS | ||
| Line 46: | Line 45: | ||
| 48 | | 48 | ||
|} | |} | ||
== REG_AESCNT == | == REG_AESCNT == | ||
{| class="wikitable" border="1" | |||
! BIT | |||
! DESCRIPTION | |||
|- | |||
| 4-0 | |||
| Write fifo count | |||
|- | |||
| 9-5 | |||
| Read fifo count | |||
|- | |||
| 10 | |||
| Flush write fifo | |||
|- | |||
| 11 | |||
| Flush read fifo | |||
|- | |||
| 15-12 | |||
| ? | |||
|- | |||
| 18-16 | |||
| MAC size (size in bytes = s*2+2, e.g, 7 == 16 bytes) | |||
|- | |||
| 19 | |||
| ? | |||
|- | |||
| 20 | |||
| MAC input control (0 = read MAC from FIFO, 1 = read MAC from REG_AESMAC) | |||
|- | |||
| 21 | |||
| MAC status (0 = invalid, 1 = verified) | |||
|- | |||
| 23-22 | |||
| ? | |||
|- | |||
| 24 | |||
| Key select | |||
|- | |||
| 25 | |||
| Key schedule busy | |||
|- | |||
| 27-26 | |||
| Key slot (0..3) | |||
|- | |||
| 29-28 | |||
| Mode (0=AES CCM decrypt, 1=AES CCM encrypt, 2=AES CTR) | |||
|- | |||
| 30 | |||
| Interrupt enable | |||
|- | |||
| 31 | |||
| Enable | |||
|} | |||
== REG_AESBLKCNT == | == REG_AESBLKCNT == | ||
{| class="wikitable" border="1" | |||
! BIT | |||
! DESCRIPTION | |||
|- | |||
| 15-0 | |||
| CBC-MAC associated data blocks to process (1 block = 4 words) | |||
|- | |||
| 31-16 | |||
| CTR or payload data blocks to process (1 block = 4 words) | |||
|} | |||
== REG_AESKEY0/1/2/3 == | == REG_AESKEY0/1/2/3 == | ||
{| class="wikitable" border="1" | |||
! BYTE | |||
! DESCRIPTION | |||
|- | |||
| 0-15 | |||
| Key data | |||
|- | |||
| 16-31 | |||
| Special key data X | |||
|- | |||
| 32-47 | |||
| Special key data Y | |||
|} | |||
Key gets updated when either the last word of the key data or the last word of "special key data y" is written. When writing to special key data the actual key is F((key data x) xor (key data y)) where F is some unknown function implemented in hardware. | |||
== AES CCM mode (Counter with CBC-MAC) == | == AES CCM mode (Counter with CBC-MAC) == | ||