xref: /netbsd-src/external/gpl3/gdb.old/dist/libctf/ctf-sha1.h (revision 6881a4007f077b54e5f51159c52b9b25f57deb0d)
17d62b00eSchristos /* SHA-1 thunks.
2*6881a400Schristos    Copyright (C) 2019-2022 Free Software Foundation, Inc.
37d62b00eSchristos 
47d62b00eSchristos    This file is part of libctf.
57d62b00eSchristos 
67d62b00eSchristos    libctf is free software; you can redistribute it and/or modify it under
77d62b00eSchristos    the terms of the GNU General Public License as published by the Free
87d62b00eSchristos    Software Foundation; either version 3, or (at your option) any later
97d62b00eSchristos    version.
107d62b00eSchristos 
117d62b00eSchristos    This program is distributed in the hope that it will be useful, but
127d62b00eSchristos    WITHOUT ANY WARRANTY; without even the implied warranty of
137d62b00eSchristos    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
147d62b00eSchristos    See the GNU General Public License for more details.
157d62b00eSchristos 
167d62b00eSchristos    You should have received a copy of the GNU General Public License
177d62b00eSchristos    along with this program; see the file COPYING.  If not see
187d62b00eSchristos    <http://www.gnu.org/licenses/>.  */
197d62b00eSchristos 
207d62b00eSchristos #ifndef _CTF_SHA1_H
217d62b00eSchristos #define _CTF_SHA1_H
227d62b00eSchristos 
237d62b00eSchristos #include "config.h"
247d62b00eSchristos #include "sha1.h"
257d62b00eSchristos 
267d62b00eSchristos #define CTF_SHA1_SIZE 41
277d62b00eSchristos 
287d62b00eSchristos typedef struct sha1_ctx ctf_sha1_t;
297d62b00eSchristos 
307d62b00eSchristos static inline void
317d62b00eSchristos ctf_sha1_init (ctf_sha1_t *sha1)
327d62b00eSchristos {
337d62b00eSchristos   sha1_init_ctx (sha1);
347d62b00eSchristos }
357d62b00eSchristos 
367d62b00eSchristos static inline void
377d62b00eSchristos ctf_sha1_add (ctf_sha1_t *sha1, const void *buf, size_t len)
387d62b00eSchristos {
397d62b00eSchristos   sha1_process_bytes (buf, len, sha1);
407d62b00eSchristos }
417d62b00eSchristos #endif
42