diff options
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/ffi/ffi.cpp | 10 | ||||
-rw-r--r-- | src/lib/ffi/ffi.h | 4 | ||||
-rw-r--r-- | src/lib/ffi/info.txt | 2 |
3 files changed, 15 insertions, 1 deletions
diff --git a/src/lib/ffi/ffi.cpp b/src/lib/ffi/ffi.cpp index eb30b4831..7ed279bbd 100644 --- a/src/lib/ffi/ffi.cpp +++ b/src/lib/ffi/ffi.cpp @@ -429,6 +429,16 @@ int botan_cipher_clear(botan_cipher_t cipher) return BOTAN_FFI_DO(Botan::Cipher_Mode, cipher, { cipher.clear(); }); } +int botan_cipher_query_keylen(botan_cipher_t cipher, + size_t* out_minimum_keylength, + size_t* out_maximum_keylength) + { + return BOTAN_FFI_DO(Botan::Cipher_Mode, cipher, { + *out_minimum_keylength = cipher.key_spec().minimum_keylength(); + *out_maximum_keylength = cipher.key_spec().maximum_keylength(); + }); + } + int botan_cipher_set_key(botan_cipher_t cipher, const uint8_t* key, size_t key_len) { diff --git a/src/lib/ffi/ffi.h b/src/lib/ffi/ffi.h index ce2253725..2def4f4d5 100644 --- a/src/lib/ffi/ffi.h +++ b/src/lib/ffi/ffi.h @@ -220,6 +220,10 @@ BOTAN_DLL int botan_cipher_get_tag_length(botan_cipher_t cipher, size_t* tag_siz BOTAN_DLL int botan_cipher_get_default_nonce_length(botan_cipher_t cipher, size_t* nl); BOTAN_DLL int botan_cipher_get_update_granularity(botan_cipher_t cipher, size_t* ug); +BOTAN_DLL int botan_cipher_query_keylen(botan_cipher_t, + size_t* out_minimum_keylength, + size_t* out_maximum_keylength); + BOTAN_DLL int botan_cipher_set_key(botan_cipher_t cipher, const uint8_t* key, size_t key_len); diff --git a/src/lib/ffi/info.txt b/src/lib/ffi/info.txt index 4018e4064..7c8968ff0 100644 --- a/src/lib/ffi/info.txt +++ b/src/lib/ffi/info.txt @@ -1,4 +1,4 @@ -define FFI 20151001 +define FFI 20151015 <requires> aead |