aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/prov/bearssl/bearssl.h
blob: 1ba7d2dc67d8e76e227223527ef928ca04bb0665 (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
/*
* Utils for calling BearSSL
* (C) 2015,2016 Jack Lloyd
* (C) 2017 Patrick Wildt
*
* Botan is released under the Simplified BSD License (see license.txt)
*/

#ifndef BOTAN_INTERNAL_BEARSSL_H__
#define BOTAN_INTERNAL_BEARSSL_H__

#include <botan/pk_ops_fwd.h>
#include <botan/secmem.h>
#include <botan/exceptn.h>
#include <memory>
#include <string>

namespace Botan {

class HashFunction;

class BearSSL_Error : public Exception
   {
   public:
      BearSSL_Error(const std::string& what) :
         Exception(what + " failed") {}
   };

/* Hash */

std::unique_ptr<HashFunction>
make_bearssl_hash(const std::string& name);

/* ECDSA */

#if defined(BOTAN_HAS_ECDSA)

class ECDSA_PublicKey;
class ECDSA_PrivateKey;

std::unique_ptr<PK_Ops::Verification>
make_bearssl_ecdsa_ver_op(const ECDSA_PublicKey& key, const std::string& params);
std::unique_ptr<PK_Ops::Signature>
make_bearssl_ecdsa_sig_op(const ECDSA_PrivateKey& key, const std::string& params);

#endif

}

#endif