10#include <cuda_runtime.h>
35 __host__ __device__
Bytes() : val_({0, 0, 0, 0}) {}
44 util::RequireArg((buf.w & 1) == 0,
"Bytes::From: the block must have a zero LSB");
49 __host__ __device__ int4
Into()
const {
56 __host__ __device__
Bytes(int4 buf) : val_(buf) {}
static Bytes From(int4 buf)
Wrap a clamped block as a group element.
Definition bytes.cuh:43
Bytes operator+(Bytes rhs) const
Return the group sum, the bitwise XOR of both values.
Definition bytes.cuh:25
Bytes()
Construct the additive identity.
Definition bytes.cuh:35
int4 Into() const
Return this group element as a clamped block.
Definition bytes.cuh:49
Bytes operator-() const
Return the additive inverse, which is this value in the XOR group.
Definition bytes.cuh:30
Group interface.
Definition group.cuh:49
void RequireArg(bool ok, const char *msg)
Check a caller precondition.
Definition util.cuh:73
int4 Xor(int4 lhs, int4 rhs)
Return the bitwise XOR of two 128-bit blocks.
Definition util.cuh:29