libyggdrasil  v1.0.0
bsp::drv::Hash< Context, HashImpl > Struct Template Reference

Base class for the Hash abstraction. More...

#include <hash.hpp>

Public Types

using Impl = HashImpl< Context >
 

Public Member Functions

 Hash ()=delete
 
 Hash (const Hash &)=delete
 
auto operator= (const Hash &)=delete
 

Static Public Member Functions

static auto init (auto ... args)
 Hash initialization. More...
 
static auto deinit (auto ... args)
 Hash deinitialization. More...
 
static u8 getCRC8 (const auto &data, u8 initValue=0x00, u8 polynomial=0x07, u8 xorOut=0x00) noexcept
 Hardware accelerated CRC8 caluclation. More...
 
static u16 getCRC16 (const auto &data, u16 initValue=0x0000, u16 polynomial=0x8005, u16 xorOut=0x0000) noexcept
 Hardware accelerated CRC16 caluclation. More...
 
static u32 getCRC32 (const auto &data, u32 initValue=0xFFFF 'FFFF, u32 polynomial=0x04C11DB7, u32 xorOut=0xFFFFFFFF) noexcept
 Hardware accelerated CRC32 caluclation. More...
 

Detailed Description

template<auto Context, template< addr_t > typename HashImpl>
struct bsp::drv::Hash< Context, HashImpl >

Base class for the Hash abstraction.

Template Parameters
ContextHash context
HashImplHash Implementation

Member Typedef Documentation

◆ Impl

template<auto Context, template< addr_t > typename HashImpl>
using bsp::drv::Hash< Context, HashImpl >::Impl = HashImpl<Context>

Constructor & Destructor Documentation

◆ Hash() [1/2]

template<auto Context, template< addr_t > typename HashImpl>
bsp::drv::Hash< Context, HashImpl >::Hash ( )
delete

◆ Hash() [2/2]

template<auto Context, template< addr_t > typename HashImpl>
bsp::drv::Hash< Context, HashImpl >::Hash ( const Hash< Context, HashImpl > &  )
delete

Member Function Documentation

◆ deinit()

template<auto Context, template< addr_t > typename HashImpl>
static auto bsp::drv::Hash< Context, HashImpl >::deinit ( auto ...  args)
inlinestatic

Hash deinitialization.

Parameters
argsPlatform specific arguments
Returns
Success

◆ getCRC16()

template<auto Context, template< addr_t > typename HashImpl>
static u16 bsp::drv::Hash< Context, HashImpl >::getCRC16 ( const auto &  data,
u16  initValue = 0x0000,
u16  polynomial = 0x8005,
u16  xorOut = 0x0000 
)
inlinestaticnoexcept

Hardware accelerated CRC16 caluclation.

Parameters
dataData to calculate CRC of
initValueStart value
polynomialUsed polynomial
xorOutValue to xor result value with
Returns
CRC 16
Note
By default this function uses the CRC-16/ARC settings

◆ getCRC32()

template<auto Context, template< addr_t > typename HashImpl>
static u32 bsp::drv::Hash< Context, HashImpl >::getCRC32 ( const auto &  data,
u32  initValue = 0xFFFF'FFFF,
u32  polynomial = 0x04C11DB7,
u32  xorOut = 0xFFFFFFFF 
)
inlinestaticnoexcept

Hardware accelerated CRC32 caluclation.

Parameters
dataData to calculate CRC of
initValueStart value
polynomialUsed polynomial
xorOutValue to xor result value with
Returns
CRC 32
Note
By default this function uses the CRC-32 (ethernet) settings

◆ getCRC8()

template<auto Context, template< addr_t > typename HashImpl>
static u8 bsp::drv::Hash< Context, HashImpl >::getCRC8 ( const auto &  data,
u8  initValue = 0x00,
u8  polynomial = 0x07,
u8  xorOut = 0x00 
)
inlinestaticnoexcept

Hardware accelerated CRC8 caluclation.

Parameters
dataData to calculate CRC of
initValueStart value
polynomialUsed polynomial
xorOutValue to xor result value with
Returns
CRC 8
Note
By default this function uses the CRC-8 settings

◆ init()

template<auto Context, template< addr_t > typename HashImpl>
static auto bsp::drv::Hash< Context, HashImpl >::init ( auto ...  args)
inlinestatic

Hash initialization.

Parameters
argsPlatform specific arguments
Returns
Success

◆ operator=()

template<auto Context, template< addr_t > typename HashImpl>
auto bsp::drv::Hash< Context, HashImpl >::operator= ( const Hash< Context, HashImpl > &  )
delete

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