1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2024-12-05 13:24:11 +01:00
LibrePilot/flight/libraries/inc/sha1.h

38 lines
879 B
C
Raw Normal View History

/* $NetBSD: sha1.h,v 1.14 2009/11/06 20:31:19 joerg Exp $ */
/*
* SHA-1 in C
* By Steve Reid <steve@edmweb.com>
* 100% Public Domain
*/
#ifndef _SYS_SHA1_H_
2015-02-05 01:42:32 +01:00
#define _SYS_SHA1_H_
#include <sys/cdefs.h>
#include <sys/types.h>
2015-02-05 01:42:32 +01:00
#define SHA1_DIGEST_LENGTH 20
#define SHA1_DIGEST_STRING_LENGTH 41
typedef struct {
2015-02-05 01:42:32 +01:00
uint32_t state[5];
uint32_t count[2];
uint8_t buffer[64];
} SHA1_CTX;
__BEGIN_DECLS
2015-02-05 01:42:32 +01:00
void SHA1Transform(uint32_t[5], const uint8_t[64]);
void SHA1Init(SHA1_CTX *);
void SHA1Update(SHA1_CTX *, const uint8_t *, unsigned int);
void SHA1Final(uint8_t[SHA1_DIGEST_LENGTH], SHA1_CTX *);
#ifndef _KERNEL
2015-02-05 01:42:32 +01:00
char *SHA1End(SHA1_CTX *, char *);
char *SHA1FileChunk(const char *, char *, off_t, off_t);
char *SHA1File(const char *, char *);
char *SHA1Data(const uint8_t *, size_t, char *);
#endif /* _KERNEL */
__END_DECLS
#endif /* _SYS_SHA1_H_ */