Botan 3.7.1
Crypto and TLS for C&
Botan::GF_Mask Class Referencefinal

Constant time mask wrapper for GF(q) elements. More...

#include <cmce_gf.h>

Public Member Functions

bool as_bool () const
 
CT::Mask< uint16_t > & elem_mask ()
 
 GF_Mask (CT::Mask< uint16_t > underlying_mask)
 
Classic_McEliece_GF if_set_return (const Classic_McEliece_GF x) const
 
GF_Maskoperator&= (const GF_Mask &o)
 
Classic_McEliece_GF select (const Classic_McEliece_GF x, CmceGfElem y) const
 
Classic_McEliece_GF select (const Classic_McEliece_GF x, const Classic_McEliece_GF y) const
 
uint16_t select (uint16_t x, uint16_t y) const
 

Static Public Member Functions

static GF_Mask expand (Classic_McEliece_GF v)
 
template<std::unsigned_integral T>
static GF_Mask expand (T v)
 
static GF_Mask is_equal (Classic_McEliece_GF a, Classic_McEliece_GF b)
 
static GF_Mask is_lte (Classic_McEliece_GF a, Classic_McEliece_GF b)
 
static GF_Mask is_zero (Classic_McEliece_GF v)
 
static GF_Mask set ()
 

Detailed Description

Constant time mask wrapper for GF(q) elements.

Definition at line 153 of file cmce_gf.h.

Constructor & Destructor Documentation

◆ GF_Mask()

Botan::GF_Mask::GF_Mask ( CT::Mask< uint16_t > underlying_mask)
inline

Definition at line 174 of file cmce_gf.h.

174: m_mask(underlying_mask) {}

Member Function Documentation

◆ as_bool()

bool Botan::GF_Mask::as_bool ( ) const
inline

Definition at line 195 of file cmce_gf.h.

195{ return m_mask.as_bool(); }
constexpr bool as_bool() const
Definition ct_utils.h:625

◆ elem_mask()

CT::Mask< uint16_t > & Botan::GF_Mask::elem_mask ( )
inline

Definition at line 197 of file cmce_gf.h.

197{ return m_mask; }

Referenced by Botan::Classic_McEliece_PrivateKeyInternal::check_key().

◆ expand() [1/2]

static GF_Mask Botan::GF_Mask::expand ( Classic_McEliece_GF v)
inlinestatic

Definition at line 160 of file cmce_gf.h.

160{ return expand(v.elem().get()); }
static GF_Mask expand(T v)
Definition cmce_gf.h:156

References Botan::Classic_McEliece_GF::elem(), expand(), and Botan::detail::Strong_Base< T >::get().

Referenced by expand().

◆ expand() [2/2]

template<std::unsigned_integral T>
static GF_Mask Botan::GF_Mask::expand ( T v)
inlinestatic

Definition at line 156 of file cmce_gf.h.

156 {
158 }
static constexpr Mask< T > expand(T v)
Definition ct_utils.h:408
GF_Mask(CT::Mask< uint16_t > underlying_mask)
Definition cmce_gf.h:174

◆ if_set_return()

Classic_McEliece_GF Botan::GF_Mask::if_set_return ( const Classic_McEliece_GF x) const
inline

Definition at line 176 of file cmce_gf.h.

176 {
177 return Classic_McEliece_GF(CmceGfElem(m_mask.if_set_return(x.elem().get())), x.modulus());
178 }
constexpr T if_set_return(T x) const
Definition ct_utils.h:549
Strong< uint16_t, struct CmceGfElem_ > CmceGfElem
Represents a GF(q) element.
Definition cmce_types.h:19

References Botan::Classic_McEliece_GF::elem(), Botan::detail::Strong_Base< T >::get(), and Botan::Classic_McEliece_GF::modulus().

◆ is_equal()

static GF_Mask Botan::GF_Mask::is_equal ( Classic_McEliece_GF a,
Classic_McEliece_GF b )
inlinestatic

Definition at line 168 of file cmce_gf.h.

168 {
169 return GF_Mask(CT::Mask<uint16_t>::is_equal(a.elem().get(), b.elem().get()));
170 }
static constexpr Mask< T > is_equal(T x, T y)
Definition ct_utils.h:453
const SIMD_8x32 & b

References Botan::b, Botan::Classic_McEliece_GF::elem(), and Botan::detail::Strong_Base< T >::get().

Referenced by Botan::Classic_McEliece_PrivateKeyInternal::check_key().

◆ is_lte()

static GF_Mask Botan::GF_Mask::is_lte ( Classic_McEliece_GF a,
Classic_McEliece_GF b )
inlinestatic

Definition at line 164 of file cmce_gf.h.

164 {
165 return GF_Mask(CT::Mask<uint16_t>::is_lte(a.elem().get(), b.elem().get()));
166 }
static constexpr Mask< T > is_lte(T x, T y)
Definition ct_utils.h:474

References Botan::b, Botan::Classic_McEliece_GF::elem(), and Botan::detail::Strong_Base< T >::get().

◆ is_zero()

static GF_Mask Botan::GF_Mask::is_zero ( Classic_McEliece_GF v)
inlinestatic

Definition at line 162 of file cmce_gf.h.

162{ return GF_Mask(CT::Mask<uint16_t>::is_zero(v.elem().get())); }
static constexpr Mask< T > is_zero(T x)
Definition ct_utils.h:448

References Botan::Classic_McEliece_GF::elem(), and Botan::detail::Strong_Base< T >::get().

Referenced by Botan::Classic_McEliece_Polynomial_Ring::compute_minimal_polynomial().

◆ operator&=()

GF_Mask & Botan::GF_Mask::operator&= ( const GF_Mask & o)
inline

Definition at line 190 of file cmce_gf.h.

190 {
191 m_mask &= o.m_mask;
192 return (*this);
193 }

◆ select() [1/3]

Classic_McEliece_GF Botan::GF_Mask::select ( const Classic_McEliece_GF x,
CmceGfElem y ) const
inline

Definition at line 184 of file cmce_gf.h.

184 {
185 return Classic_McEliece_GF(CmceGfElem(m_mask.select(x.elem().get(), y.get())), x.modulus());
186 }
constexpr T select(T x, T y) const
Definition ct_utils.h:559

References Botan::Classic_McEliece_GF::elem(), Botan::detail::Strong_Base< T >::get(), and Botan::Classic_McEliece_GF::modulus().

◆ select() [2/3]

Classic_McEliece_GF Botan::GF_Mask::select ( const Classic_McEliece_GF x,
const Classic_McEliece_GF y ) const
inline

Definition at line 180 of file cmce_gf.h.

180 {
181 return Classic_McEliece_GF(CmceGfElem(m_mask.select(x.elem().get(), y.elem().get())), x.modulus());
182 }

References Botan::Classic_McEliece_GF::elem(), Botan::detail::Strong_Base< T >::get(), and Botan::Classic_McEliece_GF::modulus().

◆ select() [3/3]

uint16_t Botan::GF_Mask::select ( uint16_t x,
uint16_t y ) const
inline

Definition at line 188 of file cmce_gf.h.

188{ return m_mask.select(x, y); }

◆ set()

static GF_Mask Botan::GF_Mask::set ( )
inlinestatic

Definition at line 172 of file cmce_gf.h.

172{ return GF_Mask(CT::Mask<uint16_t>::set()); }
static constexpr Mask< T > set()
Definition ct_utils.h:398

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