Botan
3.14.1
Crypto and TLS for C&
src
lib
pk_pad
sig_padding
emsa_x931
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
12
namespace
Botan
{
13
14
class
HashFunction
;
15
class
PK_Signature_Options_Reader
;
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
*/
25
class
X931_SignaturePadding
final :
public
SignaturePaddingScheme
{
26
public
:
27
explicit
X931_SignaturePadding
(
const
PK_Signature_Options_Reader
& options);
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
Botan::HashFunction
Definition
hash.h:21
Botan::PK_Signature_Options_Reader
Definition
pk_options_readers.h:38
Botan::RandomNumberGenerator
Definition
rng.h:39
Botan::SignaturePaddingScheme
Definition
sig_padding.h:26
Botan::SignaturePaddingScheme::raw_data
virtual std::vector< uint8_t > raw_data()=0
Botan::X931_SignaturePadding::X931_SignaturePadding
X931_SignaturePadding(const PK_Signature_Options_Reader &options)
Definition
x931_sig_padding.cpp:96
Botan::X931_SignaturePadding::name
std::string name() const override
Definition
x931_sig_padding.cpp:60
Botan::X931_SignaturePadding::hash_function
std::string hash_function() const override
Definition
x931_sig_padding.cpp:56
Botan
Definition
alg_id.cpp:14
Generated by
1.16.1