summaryrefslogtreecommitdiff
path: root/xts.c
Commit message (Collapse)AuthorAgeFilesLines
* block modes: move Galois shifts to block-internal.hDmitry Eremin-Solenikov2019-09-041-29/+5
| | | | | | | Move Galois polynomial shifts to block-internal.h, simplifying common code. GCM is left unconverted for now, this will be fixed later. Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
* Rearrange cmac's block_mulx, make it closer to xts_shift.Niels Möller2019-03-271-4/+2
| | | | | | | * xts.c (xts_shift): Arrange with a single write to u64[1]. * cmac.c (block_mulx): Rewrite to work in the same way as xts_shift, with 64-bit operations. XTS and CMAC use opposite endianness, but otherwise, these two functions are identical.
* Recode xts_shift based on endianessSimo Sorce2019-03-241-9/+20
| | | | | | | | | This creates two implementations of xts_shift, one for little endian and one for big endian. This way we avoid copies to additional variables and inefficient byteswapping on platforms that do not have dedicated instructions. Signed-off-by: Simo Sorce <simo@redhat.com>
* Inline ciphertext stealingSimo Sorce2019-03-241-60/+46
| | | | | | | This avoids copying and may be somewhat more readable without the need for so much explanation. Signed-off-by: Simo Sorce <simo@redhat.com>
* Add support for XTS encryption modeSimo Sorce2019-03-241-0/+202
XEX encryption mode with tweak and ciphertext stealing (XTS) is standardized in IEEE 1619 and generally used for storage devices. Signed-off-by: Simo Sorce <simo@redhat.com>