~ubuntu-branches/debian/sid/botan/sid

« back to all changes in this revision

Viewing changes to src/lib/pk_pad/eme_raw/eme_raw.cpp

  • Committer: Package Import Robot
  • Author(s): Laszlo Boszormenyi (GCS)
  • Date: 2018-03-01 22:23:25 UTC
  • mfrom: (1.2.2)
  • Revision ID: package-import@ubuntu.com-20180301222325-7p7vc45gu3hta34d
Tags: 2.4.0-2
* Don't remove .doctrees from the manual if it doesn't exist.
* Don't specify parallel to debhelper.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
 
 
11
namespace Botan {
 
12
 
 
13
secure_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
 
 
20
secure_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
 
 
27
size_t EME_Raw::maximum_input_size(size_t keybits) const
 
28
   {
 
29
   return keybits / 8;
 
30
   }
 
31
}