summaryrefslogtreecommitdiffstats
path: root/src/include/ipxe/ecb.h
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 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] Allow initialisation vector length to vary from cipher blocksizeMichael Brown2022-10-251-2/+3
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [crypto] Add ECB block cipher mode (for debug and self-tests only)Michael Brown2015-07-271-0/+55
Signed-off-by: Michael Brown <mcb30@ipxe.org>