OGR
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  * Permission is hereby granted, free of charge, to any person obtaining a
15  * copy of this software and associated documentation files (the "Software"),
16  * to deal in the Software without restriction, including without limitation
17  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
18  * and/or sell copies of the Software, and to permit persons to whom the
19  * Software is furnished to do so, subject to the following conditions:
20  *
21  * The above copyright notice and this permission notice shall be included
22  * in all copies or substantial portions of the Software.
23  *
24  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
25  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
26  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
27  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
28  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
29  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
30  * DEALINGS IN THE SOFTWARE.
31  ****************************************************************************/
32 
33 #ifndef CPL_SHA1_INCLUDED_H
34 #define CPL_SHA1_INCLUDED_H
35 
36 #ifndef DOXYGEN_SKIP
37 
38 #include "cpl_port.h"
39 
40 #define CPL_SHA1_HASH_SIZE 20 // SHA1 outputs a 20 byte digest
41 
43 
44 /* Not CPL_DLL exported */
45 void CPL_HMAC_SHA1(const void *pKey, size_t nKeyLen,
46  const void *pabyMessage, size_t nMessageLen,
47  GByte abyDigest[CPL_SHA1_HASH_SIZE]);
48 
50 
51 #endif /* #ifndef DOXYGEN_SKIP */
52 
53 #endif /* CPL_SHA1_INCLUDED_H */
CPLRecodeFromWChar
char * CPLRecodeFromWChar(const wchar_t *pwszSource, const char *pszSrcEncoding, const char *pszDstEncoding)
Definition: cpl_recode.cpp:149
GByte
unsigned char GByte
Definition: cpl_port.h:215
CPL_ENC_UCS4
#define CPL_ENC_UCS4
Definition: cpl_string.h:271
CPL_ENC_UTF16
#define CPL_ENC_UTF16
Definition: cpl_string.h:267
cpl_error.h
CPLIsUTF8
int CPLIsUTF8(const char *pabyData, int nLen)
Definition: cpl_recode.cpp:251
CPLCalloc
void * CPLCalloc(size_t, size_t)
Definition: cpl_conv.cpp:138
CPL_ENC_ISO8859_1
#define CPL_ENC_ISO8859_1
Definition: cpl_string.h:275
CPLRealloc
void * CPLRealloc(void *, size_t)
Definition: cpl_conv.cpp:225
CPL_ENC_ASCII
#define CPL_ENC_ASCII
Definition: cpl_string.h:273
EQUAL
#define EQUAL(a, b)
Definition: cpl_port.h:569
CPLAssert
#define CPLAssert(expr)
Definition: cpl_error.h:186
CPL_C_START
#define CPL_C_START
Definition: cpl_port.h:337
CPLRecodeToWChar
wchar_t * CPLRecodeToWChar(const char *pszSource, const char *pszSrcEncoding, const char *pszDstEncoding)
Definition: cpl_recode.cpp:208
GUIntBig
unsigned long long GUIntBig
Definition: cpl_port.h:251
CPL_ENC_UTF8
#define CPL_ENC_UTF8
Definition: cpl_string.h:265
CPL_C_END
#define CPL_C_END
Definition: cpl_port.h:339
STARTS_WITH
#define STARTS_WITH(a, b)
Definition: cpl_port.h:578
CPLMalloc
void * CPLMalloc(size_t)
Definition: cpl_conv.cpp:168
cpl_conv.h
cpl_string.h
CPLRecode
char * CPLRecode(const char *pszSource, const char *pszSrcEncoding, const char *pszDstEncoding)
Definition: cpl_recode.cpp:81
CPLStrlenUTF8
int CPLStrlenUTF8(const char *pszUTF8Str)
Definition: cpl_recode.cpp:363
CPLError
void CPLError(CPLErr eErrClass, CPLErrorNum err_no, const char *fmt,...)
Definition: cpl_error.cpp:308
CPLEncodingCharSize
int CPLEncodingCharSize(const char *pszEncoding)
Definition: cpl_recode.cpp:318
end
OGRLayer::FeatureIterator end(OGRLayer *poLayer)
Definition: ogrsf_frmts.h:292
CPL_ENC_UCS2
#define CPL_ENC_UCS2
Definition: cpl_string.h:269
cpl_port.h
CPLForceToASCII
char * CPLForceToASCII(const char *pabyData, int nLen, char chReplacementChar)
Definition: cpl_recode.cpp:276
CPLStrdup
char * CPLStrdup(const char *)
Definition: cpl_conv.cpp:293
CPL_SHA1Context
Definition: cpl_sha1.cpp:39
CPLFree
#define CPLFree
Definition: cpl_conv.h:81
GInt32
int GInt32
Definition: cpl_port.h:205
CPL_RETURNS_NONNULL
#define CPL_RETURNS_NONNULL
Definition: cpl_port.h:972
STARTS_WITH_CI
#define STARTS_WITH_CI(a, b)
Definition: cpl_port.h:580
CPLE_AppDefined
#define CPLE_AppDefined
Definition: cpl_error.h:99
GUInt32
unsigned int GUInt32
Definition: cpl_port.h:207

Generated for GDAL by doxygen 1.8.20.