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::Block128Vector Struct Reference

Vector of 128 bit / 16 B blocks. More...

#include <block.h>

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

Public Member Functions

 Block128Vector ()=default
 
 Block128Vector (const Block128Vector &other)
 
 Block128Vector (Block128Vector &&other)
 
Block128Vectoroperator= (const Block128Vector &other)
 
Block128Vectoroperator= (Block128Vector &&other)
 
 ~Block128Vector ()=default
 
 Block128Vector (std::size_t size)
 Creates uninitialized vector of size elements. More...
 
 Block128Vector (std::size_t size, const Block128 &value)
 Creates initialized vector of size elements with given value. More...
 
 Block128Vector (std::size_t size, const void *__restrict__ pointer)
 Creates initialized vector of size elements read from memory. More...
 
Block128at (std::size_t index)
 Access Block128 at index. Throws an exception if index is out of bounds. More...
 
const Block128at (std::size_t index) const
 
Block128data ()
 Get pointer to the first Block128. More...
 
const Block128data () const
 Get const pointer to the first Block128. More...
 
std::size_t size () const
 Get size of Block128Vector. More...
 
std::size_t ByteSize () const
 Get size of the Block128Vector content in bytes. More...
 
void resize (std::size_t new_size)
 Resize the Block128Vector to contain new_size elements. New elements are left uninitialized. More...
 
void resize (std::size_t new_size, const Block128 &value)
 Resize the Block128Vector to contain new_size elements. New elements are set to value. More...
 
auto begin ()
 Returns an iterator to the first element of the Block128Vector. More...
 
auto begin () const
 Returns a const iterator to the first element of the Block128Vector. More...
 
auto end ()
 Returns an iterator to the element following the last element of the Block128Vector. More...
 
auto end () const
 Returns a const iterator to the element following the last element of the Block128Vector. More...
 
void SetToZero ()
 Set all Block128 in this vector to zero. More...
 
void SetToRandom ()
 Set all Block128 in this vector to random values. More...
 
Block128Vectoroperator^= (const Block128Vector &__restrict__ other)
 Perform a XOR-assign operation between all the Block128 in this vector and the Block128 in a different one of same size. More...
 
Block128Vector operator^ (const Block128Vector &__restrict__ other) const
 Perform a XOR operation between all the Block128 in this vector and the Block128 in a different one of same size. More...
 
Block128operator[] (std::size_t index)
 Access Block128 at index. Undefined behaviour if index is out of bounds. More...
 
const Block128operator[] (std::size_t index) const
 Access Block128 at index. Undefined behaviour if index is out of bounds. More...
 

Static Public Member Functions

static Block128Vector MakeZero (std::size_t size)
 Creates a zero-filled vector of size elements. More...
 
static Block128Vector MakeRandom (std::size_t size)
 Creates a vector of size elements filled with random data. More...
 

Public Attributes

std::vector< Block128, boost::alignment::aligned_allocator< Block128, kBlockAlignment > > block_vector
 

Static Public Attributes

static constexpr std::size_t kBlockAlignment = kAlignment
 

Detailed Description

Vector of 128 bit / 16 B blocks.

Constructor & Destructor Documentation

◆ Block128Vector() [1/6]

encrypto::motion::Block128Vector::Block128Vector ( )
default
Here is the caller graph for this function:

◆ Block128Vector() [2/6]

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

◆ Block128Vector() [3/6]

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

◆ ~Block128Vector()

encrypto::motion::Block128Vector::~Block128Vector ( )
default

◆ Block128Vector() [4/6]

encrypto::motion::Block128Vector::Block128Vector ( std::size_t  size)
inline

Creates uninitialized vector of size elements.

Parameters
size

◆ Block128Vector() [5/6]

encrypto::motion::Block128Vector::Block128Vector ( std::size_t  size,
const Block128 value 
)
inline

Creates initialized vector of size elements with given value.

Parameters
size
value

◆ Block128Vector() [6/6]

encrypto::motion::Block128Vector::Block128Vector ( std::size_t  size,
const void *__restrict__  pointer 
)
inline

Creates initialized vector of size elements read from memory.

Parameters
size
pointerPointer to memory.
Here is the call graph for this function:

Member Function Documentation

◆ at() [1/2]

Block128& encrypto::motion::Block128Vector::at ( std::size_t  index)
inline

Access Block128 at index. Throws an exception if index is out of bounds.

Parameters
index
Here is the caller graph for this function:

◆ at() [2/2]

const Block128& encrypto::motion::Block128Vector::at ( std::size_t  index) const
inline

◆ begin() [1/2]

auto encrypto::motion::Block128Vector::begin ( )
inline

Returns an iterator to the first element of the Block128Vector.

◆ begin() [2/2]

auto encrypto::motion::Block128Vector::begin ( ) const
inline

Returns a const iterator to the first element of the Block128Vector.

◆ ByteSize()

std::size_t encrypto::motion::Block128Vector::ByteSize ( ) const
inline

Get size of the Block128Vector content in bytes.

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

◆ data() [1/2]

Block128* encrypto::motion::Block128Vector::data ( )
inline

Get pointer to the first Block128.

Here is the caller graph for this function:

◆ data() [2/2]

const Block128* encrypto::motion::Block128Vector::data ( ) const
inline

Get const pointer to the first Block128.

◆ end() [1/2]

auto encrypto::motion::Block128Vector::end ( )
inline

Returns an iterator to the element following the last element of the Block128Vector.

◆ end() [2/2]

auto encrypto::motion::Block128Vector::end ( ) const
inline

Returns a const iterator to the element following the last element of the Block128Vector.

◆ MakeRandom()

static Block128Vector encrypto::motion::Block128Vector::MakeRandom ( std::size_t  size)
inlinestatic

Creates a vector of size elements filled with random data.

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

◆ MakeZero()

static Block128Vector encrypto::motion::Block128Vector::MakeZero ( std::size_t  size)
inlinestatic

Creates a zero-filled vector of size elements.

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

◆ operator=() [1/2]

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

◆ operator=() [2/2]

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

◆ operator[]() [1/2]

Block128& encrypto::motion::Block128Vector::operator[] ( std::size_t  index)
inline

Access Block128 at index. Undefined behaviour if index is out of bounds.

Parameters
index

◆ operator[]() [2/2]

const Block128& encrypto::motion::Block128Vector::operator[] ( std::size_t  index) const
inline

Access Block128 at index. Undefined behaviour if index is out of bounds.

Parameters
index

◆ operator^()

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

Perform a XOR operation between all the Block128 in this vector and the Block128 in a different one of same size.

Parameters
other
Precondition
other is has the same size as this Block128Vector.
Here is the call graph for this function:

◆ operator^=()

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

Perform a XOR-assign operation between all the Block128 in this vector and the Block128 in a different one of same size.

Parameters
other
Precondition
other is has the same size as this Block128Vector.
Here is the call graph for this function:

◆ resize() [1/2]

void encrypto::motion::Block128Vector::resize ( std::size_t  new_size)
inline

Resize the Block128Vector to contain new_size elements. New elements are left uninitialized.

Parameters
new_size
Here is the caller graph for this function:

◆ resize() [2/2]

void encrypto::motion::Block128Vector::resize ( std::size_t  new_size,
const Block128 value 
)
inline

Resize the Block128Vector to contain new_size elements. New elements are set to value.

Parameters
new_size
value

◆ SetToRandom()

void encrypto::motion::Block128Vector::SetToRandom ( )

Set all Block128 in this vector to random values.

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

◆ SetToZero()

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

Set all Block128 in this vector to zero.

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

◆ size()

std::size_t encrypto::motion::Block128Vector::size ( ) const
inline

Get size of Block128Vector.

Here is the caller graph for this function:

Member Data Documentation

◆ block_vector

std::vector<Block128, boost::alignment::aligned_allocator<Block128, kBlockAlignment> > encrypto::motion::Block128Vector::block_vector

◆ kBlockAlignment

constexpr std::size_t encrypto::motion::Block128Vector::kBlockAlignment = kAlignment
staticconstexpr

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