GDAL

cpl_sha1.h
1/******************************************************************************
2 *
3 * Project: CPL - Common Portability Library
4 * Purpose: Implement SHA1
5 * Author: Even Rouault, even.rouault at spatialys.com
6 *
7 * SHA1 computation coming from Public Domain code at:
8 * https://github.com/B-Con/crypto-algorithms/blob/master/sha1.c
9 * by Brad Conte (brad AT bradconte.com)
10 *
11 ******************************************************************************
12 * Copyright (c) 2017, Even Rouault <even.rouault at spatialys.com>
13 *
14 * SPDX-License-Identifier: MIT
15 ****************************************************************************/
16
17#ifndef CPL_SHA1_INCLUDED_H
18#define CPL_SHA1_INCLUDED_H
19
20#ifndef DOXYGEN_SKIP
21
22#include "cpl_port.h"
23
24#define CPL_SHA1_HASH_SIZE 20 // SHA1 outputs a 20 byte digest
25
26 CPL_C_START
27
28 void CPL_SHA1(const void *data, size_t len, GByte hash[CPL_SHA1_HASH_SIZE]);
29
30/* Not CPL_DLL exported */
31 void CPL_HMAC_SHA1(const void *pKey, size_t nKeyLen, const void *pabyMessage,
32 size_t nMessageLen, GByte abyDigest[CPL_SHA1_HASH_SIZE]);
33
34 CPL_C_END
35
36#endif /* #ifndef DOXYGEN_SKIP */
37
38#endif /* CPL_SHA1_INCLUDED_H */
cpl_port.h
Core portability definitions for CPL.
CPL_C_END
#define CPL_C_END
Macro to end a block of C symbols.
Definition cpl_port.h:289
CPL_C_START
#define CPL_C_START
Macro to start a block of C symbols.
Definition cpl_port.h:285
GByte
unsigned char GByte
Unsigned byte type.
Definition cpl_port.h:175