11dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project/*	$NetBSD: sha1.h,v 1.13 2005/12/26 18:41:36 perry Exp $	*/
21dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project
31dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project/*
41dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project * SHA-1 in C
51dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project * By Steve Reid <steve@edmweb.com>
61dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project * 100% Public Domain
71dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project */
81dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project
91dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#ifndef _SYS_SHA1_H_
101dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	_SYS_SHA1_H_
111dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project
121dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#include <sys/cdefs.h>
131dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#include <sys/types.h>
141dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project
151dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define SHA1_DIGEST_LENGTH		20
161dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define SHA1_DIGEST_STRING_LENGTH	41
171dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project
181dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Projecttypedef struct {
191dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project	uint32_t state[5];
201dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project	uint32_t count[2];
211dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project	u_char buffer[64];
221dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project} SHA1_CTX;
231dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project
241dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project__BEGIN_DECLS
251dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Projectvoid	SHA1Transform(uint32_t[5], const u_char[64]);
261dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Projectvoid	SHA1Init(SHA1_CTX *);
271dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Projectvoid	SHA1Update(SHA1_CTX *, const u_char *, u_int);
281dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Projectvoid	SHA1Final(u_char[SHA1_DIGEST_LENGTH], SHA1_CTX *);
291dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project__END_DECLS
301dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project
311dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#endif /* _SYS_SHA1_H_ */
32