LCOV - code coverage report
Current view: top level - basic - gcrypt-util.h (source / functions) Hit Total Coverage
Test: main_coverage.info Lines: 1 5 20.0 %
Date: 2019-08-22 15:41:25 Functions: 1 3 33.3 %

          Line data    Source code
       1             : /* SPDX-License-Identifier: LGPL-2.1+ */
       2             : 
       3             : #pragma once
       4             : 
       5             : #include <errno.h>
       6             : #include <stdbool.h>
       7             : #include <stddef.h>
       8             : 
       9             : #if HAVE_GCRYPT
      10             : #include <gcrypt.h>
      11             : 
      12             : #include "macro.h"
      13             : 
      14             : void initialize_libgcrypt(bool secmem);
      15             : int string_hashsum(const char *s, size_t len, int md_algorithm, char **out);
      16             : 
      17          10 : DEFINE_TRIVIAL_CLEANUP_FUNC(gcry_md_hd_t, gcry_md_close);
      18             : #endif
      19             : 
      20           0 : static inline int string_hashsum_sha224(const char *s, size_t len, char **out) {
      21             : #if HAVE_GCRYPT
      22           0 :         return string_hashsum(s, len, GCRY_MD_SHA224, out);
      23             : #else
      24             :         return -EOPNOTSUPP;
      25             : #endif
      26             : }
      27             : 
      28           0 : static inline int string_hashsum_sha256(const char *s, size_t len, char **out) {
      29             : #if HAVE_GCRYPT
      30           0 :         return string_hashsum(s, len, GCRY_MD_SHA256, out);
      31             : #else
      32             :         return -EOPNOTSUPP;
      33             : #endif
      34             : }

Generated by: LCOV version 1.14