English
Language : 

ENC624J600-I Datasheet, PDF (134/168 Pages) Microchip Technology – Stand-Alone 10/100 Ethernet Controller with SPI or Parallel Interface
ENC424J600/624J600
To encrypt a block using CBC mode:
1. Load the encryption key as described in
Section 15.3.1 “Key Support”.
2. Set AESOP<1:0> (ECON1<10:9>) to ‘01’.
3. Copy the Initialization Value (IV) to TEXTA at
7C20h.
4. Copy the plaintext message to TEXTB at
7C30h.
5. Set AESST (ECON1<11>) to initiate the
encryption.
6. Wait for the hardware to clear AESST.
7. Read the ciphertext message from TEXTA at
7C20h.
8. Repeat steps 4-7 for subsequent blocks. The
ciphertext from the previous block automatically
becomes the IV for the following block.
To decrypt a block using CBC mode:
1. Initialize the decryption key as described in
Section 15.3.1 “Key Support”.
2. Set AESOP<1:0> to ‘10’.
3. Copy the Initialization Value (IV) to TEXTB at
7C30h.
4. Copy the ciphertext message to TEXTA at
7C20h.
5. Set AESST to initiate the decyption.
6. Wait for the hardware to clear AESST.
7. Read the plaintext message from XOROUT at
7C40h.
8. If another block is to be decrypted, copy the
ciphertext message from this block to TEXTB at
7C30h. The ciphertext from this block becomes
the IV for the following one.
9. Repeat steps 4-8 for subsequent blocks.
The context for CBC mode consists of both the AES
encryption key and the ciphertext from the most recent
block. Save the ciphertext from the previous block to be
used as the IV when resuming the operation for
additional blocks.
15.3.3.3 Cipher Feedback Mode (CFB)
Cipher Feedback mode is similar to CBC in that the
ciphertext becomes the Initialization Vector (IV) for the
subsequent block. However, in CFB mode, only the IV
is encrypted, then XORed with the plaintext to form the
ciphertext. For the second and subsequent blocks, the
ciphertext is passed through the encryption function
again, then XORed with the next plaintext block to
become the ciphertext. Like CBC mode, each
subsequent block depends on the previous block.
Therefore, identical subsequent plaintext blocks will
use a different IV, and therefore, yield different cipher-
text blocks. Figure 15-3 shows the use of CFB mode
for encryption and decryption.
Note:
Only 128-bit CFB mode is natively
supported. Other less common implemen-
tations, including 1-bit and 8-bit CFB
modes, could be accomplished with
support software, but are not detailed here.
FIGURE 15-3:
CFB ENCRYPTION AND DECRYPTION
ENCRYPTION
DECRYPTION
IV
Key
Key
IV
Key
Key
DATA
KEY
ENCRYPTER
DATA
KEY
ENCRYPTER
DATA
KEY
ENCRYPTER
DATA
KEY
ENCRYPTER
Plaintext0
Plaintext1
Ciphertext0
Ciphertext1
Ciphertext0
Ciphertext1
Plaintext0
Plaintext1
DS39935C-page 132
 2010 Microchip Technology Inc.