summaryrefslogtreecommitdiffstats
path: root/src/crypto/aes.c
Commit message (Collapse)AuthorAgeFilesLines
* [crypto] Add concept of cipher alignment sizeMichael Brown2022-11-071-0/+1
| | | | | | | | | | | | | | | | | | | The GCM cipher mode of operation (in common with other counter-based modes of operation) has a notion of blocksize that does not neatly fall into our current abstraction: it does operate in 16-byte blocks but allows for an arbitrary overall data length (i.e. the final block may be incomplete). Model this by adding a concept of alignment size. Each call to encrypt() or decrypt() must begin at a multiple of the alignment size from the start of the data stream. This allows us to model GCM by using a block size of 1 byte and an alignment size of 16 bytes. As a side benefit, this same concept allows us to neatly model the fact that raw AES can encrypt only a single 16-byte block, by specifying an alignment size of zero on this cipher. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [crypto] Add block cipher Galois/Counter mode of operationMichael Brown2022-10-251-0/+5
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [crypto] Add concept of authentication tag to cipher algorithmsMichael Brown2022-10-251-0/+2
| | | | | | | | Some ciphers (such as GCM) support the concept of a tag that can be used to authenticate the encrypted data. Add a cipher method for generating an authentication tag. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [crypto] Expose null crypto algorithm methods for reuseMichael Brown2022-10-251-11/+1Star
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [build] Fix strict-aliasing warning on older gcc versionsMichael Brown2015-07-281-4/+8
| | | | | | Reported-by: James A. Peltier <jpeltier@sfu.ca> Reported-by: Matthew Helton <mwhelton@gmail.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [crypto] Replace AES implementationMichael Brown2015-07-271-0/+804
Replace the AES implementation from AXTLS with a dedicated iPXE implementation which is slightly smaller and around 1000% faster. This implementation has been verified using the existing self-tests based on the NIST AES test vectors. Signed-off-by: Michael Brown <mcb30@ipxe.org>