Botan 2.19.1
Crypto and TLS for C&
eme_raw.cpp
Go to the documentation of this file.
1/*
2* (C) 2015,2016 Jack Lloyd
3*
4* Botan is released under the Simplified BSD License (see license.txt)
5*/
6
7#include <botan/eme_raw.h>
8#include <botan/internal/bit_ops.h>
9#include <botan/internal/ct_utils.h>
10
11namespace Botan {
12
13secure_vector<uint8_t> EME_Raw::pad(const uint8_t in[], size_t in_length,
14 size_t,
15 RandomNumberGenerator&) const
16 {
17 return secure_vector<uint8_t>(in, in + in_length);
18 }
19
20secure_vector<uint8_t> EME_Raw::unpad(uint8_t& valid_mask,
21 const uint8_t in[], size_t in_length) const
22 {
23 valid_mask = 0xFF;
24 return CT::strip_leading_zeros(in, in_length);
25 }
26
27size_t EME_Raw::maximum_input_size(size_t keybits) const
28 {
29 return keybits / 8;
30 }
31}
size_t maximum_input_size(size_t i) const override
Definition: eme_raw.cpp:27
secure_vector< uint8_t > strip_leading_zeros(const uint8_t in[], size_t length)
Definition: ct_utils.cpp:66
Definition: alg_id.cpp:13