monotone

monotone Mtn Source Tree

Root/botan/dh.h

1/*************************************************
2* Diffie-Hellman Header File *
3* (C) 1999-2006 The Botan Project *
4*************************************************/
5
6#ifndef BOTAN_DIFFIE_HELLMAN_H__
7#define BOTAN_DIFFIE_HELLMAN_H__
8
9#include <botan/dl_algo.h>
10#include <botan/pk_core.h>
11
12namespace Botan {
13
14/*************************************************
15* Diffie-Hellman Public Key *
16*************************************************/
17class DH_PublicKey : public virtual DL_Scheme_PublicKey
18 {
19 public:
20 std::string algo_name() const { return "DH"; }
21
22 MemoryVector<byte> public_value() const;
23 u32bit max_input_bits() const;
24
25 DL_Group::Format group_format() const { return DL_Group::ANSI_X9_42; }
26
27 DH_PublicKey() {}
28 DH_PublicKey(const DL_Group&, const BigInt&);
29 private:
30 void X509_load_hook();
31 };
32
33/*************************************************
34* Diffie-Hellman Private Key *
35*************************************************/
36class DH_PrivateKey : public DH_PublicKey,
37 public PK_Key_Agreement_Key,
38 public virtual DL_Scheme_PrivateKey
39 {
40 public:
41 SecureVector<byte> derive_key(const byte[], u32bit) const;
42 SecureVector<byte> derive_key(const DH_PublicKey&) const;
43 SecureVector<byte> derive_key(const BigInt&) const;
44
45 MemoryVector<byte> public_value() const;
46
47 DH_PrivateKey() {}
48 DH_PrivateKey(const DL_Group&);
49 DH_PrivateKey(const DL_Group&, const BigInt&, const BigInt& = 0);
50 private:
51 void PKCS8_load_hook(bool = false);
52 DH_Core core;
53 };
54
55}
56
57#endif

Archive Download this file

Branches

Tags

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