|
GDAL
|
00001 /****************************************************************************** 00002 * 00003 * Project: CPL - Common Portability Library 00004 * Purpose: Implement SHA1 00005 * Author: Even Rouault, even.rouault at spatialys.com 00006 * 00007 * SHA1 computation coming from Public Domain code at: 00008 * https://github.com/B-Con/crypto-algorithms/blob/master/sha1.c 00009 * by Brad Conte (brad AT bradconte.com) 00010 * 00011 ****************************************************************************** 00012 * Copyright (c) 2017, Even Rouault <even.rouault at spatialys.com> 00013 * 00014 * Permission is hereby granted, free of charge, to any person obtaining a 00015 * copy of this software and associated documentation files (the "Software"), 00016 * to deal in the Software without restriction, including without limitation 00017 * the rights to use, copy, modify, merge, publish, distribute, sublicense, 00018 * and/or sell copies of the Software, and to permit persons to whom the 00019 * Software is furnished to do so, subject to the following conditions: 00020 * 00021 * The above copyright notice and this permission notice shall be included 00022 * in all copies or substantial portions of the Software. 00023 * 00024 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 00025 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 00026 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 00027 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 00028 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 00029 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 00030 * DEALINGS IN THE SOFTWARE. 00031 ****************************************************************************/ 00032 00033 #ifndef CPL_SHA1_INCLUDED_H 00034 #define CPL_SHA1_INCLUDED_H 00035 00036 #ifndef DOXYGEN_SKIP 00037 00038 #include "cpl_port.h" 00039 00040 #define CPL_SHA1_HASH_SIZE 20 // SHA1 outputs a 20 byte digest 00041 00042 CPL_C_START 00043 00044 /* Not CPL_DLL exported */ 00045 void CPL_HMAC_SHA1(const void *pKey, size_t nKeyLen, 00046 const void *pabyMessage, size_t nMessageLen, 00047 GByte abyDigest[CPL_SHA1_HASH_SIZE]); 00048 00049 CPL_C_END 00050 00051 #endif /* #ifndef DOXYGEN_SKIP */ 00052 00053 #endif /* CPL_SHA1_INCLUDED_H */
1.7.6.1.