/***********************************************************************
* *
* This software is part of the ast package *
* Copyright (c) 1996-2011 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9) *
* *
* Information and Software Systems Research *
* AT&T Research *
* Florham Park NJ *
* *
* Glenn Fowler <gsf@research.att.com> *
* *
***********************************************************************/
#pragma prototyped
/*
* SHA-1 in C
* By Steve Reid <steve@edmweb.com>
* 100% Public Domain
*
* Test Vectors (from FIPS PUB 180-1)
* "abc"
* A9993E36 4706816A BA3E2571 7850C26C 9CD0D89D
* "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq"
* 84983E44 1C3BD26E BAAE4AA1 F95129E5 E54670F1
* A million repetitions of "a"
* 34AA973C D4C4DAA4 F61EEB2B DBAD2731 6534016F
*/
[+(author)?Steve Reid <steve@edmweb.com>]"
#define sha1_scale 0
typedef struct Sha1_s
{
} Sha1_t;
/*
* blk0() and blk() perform the initial expand.
* I got the idea of expanding during the round function from SSLeay
*/
#if _ast_intswap
# define blk0(i) \
#else
#endif
#define blk(i) \
/*
* (R0+R1), R2, R3, R4 are the different operations (rounds) used in SHA1
*/
#define R0(v,w,x,y,z,i) \
w = rol(w, 30);
#define R1(v,w,x,y,z,i) \
w = rol(w, 30);
#define R2(v,w,x,y,z,i) \
w = rol(w, 30);
#define R3(v,w,x,y,z,i) \
w = rol(w, 30);
#define R4(v,w,x,y,z,i) \
w = rol(w, 30);
typedef union {
unsigned char c[64];
unsigned int l[16];
} CHAR64LONG16;
#ifdef __sparc_v9__
static void
{
}
static void
{
}
static void
{
}
static void
{
}
#endif
/*
* Hash a single 512-bit block. This is the core of the algorithm.
*/
static void
uint32_t a, b, c, d, e;
/* Copy sha->state[] to working vars */
a = state[0];
b = state[1];
c = state[2];
d = state[3];
e = state[4];
#ifdef __sparc_v9__
#else
/* 4 rounds of 20 operations each. Loop unrolled. */
#endif
/* Add the working vars back into context.state[] */
state[0] += a;
state[1] += b;
state[2] += c;
state[3] += d;
state[4] += e;
/* Wipe variables */
a = b = c = d = e = 0;
}
static int
{
unsigned int i, j;
if (len) {
j = (j >> 3) & 63;
if ((j + len) > 63) {
j = 0;
} else {
i = 0;
}
}
return 0;
}
static int
{
return 0;
}
static Sum_t*
{
{
}
}
/*
* Add padding and return the message digest.
*/
static const unsigned char final_0 = 0;
static int
{
unsigned int i;
for (i = 0; i < 8; i++) {
/* Endian independent */
finalcount[i] = (unsigned char)
>> ((3 - (i & 3)) * 8)) & 255);
}
/* The next Update should cause a sha1_transform() */
{
}
return 0;
}
static int
{
register unsigned char* d;
register int n;
return 0;
}
static int
{
return 0;
}