OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [libjava/] [gnu/] [gcj/] [io/] [shs.h] - Blame information for rev 756

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 756 jeremybenn
/* --------------------------------- SHS.H ------------------------------- */
2
 
3
/*
4
 * NIST proposed Secure Hash Standard.
5
 *
6
 * Written 2 September 1992, Peter C. Gutmann.
7
 * This implementation placed in the public domain.
8
 *
9
 * Comments to pgut1@cs.aukuni.ac.nz
10
 */
11
 
12
/* Useful defines/typedefs */
13
 
14
#ifndef SHS_H
15
#define SHS_H
16
 
17
#include<config.h>
18
#if HAVE_INTTYPES_H
19
# include <inttypes.h>
20
#else
21
# if HAVE_STDINT_H
22
#  include <stdint.h>
23
# else
24
typedef unsigned int uint8_t __attribute__((mode(QI)));
25
/* This is a blatant hack: on Solaris 2.5, pthread.h defines uint32_t
26
   in pthread.h, which we sometimes include.  We protect our
27
   definition the same way Solaris 2.5 does, to avoid redefining it.  */
28
#  ifndef _UINT32_T
29
typedef unsigned int uint32_t __attribute__((mode(SI)));
30
#  endif
31
# endif
32
#endif
33
 
34
#define PROTO
35
 
36
/* The SHS block size and message digest sizes, in bytes */
37
 
38
#define SHS_BLOCKSIZE   64
39
#define SHS_DIGESTSIZE  20
40
 
41
/* The structure for storing SHS info */
42
 
43
typedef struct {
44
       uint32_t digest [5];    /* Message digest */
45
       uint32_t countLo, countHi;      /* 64-bit bit count */
46
       uint32_t data [16];             /* SHS data buffer */
47
} SHS_INFO;
48
 
49
/* Turn off prototypes if requested */
50
#if (defined(NOPROTO) && defined(PROTO))
51
#       undef PROTO
52
#endif
53
 
54
/* Used to remove arguments in function prototypes for non-ANSI C */
55
#ifdef PROTO
56
#       define OF(a) a
57
#else   /* !PROTO */
58
#       define OF(a) ()
59
#endif  /* ?PROTO */
60
 
61
#define local   static
62
 
63
void shsInit OF((SHS_INFO *shsInfo));
64
void shsUpdate OF((SHS_INFO *shsInfo, uint8_t *buffer, int count));
65
void shsFinal OF((SHS_INFO *shsInfo));
66
 
67
#endif

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.