Ruby 1.9.2p136(2010-12-25revision30365)

- Main Page
- Modules
- Data Structures
- Files

- File List
- Globals

# ext/digest/sha1/sha1.h

Go to the documentation of this file.

    00001 /*      $NetBSD: sha1.h,v 1.2 1998/05/29 22:55:44 thorpej Exp $ */
    00002 /*      $RoughId: sha1.h,v 1.3 2002/02/24 08:14:32 knu Exp $    */
    00003 /*      $Id: sha1.h 28341 2010-06-16 09:38:14Z knu $    */
    00004
    00005 /*
    00006  * SHA-1 in C
    00007  * By Steve Reid <steve@edmweb.com>
    00008  * 100% Public Domain
    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 /* avoid name clash */
    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 /* _SYS_SHA1_H_ */
    00040