Datasheet

2010 Microchip Technology Inc. DS39935C-page 125
ENC424J600/624J600
15.0 CRYPTOGRAPHIC SECURITY
ENGINES
To reduce the processing requirements of the host
controller, ENC424J600/624J600 devices incorporate
three different cryptographic security engines. These
security engines perform the types of encryptions,
decryptions and mathematical computations that are
most commonly used for network security functions.
They accelerate the computation of public/private key
pair negotiations, message hash authentication and
bulk data encryption.
The engines implemented are:
Modular Exponentiation
MD5 and SHA-1 Hashing
Advanced Encryption Standard (AES)
Each engine operates from the cryptography data
memory area, shown in
Section 3.4 “Cryptographic
Data Memory”
. This memory block is not directly acces-
sible through the SPI or PSP interfaces. Instead, data
must be copied into this memory area using the DMA, as
described in
Section 14.1 “Copying Memory”.
The modules are controlled using bits from the ECON2,
ECON1 and EIR registers (Registers 8-1, 9-1 and 13-1,
respectively). Each of the three modules have separate
resources, so they may all be active simultaneously if
necessary. Each module also has its own interrupt that
can be enabled to signal completion. Refer to
Section 13.0 “Interrupts” for details on using interrupts.
All of the cryptographic security engines require that the
Ethernet enable bit, ETHEN (ECON2<15>) to be set for
operation. However, the PHY, which consumes the
majority of the device current, can be put to sleep if the
application wishes to perform cryptographic operations
without Ethernet connectivity. The PHY sleep function is
controlled by the PSLEEP bit (PHCON1<11>). For
greater information on power down capabilities, refer to
16.0 “Power-Saving Features”. As a unit, the Modular
Exponentiation and AES engines can be disabled to
reduce the device’s power consumption. This feature is
controlled by the CRYPTEN bit (EIR<15>). To enable
Modular Exponentiation and AES engines, set
CRYPTEN. By default, CRYPTEN is cleared and the
modules are disabled on device power-up. The
MD5/SHA-1 hashing module remains available
regardless of the CRYPTEN state.
15.1 Modular Exponentiation
Modular Exponentiation is the base function for the
RSA and Diffie-Hellman algorithms used in public key
cryptography. This module computes the value,
Y=X
E
mod M, where 0 X, Y< M and E > 0 and 2
N-1
M < 2
N
.
N
is the chosen operand size of 512, 768 or 1024.
The Modular Exponentiation engine is controlled by the
MODEXST bit (ECON1<15>). Setting this bit initiates
the calculation. The engine automatically clears the bit
when the operation is complete. Clearing the bit in soft-
ware aborts the calculation in progress and leaves the
calculated value in an indeterminate state.
The engine supports operand lengths of 512, 768 or
1024 bits. Operand size is selected with the
MODLEN<1:0> bits (ECON2<3:2>). The modulus
M
and base X can be any value up to the maximum value
supported by the chosen operand length. However, if
X M, the result is not ensured to be correct. Addition-
ally, incorrect results will occur if the exponent
E is 0
(this would return the same value as
E = 1). Shorter
exponents may commonly be used when performing
RSA encryption, which typically uses a 17-bit exponent
length, or Diffie Hellman computations using a 180-bit
exponent.
For the Modular Exponentiation engine to work
correctly, the Most Significant (MSb) bit of
M must be
set. For example, when the MODLEN bits are config-
ured for 1024-bit operation,
M must be set such that
2
1023
M < 2
1024
. In other words, the modulus must
exactly match the chosen operand length of 512 bits,
768 bits or 1024 bits. Although it usually is, the modulus
does not have to be a prime number.
All operands must be stored in network (big-endian)
byte order. If the base
X or exponent E operands are
shorter than the selected operand length, they should
be right-justified and left-padded with zeros out to the
chosen operand length.