Re: Implement XTS block cipher mode

2019-03-19 Thread Niels Möller
Simo Sorce writes: > Ok, I took a stab at removing xts_steal completely in the second patch, > let me know what you think, I think I may like it better than my > original code and uses nettle_block16 for temporary storage to avoid a > copy. I like the version without xts_steal. It's slightly an

Re: Implement XTS block cipher mode

2019-03-19 Thread Niels Möller
ni...@lysator.liu.se (Niels Möller) writes: > 3. Big-endian system, no __builtin_bswap64. Here we can either use the >current code, with byte accesses only. Or attempt to define byteswap >without builtins and follow 2. I'd lean towards using the current >code, unless there's some syste

Re: Implement XTS block cipher mode

2019-03-19 Thread Niels Möller
Simo Sorce writes: > Just for curiosity, would it be ok change, > LE_READ_UINT64/LE_WRITE_UINT64 to use uint64_t and have the macro use > __bswap64 if available or fall back to the original unoptimized code ? I think LE_READ_UINT64 and related macros should be left as is, and used for unaligned

Re: Implement XTS block cipher mode

2019-03-19 Thread Simo Sorce
Hi Niels, attached find two patches, comments inline. On Tue, 2019-03-19 at 07:31 +0100, Niels Möller wrote: > Simo Sorce writes: > > > New patch attached, the diff has also been applied as an additional commit > > to my xts_exploded tree in gitlab. > > Thanks. Looks pretty good, a few more co