monotone

monotone Mtn Source Tree

Root/botan/pk_core.h

1/*************************************************
2* PK Algorithm Core Header File *
3* (C) 1999-2006 The Botan Project *
4*************************************************/
5
6#ifndef BOTAN_PK_CORE_H__
7#define BOTAN_PK_CORE_H__
8
9#include <botan/bigint.h>
10#include <botan/dl_group.h>
11#include <botan/blinding.h>
12#include <botan/pk_ops.h>
13
14namespace Botan {
15
16/*************************************************
17* IF Core *
18*************************************************/
19class IF_Core
20 {
21 public:
22 BigInt public_op(const BigInt&) const;
23 BigInt private_op(const BigInt&) const;
24
25 IF_Core& operator=(const IF_Core&);
26
27 IF_Core() { op = 0; }
28 IF_Core(const IF_Core&);
29 IF_Core(const BigInt&, const BigInt&,
30 const BigInt& = 0, const BigInt& = 0, const BigInt& = 0,
31 const BigInt& = 0, const BigInt& = 0, const BigInt& = 0);
32 ~IF_Core() { delete op; }
33 private:
34 IF_Operation* op;
35 Blinder blinder;
36 };
37
38/*************************************************
39* DSA Core *
40*************************************************/
41class DSA_Core
42 {
43 public:
44 SecureVector<byte> sign(const byte[], u32bit, const BigInt&) const;
45 bool verify(const byte[], u32bit, const byte[], u32bit) const;
46
47 DSA_Core& operator=(const DSA_Core&);
48
49 DSA_Core() { op = 0; }
50 DSA_Core(const DSA_Core&);
51 DSA_Core(const DL_Group&, const BigInt&, const BigInt& = 0);
52 ~DSA_Core() { delete op; }
53 private:
54 DSA_Operation* op;
55 };
56
57/*************************************************
58* NR Core *
59*************************************************/
60class NR_Core
61 {
62 public:
63 SecureVector<byte> sign(const byte[], u32bit, const BigInt&) const;
64 SecureVector<byte> verify(const byte[], u32bit) const;
65
66 NR_Core& operator=(const NR_Core&);
67
68 NR_Core() { op = 0; }
69 NR_Core(const NR_Core&);
70 NR_Core(const DL_Group&, const BigInt&, const BigInt& = 0);
71 ~NR_Core() { delete op; }
72 private:
73 NR_Operation* op;
74 };
75
76/*************************************************
77* ElGamal Core *
78*************************************************/
79class ELG_Core
80 {
81 public:
82 SecureVector<byte> encrypt(const byte[], u32bit, const BigInt&) const;
83 SecureVector<byte> decrypt(const byte[], u32bit) const;
84
85 ELG_Core& operator=(const ELG_Core&);
86
87 ELG_Core() { op = 0; }
88 ELG_Core(const ELG_Core&);
89 ELG_Core(const DL_Group&, const BigInt&, const BigInt& = 0);
90 ~ELG_Core() { delete op; }
91 private:
92 ELG_Operation* op;
93 Blinder blinder;
94 u32bit p_bytes;
95 };
96
97/*************************************************
98* DH Core *
99*************************************************/
100class DH_Core
101 {
102 public:
103 BigInt agree(const BigInt&) const;
104
105 DH_Core& operator=(const DH_Core&);
106
107 DH_Core() { op = 0; }
108 DH_Core(const DH_Core&);
109 DH_Core(const DL_Group&, const BigInt&);
110 ~DH_Core() { delete op; }
111 private:
112 DH_Operation* op;
113 Blinder blinder;
114 };
115
116}
117
118#endif

Archive Download this file

Branches

Tags

Quick Links:     www.monotone.ca    -     Downloads    -     Documentation    -     Wiki    -     Code Forge    -     Build Status