aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/ffi/ffi.cpp
diff options
context:
space:
mode:
authorDaniel Wyatt <[email protected]>2017-05-25 22:15:48 -0400
committerDaniel Wyatt <[email protected]>2017-05-25 22:15:48 -0400
commitda5871a12ca8f5031b1945e3fcca88921ae8ebd8 (patch)
tree4ab3cf5feb08073f761804841d869b4a768c1a6a /src/lib/ffi/ffi.cpp
parentd8fc6ff06f955358286973e05142dc6c5066f2b8 (diff)
Add botan_hash_copy_state FFI function.
Diffstat (limited to 'src/lib/ffi/ffi.cpp')
-rw-r--r--src/lib/ffi/ffi.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/lib/ffi/ffi.cpp b/src/lib/ffi/ffi.cpp
index 3686c26f1..7e96e5514 100644
--- a/src/lib/ffi/ffi.cpp
+++ b/src/lib/ffi/ffi.cpp
@@ -852,6 +852,12 @@ int botan_hash_final(botan_hash_t hash, uint8_t out[])
return BOTAN_FFI_DO(Botan::HashFunction, hash, h, { h.final(out); });
}
+int botan_hash_copy_state(botan_hash_t* dest, const botan_hash_t source)
+ {
+ return BOTAN_FFI_DO(Botan::HashFunction, source, src, {
+ *dest = new botan_hash_struct(src.copy_state().release()); });
+ }
+
int botan_mac_init(botan_mac_t* mac, const char* mac_name, uint32_t flags)
{
try