
8201, 8202, 8203, 8204 Acceleration Processor Data Sheet, DS-0157-05
Page 123
Exar Confidential
In this mode, one Hash core calculates the SSL3.0 MAC, while the other performs real time
verification.
The MAC in SSL3.0 is calculated as follows:
Hash(Write Secret || Pad2 || Hash(Write Secret || Pad1 || Seq. No. || Type || Length ||
Application Data))
Where:
Hash = SHA-1 or MD5
Write Secret = 20 bytes if SHA-1, 16 bytes if MD5; from Crypto Header
Pad1 = 48/40 bytes of 0x36 (MD5/SHA-1)
Pad2 = 48/40 bytes of 0x5C (MD5/SHA-1)
SeqNum = 8 byte Sequence Number from Crypto Header
Type = Type byte from SSL Header
Length = 16 bit Length of payload (no padding!)
The host software must combine “Seq. No. || Type || Length || Application Data” as source
data, and the Hash Engine will calculate the SSL3.0 MAC.
XCBC-MAC
The AES-XCBC-MAC-96 algorithm is a variant of the basic CBC-MAC with obligatory 10*
padding; however, AES-XCBC-MAC-96 is secure for messages of arbitrary length. The AES-
XCBC-MAC-96 calculations require numerous encryption operations; this encryption MUST
be accomplished using AES with a 128-bit key. Given a 128-bit secret key K, AES-XCBC-
MAC-96 is calculated as follows for a message M that consists of n blocks, M[1]... M[n], in
which the blocksize of blocks M[1]... M[n-1] is 128 bits and the blocksize of block M[n] is
between 1 and 128 bits:
(1) Derive 3 128-bit keys (K1, K2 and K3) from the 128-bit secret
key K, as follows:
K1 = 0x01010101010101010101010101010101 encrypted with Key K
K2 = 0x02020202020202020202020202020202 encrypted with Key K
K3 = 0x03030303030303030303030303030303 encrypted with Key K
(2) Define E[0] = 0x00000000000000000000000000000000
(3) For each block M[i], where i = 1... n-1:
XOR M[i] with E[i-1], then encrypt the result with Key K1, yielding E[i].
(4) For block M[n]:
(a) If the blocksize of M[n] is 128 bits: