Botan 1.10.17
fpe_fe1.h
Go to the documentation of this file.
1/*
2* Format Preserving Encryption (FE1 scheme)
3* (C) 2009 Jack Lloyd
4*
5* Distributed under the terms of the Botan license
6*/
7
8#ifndef BOTAN_FPE_FE1_H__
9#define BOTAN_FPE_FE1_H__
10
11#include <botan/bigint.h>
12#include <botan/symkey.h>
13
14namespace Botan {
15
16namespace FPE {
17
18/**
19* Encrypt X from and onto the group Z_n using key and tweak
20* @param n the modulus
21* @param X the plaintext as a BigInt
22* @param key a random key
23* @param tweak will modify the ciphertext (think of as an IV)
24*/
25BigInt BOTAN_DLL fe1_encrypt(const BigInt& n, const BigInt& X,
26 const SymmetricKey& key,
27 const MemoryRegion<byte>& tweak);
28
29/**
30* Decrypt X from and onto the group Z_n using key and tweak
31* @param n the modulus
32* @param X the ciphertext as a BigInt
33* @param key is the key used for encryption
34* @param tweak the same tweak used for encryption
35*/
36BigInt BOTAN_DLL fe1_decrypt(const BigInt& n, const BigInt& X,
37 const SymmetricKey& key,
38 const MemoryRegion<byte>& tweak);
39
40}
41
42}
43
44#endif
BigInt fe1_encrypt(const BigInt &n, const BigInt &X0, const SymmetricKey &key, const MemoryRegion< byte > &tweak)
Definition fpe_fe1.cpp:138
BigInt fe1_decrypt(const BigInt &n, const BigInt &X0, const SymmetricKey &key, const MemoryRegion< byte > &tweak)
Definition fpe_fe1.cpp:166
OctetString SymmetricKey
Definition symkey.h:147