Symmetric Cryptographic Intel FPGA Hard IP User Guide

ID 714305
Date 12/19/2022
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

6.1. MAC Security Profile (MACsec)

This profile is optimized for Media Access Control Security (MAC Security) used to protect the Ethernet links. To select the MACsec profile, you set tuser.pattern[2:0] to 3'd2.
You must specify the following inputs when using the MACsec profile.
  • Key: Single 256 bit or a 128 bit key. The same key is used for GCM encryption, including the authentication, or decryption, including the authentication, operation.
  • Additional Authenticated Data (AAD): A GCM-specific additional authenticated data that requires authentication only. The supported AAD length is a range of 1 to (232-1) bytes.
  • Data/Text: Contains the plaintext or ciphertext data requiring the encryption or decryption. The data size range is between 1 byte to 239 bits.
    Note: The performance decreases for not aligned data sizes.
  • Initialization Vector (IV): 96 bit IV required for all GCM operations. The ICA core concatenates a counter of 0x2 to the 96 bits IV in the below format before programming it to the AES Crypto Hard IP. The counter and the IV follow the little endian format.
    IV_final[127:0] = {concatenated counter[31:0], IV[95:0]}
  • Support idle 128 bit aligned segments between an end of packet (EOP) and the subsequent start of the next packet (SOP).

The following output information is identified when using the MACsec pattern:
  • Additional Authenticated Data (AAD): A GCM-specific additional authenticated data that requires the authentication only. The output propagates the original entered input AAD value.
  • Data/Text: Contains the plaintext or ciphertext data that has been encrypted or decrypted.
  • MAC: 128-bit long GHash or GMAC authenticated tag calculated by the AES ICA Hard IP.
  • Key: The key size depends on the selected mode:
    • 128 or 256 bit key for AES GCM mode
    • 128 bit key for SM4 GCM mode
  • Optimized throughput for 64 byte packets size or greater than 128 bytes packets size. If a packet size is less than 64 bytes, the IP processes the packets with a lower throughput.
    Note: A single clock cycle cannot support multiple IV’s. If a data packet including the IV is smaller than 384 bits, then you must send the next IV in the next clock. You must not pack a runt packet with either the preceding or the succeeding packet. This could lead to a 2-EOP/cycle or 2-SOP/cycle scenario respectively
  • Supports up to 1,024 channels.
  • Allows you to preprogram the channel keys before the data arrival. If a channel already contains the data in its pipeline, all data must be processed before asserting the key_en signal with a new key for a given channel.
  • The data packing follows the 128 bit alignment. If the AAD is not aligned to 128 bits, the plaintext or ciphertext is packed within the same 128 bit segment.
  • The Symmetric Cryptographic IP core performs ICV comparison against the calculated MAC. The IP core sends the comparison result to your logic for verification.
  • Supports per port channel mapping.
  • MACSec and XTS profile interleaving is not supported.
The following example depicts the traffic flow for the MACsec pattern. The example uses 3 channels: channel1, channel 2, and channel 3. Clock numbers 1, 2, and 3, correspond to the channels being programmed with their keys. Starting with clock cycle 4, you can send any of the following information: IV, AAD, plaintext, or ciphertext.
Table 33.  Traffic Flow in MACsec Pattern in AES GCM Mode
Clock Cycle 1 2 3 4 5 6 7 8 9 10
Channel 1 2 3 1 2 2 1 3 1 2
DATA
data[127:0] Key Key Key IV IV AAD Text IV Text Text
data[255:128] Key Key Key AAD AAD AAD Text Text Text Text
data[383:256] AAD AAD AAD Text Text Text Text
data[511:384] AAD AAD AAD Text Text Text Text