Botan 1.10.17
Botan::Blinder Class Reference

#include <blinding.h>

Public Member Functions

BigInt blind (const BigInt &x) const
 Blinder ()
 Blinder (const BigInt &mask, const BigInt &inverse_mask, const BigInt &modulus)
bool initialized () const
BigInt unblind (const BigInt &x) const

Detailed Description

Blinding Function Object

Definition at line 19 of file blinding.h.

Constructor & Destructor Documentation

◆ Blinder() [1/2]

◆ Blinder() [2/2]

Botan::Blinder::Blinder ( const BigInt & mask,
const BigInt & inverse_mask,
const BigInt & modulus )

Construct a blinder

Parameters
maskthe forward (blinding) mask
inverse_maskthe inverse of mask (depends on algo)
modulusof the group operations are performed in

Definition at line 16 of file blinding.cpp.

17 {
18 if(e < 1 || d < 1 || n < 1)
19 throw Invalid_Argument("Blinder: Arguments too small");
20
21 reducer = Modular_Reducer(n);
22 this->e = e;
23 this->d = d;
24 }
std::invalid_argument Invalid_Argument
Definition exceptn.h:20

References Botan::Modular_Reducer::Modular_Reducer().

Member Function Documentation

◆ blind()

BigInt Botan::Blinder::blind ( const BigInt & x) const

Definition at line 29 of file blinding.cpp.

30 {
31 if(!reducer.initialized())
32 return i;
33
34 e = reducer.square(e);
35 d = reducer.square(d);
36 return reducer.multiply(i, e);
37 }

◆ initialized()

bool Botan::Blinder::initialized ( ) const
inline

Definition at line 25 of file blinding.h.

25{ return reducer.initialized(); }

◆ unblind()

BigInt Botan::Blinder::unblind ( const BigInt & x) const

Definition at line 42 of file blinding.cpp.

43 {
44 if(!reducer.initialized())
45 return i;
46 return reducer.multiply(i, d);
47 }

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