Botan 3.14.1
Crypto and TLS for C&
x931_sig_padding.h
Go to the documentation of this file.
1/*
2* (C) 1999-2007 Jack Lloyd
3*
4* Botan is released under the Simplified BSD License (see license.txt)
5*/
6
7#ifndef BOTAN_X931_SIGNATURE_PADDING_SCHEME_H_
8#define BOTAN_X931_SIGNATURE_PADDING_SCHEME_H_
9
10#include <botan/internal/sig_padding.h>
11
12namespace Botan {
13
14class HashFunction;
16
17/**
18* Padding scheme from X9.31 (aka EMSA2 in IEEE 1363)
19*
20* Historically used for signature padding with Rabin-Williams,
21* which is not implemented by Botan anymore.
22*
23* Sometimes used with RSA in odd protocols.
24*/
26 public:
28
29 std::string name() const override;
30
31 std::string hash_function() const override;
32
33 private:
34 void update(const uint8_t input[], size_t length) override;
35 std::vector<uint8_t> raw_data() override;
36
37 std::vector<uint8_t> encoding_of(std::span<const uint8_t> raw,
38 size_t key_bits,
39 RandomNumberGenerator& rng) override;
40
41 bool verify(std::span<const uint8_t> coded, std::span<const uint8_t> raw, size_t key_bits) override;
42
43 std::vector<uint8_t> m_empty_hash;
44 std::unique_ptr<HashFunction> m_hash;
45 uint8_t m_hash_id;
46};
47
48} // namespace Botan
49
50#endif
virtual std::vector< uint8_t > raw_data()=0
X931_SignaturePadding(const PK_Signature_Options_Reader &options)
std::string name() const override
std::string hash_function() const override