Skip to content

miniproto.crypto.native.xor_bytes

xor_bytes(left: bytes, right: bytes) -> bytes

Return the byte-wise XOR of equal-length inputs.

Parameters:

  • left (bytes) – First byte string.
  • right (bytes) – Second byte string of the same length.

Returns:

  • bytes – A byte string of that shared length.

Raises:

The public wrapper uses the fallback big-integer implementation because it wins the benchmarked handshake-sized cases; it offers no secret-zeroization.