AES encryption IP cores for FPGA and ASIC
Explore KiviCrypt-AES-GCM for authenticated encryption and KiviCrypt-AES-CTR for streaming data encryption.
Compare AES modes for embedded devices and choose the right protection for data in transit or at rest.
Content
1. What is an AES and its mode of operation?
An embedded device might encrypt packets before sending them to another device and also encrypt data stored on its local drive. Both functions can use the Advanced Encryption Standard (AES), but they solve different problems. A communication protocol may require the receiver to detect changes to a packet before acting on it. A storage controller may need to read and rewrite individual sectors without processing the entire drive.
These requirements help narrow the choice of AES mode. AES-GCM and AES-CCM provide authenticated encryption for protocols that specify them. AES-CTR provides confidentiality for data streams and can be used where the protocol handles authentication separately. AES-XTS is designed for confidentiality on sector-based storage. In an FPGA-based system, that choice also determines what the hardware accelerator processes and what the surrounding software or logic must handle.
The Advanced Encryption Standard (AES) is a widely used symmetric block cipher in embedded systems. It uses the same secret key for encryption and decryption, processes 128-bit blocks, and supports 128-, 192-, and 256-bit keys. NIST standardized AES in FIPS 197 in 2001. Embedded systems use AES to protect data in transit, such as command and telemetry traffic or data streams between an FPGA and a communication module, and data at rest, such as sensitive configuration data stored in external flash.
Since AES is a symmetric block cipher, a mode of operation defines how those block operations protect a larger message, packet, or storage sector. The mode also determines whether the recipient can detect unauthorized changes to the data.
| AES Mode | Use Cases | Main consideration |
|---|---|---|
| AES-ECB | - | Identical plaintext blocks produce identical ciphertext blocks under the same key. |
| AES-CBC | Legacy VPNs and encrypted firmware formats. | Encryption requires an unpredictable IV. Authentication is separate. |
| AES-XTS | Sector-based storage encryption for SSDs, eMMC and FPGA boot storage. | Supports independent sector access. Tamper detection requires a separate integrity mechanism. |
| AES-CTR | High-throughput FPGA streams and DMA-driven data paths. | Each complete counter block must be unique under a given key. Authentication is separate. |
| AES-CCM | Authenticated encryption in Bluetooth Low Energy and IEEE 802.15.4 networks. | Encryption and authentication can share an AES core. CBC-MAC limits parallelism within a message. |
| AES-GCM | High-throughput authenticated encryption for TLS, IPsec and MACsec. | Supports parallel processing. Each encryption requires a unique IV under a given key. |
Electronic Codebook (ECB) is the simplest AES mode. The mode is standardized in NIST SP 800-38A. Each plaintext block is encrypted independently using the same key. This makes ECB easy to implement in hardware because it requires little control logic. Its main weakness is that identical 128-bit plaintext blocks always produce identical ciphertext blocks under the same key. As a result, repetitions in structured data can remain visible after encryption. This is especially relevant when patterns align with AES block boundaries. Examples include:
ECB is generally unsuitable for protecting application data. It illustrates how the choice of AES mode affects what an observer can learn from the ciphertext.
Cipher Block Chaining (CBC) combines each plaintext block with the previous ciphertext block before encryption. The first block is combined with an initialization vector (IV), which must be unpredictable when encrypting. Different IVs allow the same message to produce different ciphertexts under the same key. During encryption, the dependency between consecutive blocks limits parallel processing within a message. The mode is standardized in NIST SP 800-38A.
CBC was widely used in older VPN and IPsec deployments, encrypted firmware containers, and embedded Linux systems. It provides confidentiality only. Where integrity and authentication are required, the protocol or file format must provide them separately. One common design pattern combines AES-CBC with HMAC-SHA-256.
CBC remains relevant when a device must support an existing protocol or file format. New designs that require authenticated encryption often use AES-GCM or AES-CCM, depending on the protocol and implementation constraints.
XTS-AES was designed for storage encryption. It can protect data stored on SSDs, eMMC and flash memory, and is used in disk encryption implementations such as Linux dm-crypt. The mode is standardized in NIST SP 800-38E. XTS uses a value called a tweak to account for the location of the data being encrypted. Individual sectors can be read or written independently, and blocks can generally be processed in parallel. This makes XTS useful in storage controllers that handle random reads and writes. Some memory encryption architectures also use XTS to protect external DDR organized into independently addressable data units. Typical embedded applications include:
XTS provides confidentiality only. A system that also needs to detect tampering requires a separate integrity mechanism. For example, an FPGA system can encrypt a stored bitstream and separately verify its authenticity before loading it.
Counter Mode (CTR) uses AES to encrypt a sequence of counter blocks and generate a keystream. It combines that keystream with the plaintext using XOR. Because the AES operations on the counter blocks are independent, hardware can pipeline them, process several in parallel, or generate keystream ahead of time. This makes CTR useful for low-latency, high-throughput FPGA implementations and DMA-driven data paths. The mode is standardized in NIST SP 800-38A. Typical applications include:
CTR provides confidentiality only. The system needs a separate authentication mechanism if it must detect tampering. It must also ensure that no complete counter block is reused under the same key, even across messages or after a device restart. Reusing a counter block repeats the corresponding keystream and reveals the XOR of the two plaintext blocks.
CCM stands for Counter with CBC-MAC and is standardized in NIST SP 800-38C. It combines AES-CTR for encryption with CBC-MAC for authentication. It can also authenticate associated data, such as packet headers that must remain readable. CCM is used in protocols and systems such as:
The CBC-MAC calculation depends on the preceding block, which limits parallelism within a message. The CTR operations can run alongside authentication if the implementation has the resources to do both concurrently. A compact implementation can share an AES core between encryption and authentication. GCM offers more scope to parallelize authentication and uses additional logic for GHASH.
CCM requires a unique nonce for each message encrypted under the same key. The nonce length determines the maximum message size. The authentication tag length is configurable and is typically specified by the protocol. For general cryptographic applications, BSI TR-02102-1 recommends a CCM tag of at least 96 bits.
Galois/Counter Mode (GCM) combines AES counter-mode encryption with GHASH-based authentication. It encrypts the payload and produces an authentication tag that also covers any associated data, such as selected packet headers. The receiver verifies the tag before accepting the decrypted payload. GCM is standardized in NIST SP 800-38D. Typical embedded applications include:
GCM is well suited to FPGA acceleration. Both counter-mode encryption and GHASH can be implemented with pipelining and parallel processing. The mode generates its own authentication tag, so it can provide encryption and authentication in one hardware data path.
AES-GCM also introduces one of the most underestimated engineering challenges in embedded security: IV management which is part of the system design. GCM requires a unique initialization vector (IV), also called a nonce, for every encryption under a given key. If an IV repeats, the repeated keystream reveals the XOR of the plaintexts. IV reuse can also compromise authentication and enable forgery. NIST recommends 96-bit IVs, which GCM can process directly without an extra GHASH calculation for the IV.
Tag length affects resistance to forgery. BSI TR-02102-1 recommends GCM tags of at least 96 bits for general cryptographic applications. NIST has announced plans to remove support for tags shorter than 96 bits in its revision of SP 800-38D. A protocol may specify a particular tag length and impose its own usage limits.
A single GCM encryption can process up to 232 − 2 blocks of plaintext. The limits across all encryptions under one key depend on factors such as the IV construction and the protocol. Long-running embedded systems need to account for these limits when deciding when to rotate keys.
In practice, nonce management raises several questions:
These scenarios are covered in more detail in Why nonce reuse can break AES-GCM security in embedded systems.
Where the protocol supports it, AES-GCM-SIV is an option for systems that need to tolerate accidental nonce reuse. It is defined in RFC 8452 and included in BSI TR-02102-1. It derives a synthetic IV from the nonce, the plaintext and any associated data. Within the RFC’s usage bounds, reusing a nonce can reveal when the same plaintext and associated data were encrypted with that nonce. The RFC still recommends randomly generated nonces.
AES-GCM and AES-CCM both provide authenticated encryption. The main implementation difference is how they calculate the authentication tag. GCM uses GHASH, which can be implemented with parallel processing. CCM uses CBC-MAC, where each authentication step depends on the preceding block. A compact CCM implementation can reuse AES logic for both operations, while a GCM design needs logic for GHASH as well as AES.
Start with the protocol. If it specifies CCM or GCM, that requirement governs the choice. If both are available, compare implementations on the target device using representative message sizes. A gateway processing many packets may benefit from a pipelined GCM architecture. A constrained device that already has an AES accelerator may be able to reuse it for CCM. The system-level trade-off depends on the available hardware, how the two operations are scheduled, and how much data the application needs to process.
AES-GCM provides confidentiality and authentication in one mode. AES-CTR provides confidentiality. When a protocol specifies GCM, it defines how the sender and receiver handle the authentication tag and any associated data. When a protocol specifies CTR and requires integrity protection, it must also define how the data is authenticated and how verification fits into the receive path.
Both modes can use a pipelined AES data path. With GCM, the integration also has to carry any associated data, handle the tag, and ensure the receiver only accepts authenticated plaintext. With CTR, the integration has to allocate counter blocks without overlap under the same key. If the protocol provides authentication separately, the design must account for that path when assessing resources and throughput.
Consider a gateway built around a SoC FPGA. In this example, protocol software on the processor manages the session and supplies the parameters for each operation. The FPGA handles encryption in the streaming data path. Two implementations of that architecture illustrate how the choice of mode changes the division of work:
Two illustrative SoC FPGA send paths showing where authentication takes place with AES-GCM and AES-CTR. The CTR example shows a protocol that authenticates ciphertext separately.
For FPGA and ASIC designs that require authenticated encryption, the KiviCrypt-AES-GCM IP core offers Tiny and Fast variants for different resource and throughput requirements. The KiviCrypt-AES-CTR IP core implements the encryption and decryption path for applications that use Counter Mode. Both cores provide AXI Stream data interfaces. Their product pages list implementation results for specific FPGA families.
Explore KiviCrypt-AES-GCM for authenticated encryption and KiviCrypt-AES-CTR for streaming data encryption.
Start with the protocol or storage format and the protection the application needs. For authenticated communication, GCM and CCM are both options where the protocol permits them. For a streaming path with separate authentication, CTR can handle encryption. For sector-based storage confidentiality, XTS addresses the need to access data units independently.
Once the mode is set, work through what happens at the system boundary. Who supplies the IV or counter? Where does authentication take place? When can the application use the decrypted data? The answers determine how the AES core fits into the FPGA design and which functions the surrounding system must provide.