aboutsummaryrefslogtreecommitdiffstats
path: root/src/pubkey/eckaeg/eckaeg_core.cpp
blob: 9d59af1184f955d2a0ae13e0be2266b816e4d2af (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
/*************************************************
* ECKAEG Core Source File                        *
* (C) 1999-2007 Jack Lloyd                       *
* (C) 2007 FlexSecure GmbH                       *
*************************************************/

#include <botan/eckaeg_core.h>
#include <botan/numthry.h>
#include <botan/engine.h>
#include <botan/parsing.h>
#include <algorithm>

namespace Botan {

/*************************************************
* ECKAEG_Core Constructor                        *
*************************************************/
ECKAEG_Core::ECKAEG_Core(const EC_Domain_Params& dom_pars,
                         const BigInt& priv_key,
                         const PointGFp& pub_key)
   {
   op = Engine_Core::eckaeg_op(dom_pars, priv_key, pub_key);
   }

/*************************************************
* ECKAEG_Core Copy Constructor                   *
*************************************************/
ECKAEG_Core::ECKAEG_Core(const ECKAEG_Core& core)
   {
   op = 0;
   if(core.op)
      op = core.op->clone();
   blinder = core.blinder;
   }

/*************************************************
* ECKAEG_Core Assignment Operator                *
*************************************************/
ECKAEG_Core& ECKAEG_Core::operator=(const ECKAEG_Core& core)
   {
   delete op;
   if(core.op)
      op = core.op->clone();
   blinder = core.blinder;
   return (*this);
   }

/*************************************************
* ECKAEG Operation                               *
*************************************************/
SecureVector<byte> ECKAEG_Core::agree(const PointGFp& otherKey) const
   {
   //assert(op.get());
   return op->agree(otherKey);
   }

}