sha1.h
author Ryan C. Gordon <icculus@icculus.org>
Wed, 14 Jun 2017 00:27:40 -0400
changeset 51 30d2d7598591
parent 0 d7ee4e2ed49d
child 52 7f21abb9ff17
permissions -rw-r--r--
Merge gtkui branch to default.
icculus@0
     1
/*	$OpenBSD: sha1.h,v 1.5 2007/09/10 22:19:42 henric Exp $	*/
icculus@0
     2
icculus@0
     3
/*
icculus@0
     4
 * SHA-1 in C
icculus@0
     5
 * By Steve Reid <steve@edmweb.com>
icculus@0
     6
 * 100% Public Domain
icculus@0
     7
 */
icculus@0
     8
icculus@0
     9
#ifndef _SHA1_H_
icculus@0
    10
#define _SHA1_H_
icculus@0
    11
icculus@0
    12
#define	SHA1_BLOCK_LENGTH		64
icculus@0
    13
#define	SHA1_DIGEST_LENGTH		20
icculus@0
    14
icculus@0
    15
#include <stdint.h>
icculus@0
    16
icculus@0
    17
typedef struct {
icculus@0
    18
	u_int32_t	state[5];
icculus@0
    19
	u_int64_t	count;
icculus@0
    20
	unsigned char	buffer[SHA1_BLOCK_LENGTH];
icculus@0
    21
} SHA1_CTX;
icculus@0
    22
  
icculus@0
    23
void SHA1Init(SHA1_CTX * context);
icculus@0
    24
void SHA1Transform(u_int32_t state[5], const unsigned char buffer[SHA1_BLOCK_LENGTH]);
icculus@0
    25
void SHA1Update(SHA1_CTX *context, const unsigned char *data, unsigned int len);
icculus@0
    26
void SHA1Final(unsigned char digest[SHA1_DIGEST_LENGTH], SHA1_CTX *context);
icculus@0
    27
icculus@0
    28
#endif /* _SHA1_H_ */