sha1.h
changeset 52 7f21abb9ff17
parent 0 d7ee4e2ed49d
child 53 ea43dbad123b
equal deleted inserted replaced
51:30d2d7598591 52:7f21abb9ff17
    13 #define	SHA1_DIGEST_LENGTH		20
    13 #define	SHA1_DIGEST_LENGTH		20
    14 
    14 
    15 #include <stdint.h>
    15 #include <stdint.h>
    16 
    16 
    17 typedef struct {
    17 typedef struct {
    18 	u_int32_t	state[5];
    18 	uint32_t	state[5];
    19 	u_int64_t	count;
    19 	uint64_t	count;
    20 	unsigned char	buffer[SHA1_BLOCK_LENGTH];
    20 	uint8_t	buffer[SHA1_BLOCK_LENGTH];
    21 } SHA1_CTX;
    21 } SHA1_CTX;
    22   
    22   
    23 void SHA1Init(SHA1_CTX * context);
    23 void SHA1Init(SHA1_CTX * context);
    24 void SHA1Transform(u_int32_t state[5], const unsigned char buffer[SHA1_BLOCK_LENGTH]);
    24 void SHA1Transform(uint32_t state[5], const uint8_t buffer[SHA1_BLOCK_LENGTH]);
    25 void SHA1Update(SHA1_CTX *context, const unsigned char *data, unsigned int len);
    25 void SHA1Update(SHA1_CTX *context, const uint8_t *data, const uint32_t len);
    26 void SHA1Final(unsigned char digest[SHA1_DIGEST_LENGTH], SHA1_CTX *context);
    26 void SHA1Final(uint8_t digest[SHA1_DIGEST_LENGTH], SHA1_CTX *context);
    27 
    27 
    28 #endif /* _SHA1_H_ */
    28 #endif /* _SHA1_H_ */