9#include <botan/assert.h>
10#include <botan/internal/ffi_mp.h>
11#include <botan/internal/ffi_util.h>
14#if defined(BOTAN_HAS_FPE_FE1)
15 #include <botan/fpe_fe1.h>
22#if defined(BOTAN_HAS_FPE_FE1)
30#if defined(BOTAN_HAS_FPE_FE1)
32 if(fpe ==
nullptr || key ==
nullptr) {
44 auto fpe_obj = std::make_unique<Botan::FPE_FE1>(
safe_get(n), rounds, compat_mode);
46 fpe_obj->set_key(key, key_len);
57#if defined(BOTAN_HAS_FPE_FE1)
66#if defined(BOTAN_HAS_FPE_FE1)
79#if defined(BOTAN_HAS_FPE_FE1)
struct botan_mp_struct * botan_mp_t
#define BOTAN_FPE_FLAG_FE1_COMPAT_MODE
@ BOTAN_FFI_ERROR_NOT_IMPLEMENTED
@ BOTAN_FFI_ERROR_BAD_FLAG
@ BOTAN_FFI_ERROR_NULL_POINTER
struct botan_fpe_struct * botan_fpe_t
int botan_fpe_decrypt(botan_fpe_t fpe, botan_mp_t x, const uint8_t tweak[], size_t tweak_len)
int botan_fpe_destroy(botan_fpe_t fpe)
int botan_fpe_encrypt(botan_fpe_t fpe, botan_mp_t x, const uint8_t tweak[], size_t tweak_len)
int botan_fpe_fe1_init(botan_fpe_t *fpe, botan_mp_t n, const uint8_t key[], size_t key_len, size_t rounds, uint32_t flags)
#define BOTAN_FFI_CHECKED_DELETE(o)
#define BOTAN_FFI_DECLARE_STRUCT(NAME, TYPE, MAGIC)
T & safe_get(botan_struct< T, M > *p)
BOTAN_FFI_ERROR ffi_new_object(T *obj, Args &&... args)
int ffi_guard_thunk(const char *func_name, T thunk)