Botan 3.9.0
Crypto and TLS for C&
raw_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_SIGN_RAW_BYTES_H_
8#define BOTAN_SIGN_RAW_BYTES_H_
9
10#include <botan/internal/sig_padding.h>
11#include <string>
12#include <vector>
13
14namespace Botan {
15
17
18/**
19* This class sign inputs directly with no intermediate hashing or padding.
20*
21* This is insecure unless used very carefully.
22*/
24 public:
25 explicit SignRawBytes(size_t expected_hash_size = 0) : m_expected_size(expected_hash_size) {}
26
27 std::string hash_function() const override { return "Raw"; }
28
29 std::string name() const override;
30
31 private:
32 void update(const uint8_t input[], size_t length) override;
33 std::vector<uint8_t> raw_data() override;
34
35 std::vector<uint8_t> encoding_of(std::span<const uint8_t> raw,
36 size_t key_bits,
37 RandomNumberGenerator& rng) override;
38
39 bool verify(std::span<const uint8_t> coded, std::span<const uint8_t> raw, size_t key_bits) override;
40
41 const size_t m_expected_size;
42 std::vector<uint8_t> m_message;
43};
44
45} // namespace Botan
46
47#endif
SignRawBytes(size_t expected_hash_size=0)
std::string hash_function() const override
std::string name() const override
virtual std::vector< uint8_t > raw_data()=0