Botan
3.7.1
Crypto and TLS for C&
Toggle main menu visibility
Main Page
Related Pages
Topics
Namespaces
Namespace List
Namespace Members
All
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
x
z
Functions
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
x
z
Variables
Typedefs
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
u
v
w
x
Enumerations
a
c
d
e
f
g
h
k
l
m
n
o
p
r
s
t
u
v
w
Enumerator
c
d
f
i
m
n
r
s
t
Concepts
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Variables
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
a
b
c
d
f
h
i
m
n
o
p
r
s
t
u
v
w
Enumerations
b
c
d
e
k
m
n
o
p
s
t
x
Enumerator
_
a
b
c
d
e
f
h
k
l
m
n
p
q
r
s
t
u
w
x
Related Symbols
b
c
d
e
f
k
o
p
s
t
x
Files
File List
File Members
All
_
a
b
c
d
e
f
i
k
m
n
o
p
q
s
t
u
w
x
y
z
Functions
b
c
Variables
Typedefs
b
c
e
p
t
Enumerations
Enumerator
b
c
d
e
k
n
Macros
_
a
b
c
f
m
n
q
s
t
w
src
lib
pk_pad
eme.h
Go to the documentation of this file.
1
/*
2
* (C) 1999-2007,2024 Jack Lloyd
3
*
4
* Botan is released under the Simplified BSD License (see license.txt)
5
*/
6
7
#ifndef BOTAN_PUBKEY_EME_H_
8
#define BOTAN_PUBKEY_EME_H_
9
10
#include <botan/types.h>
11
#include <botan/internal/ct_utils.h>
12
#include <memory>
13
#include <span>
14
#include <string_view>
15
16
namespace
Botan
{
17
18
class
RandomNumberGenerator;
19
20
/**
21
* Encoding Method for Encryption
22
*/
23
class
BOTAN_TEST_API
EME
{
24
public
:
25
virtual
~EME
();
26
27
/**
28
* Factory method for EME (message-encoding methods for encryption) objects
29
* @param algo_spec the name of the EME to create
30
* @return pointer to newly allocated object of that type
31
*/
32
static
std::unique_ptr<EME> create(std::string_view algo_spec);
33
34
/**
35
* Return the maximum input size in bytes we can support
36
* @param keybits the size of the key in bits
37
* @return upper bound of input in bytes
38
*/
39
virtual
size_t
maximum_input_size
(
size_t
keybits)
const
= 0;
40
41
/**
42
* Encode an input
43
* @param output buffer that is written to
44
* @param input the plaintext
45
* @param key_length length of the key in bits
46
* @param rng a random number generator
47
* @return number of bytes written to output
48
*/
49
virtual
size_t
pad
(std::span<uint8_t> output,
50
std::span<const uint8_t> input,
51
size_t
key_length,
52
RandomNumberGenerator
& rng)
const
= 0;
53
54
/**
55
* Decode an input
56
* @param output buffer where output is placed
57
* @param input the encoded plaintext
58
* @return number of bytes written to output if valid,
59
* or an empty option if invalid. If an empty option is
60
* returned the contents of output are undefined
61
*/
62
virtual
CT::Option<size_t>
unpad
(std::span<uint8_t> output, std::span<const uint8_t> input)
const
= 0;
63
};
23
class
BOTAN_TEST_API
EME
{
…
};
64
65
}
// namespace Botan
66
67
#endif
BOTAN_TEST_API
#define BOTAN_TEST_API
Definition
api.h:39
Botan::CT::Option
Definition
ct_utils.h:655
Botan::EME
Definition
eme.h:23
Botan::EME::unpad
virtual CT::Option< size_t > unpad(std::span< uint8_t > output, std::span< const uint8_t > input) const =0
Botan::EME::maximum_input_size
virtual size_t maximum_input_size(size_t keybits) const =0
Botan::EME::~EME
virtual ~EME()
Botan::EME::pad
virtual size_t pad(std::span< uint8_t > output, std::span< const uint8_t > input, size_t key_length, RandomNumberGenerator &rng) const =0
Botan::RandomNumberGenerator
Definition
rng.h:31
Botan
Definition
alg_id.cpp:13
Generated by
1.12.0