aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/ffi
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2017-05-03 10:13:37 -0400
committerJack Lloyd <[email protected]>2017-05-03 10:13:37 -0400
commit9caead4b585b9a0ed8aeb51f034bb97b05d8168e (patch)
tree3fc461d65593b8384235c517259409ccce83a692 /src/lib/ffi
parenta6d9a805e2a4664610fc8c0ed1031fc80c23d82a (diff)
parent832f10eb1792aeedf5ab2970a9889fe4b10375a3 (diff)
Merge GH #1036 Add FFI botan_hash_block_size
Diffstat (limited to 'src/lib/ffi')
-rw-r--r--src/lib/ffi/ffi.cpp5
-rw-r--r--src/lib/ffi/ffi.h8
2 files changed, 13 insertions, 0 deletions
diff --git a/src/lib/ffi/ffi.cpp b/src/lib/ffi/ffi.cpp
index 930bf60d9..4d5f67e34 100644
--- a/src/lib/ffi/ffi.cpp
+++ b/src/lib/ffi/ffi.cpp
@@ -828,6 +828,11 @@ int botan_hash_output_length(botan_hash_t hash, size_t* out)
return BOTAN_FFI_DO(Botan::HashFunction, hash, h, { *out = h.output_length(); });
}
+int botan_hash_block_size(botan_hash_t hash, size_t* out)
+ {
+ return BOTAN_FFI_DO(Botan::HashFunction, hash, h, { *out = h.hash_block_size(); });
+ }
+
int botan_hash_clear(botan_hash_t hash)
{
return BOTAN_FFI_DO(Botan::HashFunction, hash, h, { h.clear(); });
diff --git a/src/lib/ffi/ffi.h b/src/lib/ffi/ffi.h
index 8fb7ca832..5638810f9 100644
--- a/src/lib/ffi/ffi.h
+++ b/src/lib/ffi/ffi.h
@@ -233,6 +233,14 @@ BOTAN_DLL int botan_hash_init(botan_hash_t* hash, const char* hash_name, uint32_
BOTAN_DLL int botan_hash_output_length(botan_hash_t hash, size_t* output_length);
/**
+* Writes the block size of the hash function to *block_size
+* @param hash hash object
+* @param output_length output buffer to hold the hash function output length
+* @return 0 on success, a negative value on failure
+*/
+BOTAN_DLL int botan_hash_block_size(botan_hash_t hash, size_t* block_size);
+
+/**
* Send more input to the hash function
* @param hash hash object
* @param in input buffer