Botan 3.6.1
Crypto and TLS for C&
|
#include <blinding.h>
Public Member Functions | |
BigInt | blind (const BigInt &x) const |
Blinder (const BigInt &modulus, RandomNumberGenerator &rng, std::function< BigInt(const BigInt &)> fwd_func, std::function< BigInt(const BigInt &)> inv_func) | |
Blinder (const Blinder &)=delete | |
Blinder & | operator= (const Blinder &)=delete |
RandomNumberGenerator & | rng () const |
BigInt | unblind (const BigInt &x) const |
Blinding Function Object.
Definition at line 22 of file blinding.h.
Botan::Blinder::Blinder | ( | const BigInt & | modulus, |
RandomNumberGenerator & | rng, | ||
std::function< BigInt(const BigInt &)> | fwd_func, | ||
std::function< BigInt(const BigInt &)> | inv_func ) |
modulus | the modulus |
rng | the RNG to use for generating the nonce |
fwd_func | a function that calculates the modular exponentiation of the public exponent and the given value (the nonce) |
inv_func | a function that calculates the modular inverse of the given value (the nonce) |
Definition at line 12 of file blinding.cpp.
|
delete |
Blind a value. The blinding nonce k is freshly generated after BOTAN_BLINDING_REINIT_INTERVAL calls to blind(). BOTAN_BLINDING_REINIT_INTERVAL = 0 means a fresh nonce is only generated once. On every other call, an updated nonce is used for blinding: k' = k*k mod n.
x | value to blind |
Definition at line 33 of file blinding.cpp.
References BOTAN_BLINDING_REINIT_INTERVAL, Botan::Modular_Reducer::initialized(), Botan::Modular_Reducer::multiply(), and Botan::Modular_Reducer::square().
|
inline |
Definition at line 60 of file blinding.h.
Unblind a value.
x | value to unblind |
Definition at line 53 of file blinding.cpp.
References Botan::Modular_Reducer::initialized(), and Botan::Modular_Reducer::multiply().