diff options
Diffstat (limited to 'src/pubkey/if_algo')
-rw-r--r-- | src/pubkey/if_algo/if_algo.cpp | 58 | ||||
-rw-r--r-- | src/pubkey/if_algo/if_algo.h | 10 | ||||
-rw-r--r-- | src/pubkey/if_algo/if_core.cpp | 46 | ||||
-rw-r--r-- | src/pubkey/if_algo/if_core.h | 16 | ||||
-rw-r--r-- | src/pubkey/if_algo/if_op.cpp | 22 | ||||
-rw-r--r-- | src/pubkey/if_algo/if_op.h | 22 |
6 files changed, 93 insertions, 81 deletions
diff --git a/src/pubkey/if_algo/if_algo.cpp b/src/pubkey/if_algo/if_algo.cpp index 929f488fd..556c86f6f 100644 --- a/src/pubkey/if_algo/if_algo.cpp +++ b/src/pubkey/if_algo/if_algo.cpp @@ -1,7 +1,9 @@ -/************************************************* -* IF Scheme Source File * -* (C) 1999-2007 Jack Lloyd * -*************************************************/ +/* +* IF Scheme +* (C) 1999-2007 Jack Lloyd +* +* Distributed under the terms of the Botan license +*/ #include <botan/if_algo.h> #include <botan/numthry.h> @@ -10,9 +12,9 @@ namespace Botan { -/************************************************* -* Return the X.509 public key encoder * -*************************************************/ +/* +* Return the X.509 public key encoder +*/ X509_Encoder* IF_Scheme_PublicKey::x509_encoder() const { class IF_Scheme_Encoder : public X509_Encoder @@ -42,9 +44,9 @@ X509_Encoder* IF_Scheme_PublicKey::x509_encoder() const return new IF_Scheme_Encoder(this); } -/************************************************* -* Return the X.509 public key decoder * -*************************************************/ +/* +* Return the X.509 public key decoder +*/ X509_Decoder* IF_Scheme_PublicKey::x509_decoder() { class IF_Scheme_Decoder : public X509_Decoder @@ -72,9 +74,9 @@ X509_Decoder* IF_Scheme_PublicKey::x509_decoder() return new IF_Scheme_Decoder(this); } -/************************************************* -* Return the PKCS #8 public key encoder * -*************************************************/ +/* +* Return the PKCS #8 public key encoder +*/ PKCS8_Encoder* IF_Scheme_PrivateKey::pkcs8_encoder() const { class IF_Scheme_Encoder : public PKCS8_Encoder @@ -111,9 +113,9 @@ PKCS8_Encoder* IF_Scheme_PrivateKey::pkcs8_encoder() const return new IF_Scheme_Encoder(this); } -/************************************************* -* Return the PKCS #8 public key decoder * -*************************************************/ +/* +* Return the PKCS #8 public key decoder +*/ PKCS8_Decoder* IF_Scheme_PrivateKey::pkcs8_decoder(RandomNumberGenerator& rng) { class IF_Scheme_Decoder : public PKCS8_Decoder @@ -154,17 +156,17 @@ PKCS8_Decoder* IF_Scheme_PrivateKey::pkcs8_decoder(RandomNumberGenerator& rng) return new IF_Scheme_Decoder(this, rng); } -/************************************************* -* Algorithm Specific X.509 Initialization Code * -*************************************************/ +/* +* Algorithm Specific X.509 Initialization Code +*/ void IF_Scheme_PublicKey::X509_load_hook() { core = IF_Core(e, n); } -/************************************************* -* Algorithm Specific PKCS #8 Initialization Code * -*************************************************/ +/* +* Algorithm Specific PKCS #8 Initialization Code +*/ void IF_Scheme_PrivateKey::PKCS8_load_hook(RandomNumberGenerator& rng, bool generated) { @@ -181,9 +183,9 @@ void IF_Scheme_PrivateKey::PKCS8_load_hook(RandomNumberGenerator& rng, load_check(rng); } -/************************************************* -* Check IF Scheme Public Parameters * -*************************************************/ +/* +* Check IF Scheme Public Parameters +*/ bool IF_Scheme_PublicKey::check_key(RandomNumberGenerator&, bool) const { if(n < 35 || n.is_even() || e < 2) @@ -191,9 +193,9 @@ bool IF_Scheme_PublicKey::check_key(RandomNumberGenerator&, bool) const return true; } -/************************************************* -* Check IF Scheme Private Parameters * -*************************************************/ +/* +* Check IF Scheme Private Parameters +*/ bool IF_Scheme_PrivateKey::check_key(RandomNumberGenerator& rng, bool strong) const { diff --git a/src/pubkey/if_algo/if_algo.h b/src/pubkey/if_algo/if_algo.h index 7afd7fed5..32a29be49 100644 --- a/src/pubkey/if_algo/if_algo.h +++ b/src/pubkey/if_algo/if_algo.h @@ -1,7 +1,9 @@ -/************************************************* -* IF Scheme Header File * -* (C) 1999-2007 Jack Lloyd * -*************************************************/ +/* +* IF Scheme +* (C) 1999-2007 Jack Lloyd +* +* Distributed under the terms of the Botan license +*/ #ifndef BOTAN_IF_ALGO_H__ #define BOTAN_IF_ALGO_H__ diff --git a/src/pubkey/if_algo/if_core.cpp b/src/pubkey/if_algo/if_core.cpp index 97cacf9d8..d112e8a77 100644 --- a/src/pubkey/if_algo/if_core.cpp +++ b/src/pubkey/if_algo/if_core.cpp @@ -1,7 +1,9 @@ -/************************************************* -* IF Algorithm Core Source File * -* (C) 1999-2007 Jack Lloyd * -*************************************************/ +/* +* IF Algorithm Core +* (C) 1999-2007 Jack Lloyd +* +* Distributed under the terms of the Botan license +*/ #include <botan/if_core.h> #include <botan/numthry.h> @@ -17,18 +19,18 @@ const u32bit BLINDING_BITS = BOTAN_PRIVATE_KEY_OP_BLINDING_BITS; } -/************************************************* -* IF_Core Constructor * -*************************************************/ +/* +* IF_Core Constructor +*/ IF_Core::IF_Core(const BigInt& e, const BigInt& n) { op = Engine_Core::if_op(e, n, 0, 0, 0, 0, 0, 0); } -/************************************************* -* IF_Core Constructor * -*************************************************/ +/* +* IF_Core Constructor +*/ IF_Core::IF_Core(RandomNumberGenerator& rng, const BigInt& e, const BigInt& n, const BigInt& d, const BigInt& p, const BigInt& q, @@ -43,9 +45,9 @@ IF_Core::IF_Core(RandomNumberGenerator& rng, } } -/************************************************* -* IF_Core Copy Constructor * -*************************************************/ +/* +* IF_Core Copy Constructor +*/ IF_Core::IF_Core(const IF_Core& core) { op = 0; @@ -54,9 +56,9 @@ IF_Core::IF_Core(const IF_Core& core) blinder = core.blinder; } -/************************************************* -* IF_Core Assignment Operator * -*************************************************/ +/* +* IF_Core Assignment Operator +*/ IF_Core& IF_Core::operator=(const IF_Core& core) { delete op; @@ -66,17 +68,17 @@ IF_Core& IF_Core::operator=(const IF_Core& core) return (*this); } -/************************************************* -* IF Public Operation * -*************************************************/ +/* +* IF Public Operation +*/ BigInt IF_Core::public_op(const BigInt& i) const { return op->public_op(i); } -/************************************************* -* IF Private Operation * -*************************************************/ +/* +* IF Private Operation +*/ BigInt IF_Core::private_op(const BigInt& i) const { return blinder.unblind(op->private_op(blinder.blind(i))); diff --git a/src/pubkey/if_algo/if_core.h b/src/pubkey/if_algo/if_core.h index ae9fb3d09..b7f487706 100644 --- a/src/pubkey/if_algo/if_core.h +++ b/src/pubkey/if_algo/if_core.h @@ -1,7 +1,9 @@ -/************************************************* -* IF Algorithm Core Header File * -* (C) 1999-2007 Jack Lloyd * -*************************************************/ +/* +* IF Algorithm Core +* (C) 1999-2007 Jack Lloyd +* +* Distributed under the terms of the Botan license +*/ #ifndef BOTAN_IF_CORE_H__ #define BOTAN_IF_CORE_H__ @@ -11,9 +13,9 @@ namespace Botan { -/************************************************* -* IF Core * -*************************************************/ +/* +* IF Core +*/ class BOTAN_DLL IF_Core { public: diff --git a/src/pubkey/if_algo/if_op.cpp b/src/pubkey/if_algo/if_op.cpp index 242911a2e..27aef453e 100644 --- a/src/pubkey/if_algo/if_op.cpp +++ b/src/pubkey/if_algo/if_op.cpp @@ -1,16 +1,18 @@ -/************************************************* -* IF (RSA/RW) Operation Source File * -* (C) 1999-2007 Jack Lloyd * -*************************************************/ +/* +* IF (RSA/RW) Operation +* (C) 1999-2007 Jack Lloyd +* +* Distributed under the terms of the Botan license +*/ #include <botan/if_op.h> #include <botan/numthry.h> namespace Botan { -/************************************************* -* Default_IF_Op Constructor * -*************************************************/ +/* +* Default_IF_Op Constructor +*/ Default_IF_Op::Default_IF_Op(const BigInt& e, const BigInt& n, const BigInt&, const BigInt& p, const BigInt& q, const BigInt& d1, const BigInt& d2, @@ -28,9 +30,9 @@ Default_IF_Op::Default_IF_Op(const BigInt& e, const BigInt& n, const BigInt&, } } -/************************************************* -* Default IF Private Operation * -*************************************************/ +/* +* Default IF Private Operation +*/ BigInt Default_IF_Op::private_op(const BigInt& i) const { if(q == 0) diff --git a/src/pubkey/if_algo/if_op.h b/src/pubkey/if_algo/if_op.h index 73f5390cf..516902fd9 100644 --- a/src/pubkey/if_algo/if_op.h +++ b/src/pubkey/if_algo/if_op.h @@ -1,7 +1,9 @@ -/************************************************* -* IF Operations Header File * -* (C) 1999-2008 Jack Lloyd * -*************************************************/ +/* +* IF Operations +* (C) 1999-2008 Jack Lloyd +* +* Distributed under the terms of the Botan license +*/ #ifndef BOTAN_IF_OP_H__ #define BOTAN_IF_OP_H__ @@ -12,9 +14,9 @@ namespace Botan { -/************************************************* -* IF Operation * -*************************************************/ +/* +* IF Operation +*/ class BOTAN_DLL IF_Operation { public: @@ -24,9 +26,9 @@ class BOTAN_DLL IF_Operation virtual ~IF_Operation() {} }; -/************************************************* -* Default IF Operation * -*************************************************/ +/* +* Default IF Operation +*/ class BOTAN_DLL Default_IF_Op : public IF_Operation { public: |