"Fossies" - the Fresh Open Source Software Archive
Member "xorriso-1.5.4/libjte/sha1.h" (30 Jan 2021, 1899 Bytes) of package /linux/misc/xorriso-1.5.4.pl02.tar.gz:
As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard
) with prefixed line numbers and code folding
Alternatively you can here view
the uninterpreted source code file.
For more information about "sha1.h" see the Fossies "Dox" file reference
1 /* sha1.c - SHA1 hash function
2 * Copyright (C) 1998, 2001, 2002, 2003, 2008 Free Software Foundation, Inc.
4 * This file was part of Libgcrypt.
6 * Libgcrypt is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU Lesser General Public License as
8 * published by the Free Software Foundation; either version 2.1 of
9 * the License, or (at your option) any later version.
11 * Libgcrypt is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this program; if not, see <http://www.gnu.org/licenses/>.
20 /* Borrowed and adapted slightly for use in JTE by Steve McIntyre
21 * <firstname.lastname@example.org> October 2010 */
23 /* Structure to save state of computation between the single steps. */
24 typedef struct
26 uint32_t h0,h1,h2,h3,h4;
27 uint32_t nblocks;
28 unsigned char buf;
29 int count;
30 } SHA1_CONTEXT;
32 /* Initialize structure containing state of computation. */
33 void sha1_init_ctx (void *context);
35 /* Starting with the result of former calls of this function (or the
36 initialization function update the context for the next inlen bytes
37 starting at inbuf_arg.
38 It is NOT required that inlen is a multiple of 64. */
39 void sha1_write (void *context, const void *inbuf_arg, size_t inlen);
41 /* Process the remaining bytes in the buffer and finish the checksum
42 calculation. */
43 void sha1_finish_ctx(void *context);
45 /* Read the checksum result - 20 bytes. The result is always in little
46 endian byte order, so that a byte-wise output yields to the wanted
47 ASCII representation of the message digest. */
48 unsigned char *sha1_read(void *context);