xref: /netbsd-src/external/gpl3/gdb/dist/libctf/ctf-sha1.h (revision 12989c96ee862c63521a9ead8c44629b7a2ba9b1)
18dffb485Schristos /* SHA-1 thunks.
2*12989c96Schristos    Copyright (C) 2019-2024 Free Software Foundation, Inc.
38dffb485Schristos 
48dffb485Schristos    This file is part of libctf.
58dffb485Schristos 
68dffb485Schristos    libctf is free software; you can redistribute it and/or modify it under
78dffb485Schristos    the terms of the GNU General Public License as published by the Free
88dffb485Schristos    Software Foundation; either version 3, or (at your option) any later
98dffb485Schristos    version.
108dffb485Schristos 
118dffb485Schristos    This program is distributed in the hope that it will be useful, but
128dffb485Schristos    WITHOUT ANY WARRANTY; without even the implied warranty of
138dffb485Schristos    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
148dffb485Schristos    See the GNU General Public License for more details.
158dffb485Schristos 
168dffb485Schristos    You should have received a copy of the GNU General Public License
178dffb485Schristos    along with this program; see the file COPYING.  If not see
188dffb485Schristos    <http://www.gnu.org/licenses/>.  */
198dffb485Schristos 
208dffb485Schristos #ifndef _CTF_SHA1_H
218dffb485Schristos #define _CTF_SHA1_H
228dffb485Schristos 
238dffb485Schristos #include "config.h"
248dffb485Schristos #include "sha1.h"
258dffb485Schristos 
268dffb485Schristos #define CTF_SHA1_SIZE 41
278dffb485Schristos 
288dffb485Schristos typedef struct sha1_ctx ctf_sha1_t;
298dffb485Schristos 
308dffb485Schristos static inline void
318dffb485Schristos ctf_sha1_init (ctf_sha1_t *sha1)
328dffb485Schristos {
338dffb485Schristos   sha1_init_ctx (sha1);
348dffb485Schristos }
358dffb485Schristos 
368dffb485Schristos static inline void
378dffb485Schristos ctf_sha1_add (ctf_sha1_t *sha1, const void *buf, size_t len)
388dffb485Schristos {
398dffb485Schristos   sha1_process_bytes (buf, len, sha1);
408dffb485Schristos }
418dffb485Schristos #endif
42