diff options
author | Marc Kleine-Budde <mkl@pengutronix.de> | 2015-06-15 15:46:40 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2015-06-17 07:58:10 +0200 |
commit | 690ee0ee2bb8ec6144ed77d019d7e86184b16bde (patch) | |
tree | 37e4bc04a35f9622f74fc3992a06b6c6ebac30b0 /include/digest.h | |
parent | a3a17dfd5a2c5df9626c844dcbef3bb2e9cce14c (diff) | |
download | barebox-690ee0ee2bb8ec6144ed77d019d7e86184b16bde.tar.gz |
crypto: digest: provide static inline no-ops if digest is disabled
Cc: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'include/digest.h')
-rw-r--r-- | include/digest.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/include/digest.h b/include/digest.h index 7c6711b32a..3a9d305963 100644 --- a/include/digest.h +++ b/include/digest.h @@ -59,6 +59,7 @@ struct digest { /* * digest functions */ +#ifdef CONFIG_DIGEST int digest_algo_register(struct digest_algo *d); void digest_algo_unregister(struct digest_algo *d); void digest_algo_prints(const char *prefix); @@ -76,6 +77,16 @@ int digest_file(struct digest *d, const char *filename, int digest_file_by_name(const char *algo, const char *filename, unsigned char *hash, const unsigned char *sig); +#else +static inline struct digest *digest_alloc(const char *name) +{ + return NULL; +} + +static inline void digest_free(struct digest *d) +{ +} +#endif static inline int digest_init(struct digest *d) { |