2
* Format Preserving Encryption (FE1 scheme)
5
* Botan is released under the Simplified BSD License (see license.txt)
8
#ifndef BOTAN_FPE_FE1_H_
9
#define BOTAN_FPE_FE1_H_
11
#include <botan/bigint.h>
12
#include <botan/symkey.h>
19
* Format Preserving Encryption using the scheme FE1 from the paper
20
* "Format-Preserving Encryption" by Bellare, Rogaway, et al
21
* (https://eprint.iacr.org/2009/251)
23
* Encrypt X from and onto the group Z_n using key and tweak
24
* @param n the modulus
25
* @param X the plaintext as a BigInt
26
* @param key a random key
27
* @param tweak will modify the ciphertext (think of as an IV)
29
BigInt BOTAN_PUBLIC_API(2,0) fe1_encrypt(const BigInt& n, const BigInt& X,
30
const SymmetricKey& key,
31
const std::vector<uint8_t>& tweak);
34
* Decrypt X from and onto the group Z_n using key and tweak
35
* @param n the modulus
36
* @param X the ciphertext as a BigInt
37
* @param key is the key used for encryption
38
* @param tweak the same tweak used for encryption
40
BigInt BOTAN_PUBLIC_API(2,0) fe1_decrypt(const BigInt& n, const BigInt& X,
41
const SymmetricKey& key,
42
const std::vector<uint8_t>& tweak);