MOTION  0.01
Framework for mixed-protocol multi-party computation
Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | List of all members
encrypto::motion::Block128 Struct Reference

Block of aligned 128 bit / 16 B. More...

#include <block.h>

Collaboration diagram for encrypto::motion::Block128:
Collaboration graph
[legend]

Public Member Functions

 Block128 ()
 
 Block128 (const Block128 &other)
 
 Block128 (Block128 &&other)
 
Block128operator= (const Block128 &other)
 
Block128operator= (Block128 &&other)
 
 ~Block128 ()=default
 
bool operator== (const Block128 &other) const
 Compares two Block128 for equality. More...
 
bool operator!= (const Block128 &other) const
 Compares two Block128 for inequality. More...
 
Block128operator^= (const Block128 &__restrict__ other)
 Performs XOR-assign operation between two Block128. More...
 
Block128 operator^ (const Block128 &other) const
 Performs XOR operation between two Block128. More...
 
Block128operator^= (const std::byte *__restrict__ other)
 Performs XOR-assign operation between this Block128 and a non-overlapping arbitrary range of bytes. More...
 
Block128 operator^ (const std::byte *__restrict__ other) const
 Performs XOR operation between this Block128 and a non-overlapping arbitrary range of bytes. More...
 
void SetToZero ()
 Set this Block128 to zero. More...
 
void SetToRandom ()
 Set this Block128 to a random value. More...
 
void LoadFromMemory (const std::byte *pointer)
 Put 16 bytes starting at pointer into this Block128. More...
 
std::string AsString () const
 Format this Block128 as string of hexadecimal digits. More...
 
std::byte * data ()
 Get a pointer to the beginning of this Block128. More...
 
const std::byte * data () const
 

Static Public Member Functions

static Block128 MakeZero ()
 Create a zero-initialized Block128. More...
 
static Block128 MakeRandom ()
 Create a random-initialized Block128. More...
 
static Block128 MakeFromMemory (const std::byte *pointer)
 Load data from memory and store it in Block128. More...
 
static constexpr std::size_t size ()
 Get size of Block128. More...
 
static constexpr std::size_t alignment ()
 Get alignment of Block128. More...
 

Public Attributes

std::array< std::byte, 16 > byte_array
 

Static Public Attributes

static constexpr std::size_t kBlockSize = 16
 
static constexpr std::size_t kBlockAlignment = 16
 

Detailed Description

Block of aligned 128 bit / 16 B.

Constructor & Destructor Documentation

◆ Block128() [1/3]

encrypto::motion::Block128::Block128 ( )
inline

◆ Block128() [2/3]

encrypto::motion::Block128::Block128 ( const Block128 other)
inline

◆ Block128() [3/3]

encrypto::motion::Block128::Block128 ( Block128 &&  other)
inline

◆ ~Block128()

encrypto::motion::Block128::~Block128 ( )
default

Member Function Documentation

◆ alignment()

static constexpr std::size_t encrypto::motion::Block128::alignment ( )
inlinestaticconstexpr

Get alignment of Block128.

◆ AsString()

std::string encrypto::motion::Block128::AsString ( ) const

Format this Block128 as string of hexadecimal digits.

◆ data() [1/2]

std::byte* encrypto::motion::Block128::data ( )
inline

Get a pointer to the beginning of this Block128.

Here is the caller graph for this function:

◆ data() [2/2]

const std::byte* encrypto::motion::Block128::data ( ) const
inline

◆ LoadFromMemory()

void encrypto::motion::Block128::LoadFromMemory ( const std::byte *  pointer)
inline

Put 16 bytes starting at pointer into this Block128.

Parameters
pointer
Here is the caller graph for this function:

◆ MakeFromMemory()

static Block128 encrypto::motion::Block128::MakeFromMemory ( const std::byte *  pointer)
inlinestatic

Load data from memory and store it in Block128.

Parameters
pointerPointer to the data to be loaded.
Here is the call graph for this function:

◆ MakeRandom()

static Block128 encrypto::motion::Block128::MakeRandom ( )
inlinestatic

Create a random-initialized Block128.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ MakeZero()

static Block128 encrypto::motion::Block128::MakeZero ( )
inlinestatic

Create a zero-initialized Block128.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator!=()

bool encrypto::motion::Block128::operator!= ( const Block128 other) const
inline

Compares two Block128 for inequality.

Parameters
other

◆ operator=() [1/2]

Block128& encrypto::motion::Block128::operator= ( Block128 &&  other)
inline

◆ operator=() [2/2]

Block128& encrypto::motion::Block128::operator= ( const Block128 other)
inline

◆ operator==()

bool encrypto::motion::Block128::operator== ( const Block128 other) const
inline

Compares two Block128 for equality.

Parameters
other

◆ operator^() [1/2]

Block128 encrypto::motion::Block128::operator^ ( const Block128 other) const
inline

Performs XOR operation between two Block128.

Parameters
other

◆ operator^() [2/2]

Block128 encrypto::motion::Block128::operator^ ( const std::byte *__restrict__  other) const
inline

Performs XOR operation between this Block128 and a non-overlapping arbitrary range of bytes.

Parameters
other

◆ operator^=() [1/2]

Block128& encrypto::motion::Block128::operator^= ( const Block128 &__restrict__  other)
inline

Performs XOR-assign operation between two Block128.

Parameters
other

◆ operator^=() [2/2]

Block128& encrypto::motion::Block128::operator^= ( const std::byte *__restrict__  other)
inline

Performs XOR-assign operation between this Block128 and a non-overlapping arbitrary range of bytes.

Parameters
other

◆ SetToRandom()

void encrypto::motion::Block128::SetToRandom ( )

Set this Block128 to a random value.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetToZero()

void encrypto::motion::Block128::SetToZero ( )
inline

Set this Block128 to zero.

Here is the caller graph for this function:

◆ size()

static constexpr std::size_t encrypto::motion::Block128::size ( )
inlinestaticconstexpr

Get size of Block128.

Here is the caller graph for this function:

Member Data Documentation

◆ byte_array

std::array<std::byte, 16> encrypto::motion::Block128::byte_array

◆ kBlockAlignment

constexpr std::size_t encrypto::motion::Block128::kBlockAlignment = 16
staticconstexpr

◆ kBlockSize

constexpr std::size_t encrypto::motion::Block128::kBlockSize = 16
staticconstexpr

The documentation for this struct was generated from the following files: