File: sha1.h

package info (click to toggle)
moarvm 2022.12%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 42,724 kB
  • sloc: cpp: 378,682; ansic: 288,257; perl: 8,229; java: 2,682; python: 1,287; makefile: 820; sh: 292
file content (28 lines) | stat: -rw-r--r-- 638 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/* public api for steve reid's public domain SHA-1 implementation */
/* this file is in the public domain */

#ifndef __SHA1_H
#define __SHA1_H

#ifdef __cplusplus
extern "C" {
#endif

typedef struct {
    unsigned int  state[5];
    unsigned int  count[2];
    unsigned char buffer[64];
} SHA1Context;

#define SHA1_DIGEST_SIZE 20

void SHA1Init(SHA1Context* context);
void SHA1Update(SHA1Context* context, const unsigned char* data, const size_t len);
void SHA1_Digest(SHA1Context* context, unsigned char digest[SHA1_DIGEST_SIZE]);
void SHA1Final(SHA1Context* context, char *output);

#ifdef __cplusplus
}
#endif

#endif /* __SHA1_H */