aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2015-09-14 17:12:52 +0200
committerMattias Andrée <maandree@operamail.com>2015-09-14 17:12:52 +0200
commit059c0b6189101525fffdbbf8c48632776b3ca2da (patch)
treea90f2ac7de21ea5c8d02a524fddd48e172d70057 /src
parentupdate dist (diff)
downloadlibkeccak-059c0b6189101525fffdbbf8c48632776b3ca2da.tar.gz
libkeccak-059c0b6189101525fffdbbf8c48632776b3ca2da.tar.bz2
libkeccak-059c0b6189101525fffdbbf8c48632776b3ca2da.tar.xz
some functions behave like malloc
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to 'src')
-rw-r--r--src/libkeccak/mac/hmac.h4
-rw-r--r--src/libkeccak/state.h4
2 files changed, 4 insertions, 4 deletions
diff --git a/src/libkeccak/mac/hmac.h b/src/libkeccak/mac/hmac.h
index 7e12ebd..fe6f992 100644
--- a/src/libkeccak/mac/hmac.h
+++ b/src/libkeccak/mac/hmac.h
@@ -131,7 +131,7 @@ int libkeccak_hmac_initialise(libkeccak_hmac_state_t* restrict state, const libk
* @param key_length The length of key, in bits
* @return The state, `NULL` on error
*/
-static inline __attribute__((nonnull, unused, warn_unused_result))
+static inline __attribute__((nonnull, unused, warn_unused_result, malloc))
libkeccak_hmac_state_t* libkeccak_hmac_create(const libkeccak_spec_t* restrict spec,
const char* restrict key, size_t key_length)
{
@@ -257,7 +257,7 @@ int libkeccak_hmac_copy(libkeccak_hmac_state_t* restrict dest, const libkeccak_h
* @param src The state to duplicate
* @return The duplicate, `NULL` on error
*/
-static inline __attribute__((nonnull, unused, warn_unused_result))
+static inline __attribute__((nonnull, unused, warn_unused_result, malloc))
libkeccak_hmac_state_t* libkeccak_hmac_duplicate(const libkeccak_hmac_state_t* restrict src)
{
libkeccak_hmac_state_t* restrict dest = malloc(sizeof(libkeccak_hmac_state_t));
diff --git a/src/libkeccak/state.h b/src/libkeccak/state.h
index 21c7181..75af84a 100644
--- a/src/libkeccak/state.h
+++ b/src/libkeccak/state.h
@@ -186,7 +186,7 @@ void libkeccak_state_destroy(volatile libkeccak_state_t* restrict state)
* @param spec The specifications for the state
* @return The state, `NULL` on error
*/
-static inline __attribute__((nonnull, unused, warn_unused_result))
+static inline __attribute__((nonnull, unused, warn_unused_result, malloc))
libkeccak_state_t* libkeccak_state_create(const libkeccak_spec_t* restrict spec)
{
libkeccak_state_t* restrict state = malloc(sizeof(libkeccak_state_t));
@@ -243,7 +243,7 @@ int libkeccak_state_copy(libkeccak_state_t* restrict dest, const libkeccak_state
* @param src The state to duplicate
* @return The duplicate, `NULL` on error
*/
-static inline __attribute__((nonnull, unused, warn_unused_result))
+static inline __attribute__((nonnull, unused, warn_unused_result, malloc))
libkeccak_state_t* libkeccak_state_duplicate(const libkeccak_state_t* restrict src)
{
libkeccak_state_t* restrict dest = malloc(sizeof(libkeccak_state_t));