ptorrent / sha1.h

#ifndef SHA1_H
#define SHA1_H

SHA-1 in C
By Steve Reid <>
100% Public Domain

23 Apr 2001 version from
Modified slightly to take advantage of autoconf.
See sha1.c for full history comments.

#ifdef __cplusplus
extern "C" {

#include <inttypes.h>

typedef struct {
    uint32_t state[5];
    uint32_t count[2];
    unsigned char buffer[64];

void SHA1_Transform(uint32_t state[5], unsigned char buffer[64]);
void SHA1_Init(SHA_CTX* context);
void SHA1_Update(SHA_CTX* context, unsigned char* data, uint32_t len); /* JHB */
void SHA1_Final(unsigned char digest[20], SHA_CTX* context);

#ifdef __cplusplus