Botan: src/pubkey/blinding.h Source File

Botan 1.10.16

blinding.h
Go to the documentation of this file.
1 /*
2 * Blinding for public key operations
3 * (C) 1999-2010 Jack Lloyd
4 *
5 * Distributed under the terms of the Botan license
6 */
7
8 #ifndef BOTAN_BLINDER_H__
9 #define BOTAN_BLINDER_H__
10
11 #include <botan/bigint.h>
12 #include <botan/reducer.h>
13
14 namespace Botan {
15
16 /**
17 * Blinding Function Object
18 */
19 class BOTAN_DLL Blinder
20 {
21 public:
22 BigInt blind(const BigInt& x) const;
23 BigInt unblind(const BigInt& x) const;
24
25 bool initialized() const { return reducer.initialized(); }
26
27 Blinder() {}
28
29 /**
30 * Construct a blinder
31 * @param mask the forward (blinding) mask
32 * @param inverse_mask the inverse of mask (depends on algo)
33 * @param modulus of the group operations are performed in
34 */
35 Blinder(const BigInt& mask,
36 const BigInt& inverse_mask,
37 const BigInt& modulus);
38
39 private:
40 Modular_Reducer reducer;
41 mutable BigInt e, d;
42 };
43
44 }
45
46 #endif
Botan::BigInt
Definition: bigint.h:22
Botan::Blinder::initialized
bool initialized() const
Definition: blinding.h:25
Botan
Definition: algo_base.h:14
Botan::Blinder
Definition: blinding.h:19
Botan::Blinder::Blinder
Blinder()
Definition: blinding.h:27
Botan::Modular_Reducer
Definition: reducer.h:18