~ubuntu-branches/ubuntu/hardy/ruby1.8/hardy-updates

« back to all changes in this revision

Viewing changes to ext/digest/sha1/sha1.h

  • Committer: Bazaar Package Importer
  • Author(s): akira yamada
  • Date: 2007-03-13 22:11:58 UTC
  • mfrom: (1.1.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20070313221158-h3oql37brlaf2go2
Tags: 1.8.6-1
* new upstream version, 1.8.6.
* libruby1.8 conflicts with libopenssl-ruby1.8 (< 1.8.6) (closes: #410018)
* changed packaging style to cdbs from dbs.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*      $NetBSD: sha1.h,v 1.2 1998/05/29 22:55:44 thorpej Exp $ */
 
2
/*      $RoughId: sha1.h,v 1.3 2002/02/24 08:14:32 knu Exp $    */
 
3
/*      $Id: sha1.h 11708 2007-02-12 23:01:19Z shyouhei $       */
 
4
 
 
5
/*
 
6
 * SHA-1 in C
 
7
 * By Steve Reid <steve@edmweb.com>
 
8
 * 100% Public Domain
 
9
 */
 
10
 
 
11
#ifndef _SYS_SHA1_H_
 
12
#define _SYS_SHA1_H_
 
13
 
 
14
#include "defs.h"
 
15
 
 
16
typedef struct {
 
17
        uint32_t state[5];
 
18
        uint32_t count[2];  
 
19
        uint8_t buffer[64];
 
20
} SHA1_CTX;
 
21
 
 
22
#ifdef RUBY
 
23
/* avoid name clash */
 
24
#define SHA1_Transform  rb_Digest_SHA1_Transform
 
25
#define SHA1_Init       rb_Digest_SHA1_Init
 
26
#define SHA1_Update     rb_Digest_SHA1_Update
 
27
#define SHA1_Finish     rb_Digest_SHA1_Finish
 
28
#endif
 
29
 
 
30
void    SHA1_Transform _((uint32_t state[5], const uint8_t buffer[64]));
 
31
void    SHA1_Init _((SHA1_CTX *context));
 
32
void    SHA1_Update _((SHA1_CTX *context, const uint8_t *data, size_t len));
 
33
void    SHA1_Finish _((SHA1_CTX *context, uint8_t digest[20]));
 
34
 
 
35
#define SHA1_BLOCK_LENGTH               64
 
36
#define SHA1_DIGEST_LENGTH              20
 
37
#define SHA1_DIGEST_STRING_LENGTH       (SHA1_DIGEST_LENGTH * 2 + 1)
 
38
  
 
39
#endif /* _SYS_SHA1_H_ */