ctSwapBytes

fnvoid ctSwapBytes(uint doSwap, ubyte[] a, ubyte[] b) pure nothrow @nogc @safe

Swaps two byte arrays conditionally in constant time.

Both arrays must have the same length. If doSwap is non-zero, the contents are swapped; otherwise, they remain unchanged.

Parameters

doSwapSwap flag (0 = no swap, non-zero = swap).
aFirst array (may be modified).
bSecond array (may be modified).

Throws

Nothing (asserts on length mismatch in debug mode).