- fix Building without Nagra not possible at Nagra_Merlin https://trac.streamboard...
[oscam.git] / cscrypt / sha1.h
blobe5c8461880ec8ba796dbedd86d68541e20bfad9a
1 #if defined(WITH_SSL) || defined(WITH_LIBCRYPTO)
2 # include <openssl/sha.h>
3 #else
4 /* public api for steve reid's public domain SHA-1 implementation */
5 /* this file is in the public domain */
7 #ifndef __SHA1_H
8 #define __SHA1_H
10 #include <sys/types.h>
11 #include <stdint.h>
13 typedef struct
15 uint32_t state[5];
16 uint32_t count[2];
17 uint8_t buffer[64];
18 } SHA_CTX;
20 #define SHA_DIGEST_LENGTH 20
22 void SHA1_Transform(uint32_t state[5], const uint8_t buffer[64]);
24 void SHA1_Init(SHA_CTX *context);
25 void SHA1_Update(SHA_CTX *context, const uint8_t *data, const size_t len);
26 void SHA1_Final(uint8_t digest[SHA_DIGEST_LENGTH], SHA_CTX *context);
28 #endif /* __SHA1_H */
30 #endif