]>
git.ipfire.org Git - thirdparty/systemd.git/blob - src/basic/gcrypt-util.h
1 /* SPDX-License-Identifier: LGPL-2.1+ */
2 /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
5 This file is part of systemd.
7 Copyright 2016 Zbigniew Jędrzejewski-Szmek
21 void initialize_libgcrypt(bool secmem
);
22 int string_hashsum(const char *s
, size_t len
, int md_algorithm
, char **out
);
24 DEFINE_TRIVIAL_CLEANUP_FUNC(gcry_md_hd_t
, gcry_md_close
);
27 static inline int string_hashsum_sha224(const char *s
, size_t len
, char **out
) {
29 return string_hashsum(s
, len
, GCRY_MD_SHA224
, out
);
35 static inline int string_hashsum_sha256(const char *s
, size_t len
, char **out
) {
37 return string_hashsum(s
, len
, GCRY_MD_SHA256
, out
);