|
Server IP : 142.11.238.133 / Your IP : 216.73.216.76 Web Server : Apache System : Linux dal-shared-72.hostwindsdns.com 4.18.0-513.24.1.lve.1.el8.x86_64 #1 SMP Thu May 9 15:10:09 UTC 2024 x86_64 User : gzvrnpdt ( 1005) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON Directory (0755) : /../../usr/include/ncurses/../ |
| [ Home ] | [ C0mmand ] | [ Upload File ] |
|---|
/* public api for steve reid's public domain SHA-1 implementation */
/* this file is in the public domain */
#ifndef __SHA1_H
#define __SHA1_H
/* SHA1_DIGEST_SIZE must always be visible regardless of OpenSSL. */
#define SHA1_DIGEST_SIZE 20
/*
* When OpenSSL headers are already present, their SHA1_Init/Update/Final
* declarations take precedence. Redeclaring with incompatible signatures
* causes compile errors in consumers (e.g. nginx) that include both
* lscapi.h and OpenSSL. Use OpenSSL's SHA_CTX as an alias so internal
* callers that hold a SHA1_CTX* still work.
*
* Guard macros differ by OpenSSL version:
* OpenSSL 1.1.x -> HEADER_SHA_H
* OpenSSL 3.x -> OPENSSL_SHA_H
*/
#if !defined(OPENSSL_SHA_H) && !defined(HEADER_SHA_H)
#include <stdint.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef struct {
uint32_t state[5];
uint32_t count[2];
uint8_t buffer[64];
} SHA1_CTX;
void SHA1_Init(SHA1_CTX* context);
void SHA1_Update(SHA1_CTX* context, const uint8_t* data, const size_t len);
void SHA1_Final(SHA1_CTX* context, uint8_t digest[SHA1_DIGEST_SIZE]);
#ifdef __cplusplus
}
#endif
#else /* OpenSSL sha.h already included */
/* openssl/sha.h is already loaded; avoid redeclaring SHA1_* with
* incompatible types. Alias SHA1_CTX to OpenSSL's SHA_CTX so any
* code holding a pointer to SHA1_CTX still compiles. */
#include <openssl/sha.h>
typedef SHA_CTX SHA1_CTX;
#endif /* !OPENSSL_SHA_H && !HEADER_SHA_H */
#endif /* __SHA1_H */