Botan 2.19.1
Crypto and TLS for C&
emsa1.h
Go to the documentation of this file.
1/*
2* EMSA1
3* (C) 1999-2007 Jack Lloyd
4*
5* Botan is released under the Simplified BSD License (see license.txt)
6*/
7
8#ifndef BOTAN_EMSA1_H_
9#define BOTAN_EMSA1_H_
10
11#include <botan/emsa.h>
12#include <botan/hash.h>
13
15
16namespace Botan {
17
18/**
19* EMSA1 from IEEE 1363
20* Essentially, sign the hash directly
21*/
22class BOTAN_PUBLIC_API(2,0) EMSA1 final : public EMSA
23 {
24 public:
25 /**
26 * @param hash the hash function to use
27 */
28 explicit EMSA1(HashFunction* hash) : m_hash(hash) {}
29
30 EMSA* clone() override;
31
32 std::string name() const override;
33
35 const std::string& cert_hash_name) const override;
36 private:
37 size_t hash_output_length() const { return m_hash->output_length(); }
38
39 void update(const uint8_t[], size_t) override;
40 secure_vector<uint8_t> raw_data() override;
41
42 secure_vector<uint8_t> encoding_of(const secure_vector<uint8_t>& msg,
43 size_t output_bits,
44 RandomNumberGenerator& rng) override;
45
46 bool verify(const secure_vector<uint8_t>& coded,
47 const secure_vector<uint8_t>& raw,
48 size_t key_bits) override;
49
50 std::unique_ptr<HashFunction> m_hash;
51 };
52
53}
54
55#endif
EMSA1(HashFunction *hash)
Definition: emsa1.h:28
virtual secure_vector< uint8_t > encoding_of(const secure_vector< uint8_t > &msg, size_t output_bits, RandomNumberGenerator &rng)=0
virtual bool verify(const secure_vector< uint8_t > &coded, const secure_vector< uint8_t > &raw, size_t key_bits)=0
virtual secure_vector< uint8_t > raw_data()=0
virtual std::string name() const =0
virtual AlgorithmIdentifier config_for_x509(const Private_Key &key, const std::string &cert_hash_name) const
Definition: emsa.cpp:38
virtual EMSA * clone()=0
virtual void update(const uint8_t input[], size_t length)=0
int(* final)(unsigned char *, CTX *)
#define BOTAN_PUBLIC_API(maj, min)
Definition: compiler.h:31
#define BOTAN_FUTURE_INTERNAL_HEADER(hdr)
Definition: compiler.h:136
Definition: alg_id.cpp:13
MechanismType hash