Botan 1.10.17

Public Member Functions | List of all members
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]

Botan::Blinder::Blinder | ( |  | ) |
| inline

Definition at line 27 of file blinding.h.

27 {}

## ◆ Blinder() [2/2]

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

Construct a blinder

Parameters

  mask | the forward (blinding) mask
  inverse_mask | the inverse of mask (depends on algo)
  modulus | of 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 }
Botan::Invalid_Argument
std::invalid_argument Invalid_Argument
Definition: exceptn.h:20

## Member Function Documentation

## ◆ blind()

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

Definition at line 29 of file blinding.cpp.

References Botan::Modular_Reducer::initialized(), Botan::Modular_Reducer::multiply(), and Botan::Modular_Reducer::square().

Referenced by Botan::ElGamal_Decryption_Operation::decrypt(), Botan::RSA_Private_Operation::decrypt(), and Botan::RSA_Private_Operation::sign().

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 }
Botan::Modular_Reducer::initialized
bool initialized() const
Definition: reducer.h:50
Botan::Modular_Reducer::square
BigInt square(const BigInt &x) const
Definition: reducer.h:39
Botan::Modular_Reducer::multiply
BigInt multiply(const BigInt &x, const BigInt &y) const
Definition: reducer.h:31

## ◆ initialized()

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

Definition at line 25 of file blinding.h.

25 { return reducer.initialized(); }
Botan::Modular_Reducer::initialized
bool initialized() const
Definition: reducer.h:50

## ◆ unblind()

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

Definition at line 42 of file blinding.cpp.

References Botan::Modular_Reducer::initialized(), and Botan::Modular_Reducer::multiply().

Referenced by Botan::RSA_Private_Operation::decrypt(), and Botan::RSA_Private_Operation::sign().

43 {
44 if(!reducer.initialized())
45 return i;
46 return reducer.multiply(i, d);
47 }
Botan::Modular_Reducer::initialized
bool initialized() const
Definition: reducer.h:50
Botan::Modular_Reducer::multiply
BigInt multiply(const BigInt &x, const BigInt &y) const
Definition: reducer.h:31

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

- src/pubkey/blinding.h
- src/pubkey/blinding.cpp