Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #ifndef _SYS_SHA1_H_
00012 #define _SYS_SHA1_H_
00013
00014 #include "../defs.h"
00015
00016 typedef struct {
00017 uint32_t state[5];
00018 uint32_t count[2];
00019 uint8_t buffer[64];
00020 } SHA1_CTX;
00021
00022 #ifdef RUBY
00023
00024 #define SHA1_Transform rb_Digest_SHA1_Transform
00025 #define SHA1_Init rb_Digest_SHA1_Init
00026 #define SHA1_Update rb_Digest_SHA1_Update
00027 #define SHA1_Finish rb_Digest_SHA1_Finish
00028 #endif
00029
00030 void SHA1_Transform _((uint32_t state[5], const uint8_t buffer[64]));
00031 void SHA1_Init _((SHA1_CTX *context));
00032 void SHA1_Update _((SHA1_CTX *context, const uint8_t *data, size_t len));
00033 void SHA1_Finish _((SHA1_CTX *context, uint8_t digest[20]));
00034
00035 #define SHA1_BLOCK_LENGTH 64
00036 #define SHA1_DIGEST_LENGTH 20
00037 #define SHA1_DIGEST_STRING_LENGTH (SHA1_DIGEST_LENGTH * 2 + 1)
00038
00039 #endif
00040