Botan
1.10.17
src
pk_pad
emsa1_bsi
emsa1_bsi.cpp
Go to the documentation of this file.
1
/*
2
* EMSA1 BSI
3
* (C) 1999-2008 Jack Lloyd
4
* 2008 Falko Strenzke, FlexSecure GmbH
5
*
6
* Distributed under the terms of the Botan license
7
*/
8
9
#include <botan/emsa1_bsi.h>
10
11
namespace
Botan
{
12
13
/*
14
* EMSA1 BSI Encode Operation
15
*/
16
SecureVector<byte>
EMSA1_BSI::encoding_of(
const
MemoryRegion<byte>
& msg,
17
size_t
output_bits,
18
RandomNumberGenerator
&)
19
{
20
if
(msg.size() !=
hash_ptr
()->output_length())
21
throw
Encoding_Error
(
"EMSA1_BSI::encoding_of: Invalid size for input"
);
22
23
if
(8*msg.size() <= output_bits)
24
return
msg;
25
26
throw
Encoding_Error
(
"EMSA1_BSI::encoding_of: max key input size exceeded"
);
27
}
28
29
}
Botan::EMSA1::hash_ptr
const HashFunction * hash_ptr() const
Definition
emsa1.h:32
Botan::MemoryRegion
Definition
secmem.h:22
Botan::RandomNumberGenerator
Definition
rng.h:21
Botan::SecureVector
Definition
secmem.h:329
Botan
Definition
algo_base.h:14
Botan::Encoding_Error::Encoding_Error
Encoding_Error(const std::string &name)
Definition
exceptn.h:131
Generated by
1.18.0