mirror of
https://github.com/postgres/postgres.git
synced 2025-12-24 06:01:07 +03:00
The KAME files md5.* and sha1.* have the following changelog
entry: ---------------------------- revision 1.2 date: 2000/12/04 01:20:38; author: tgl; state: Exp; lines: +18 -18 Eliminate some of the more blatant platform-dependencies ... it builds here now, anyway ... ---------------------------- Which basically changes u_int*_t -> uint*_t, so now it does not compile neither under Debian 2.2 nor under NetBSD 1.5 which is platform independent<B8> all right. Also it replaces $KAME$ with $Id$ which is Bad Thing. PostgreSQL Id should be added as a separate line so the file history could be seen. So here is patch: * changes uint*_t -> uint*. I guess that was the original intention * adds uint64 type to include/c.h because its needed [somebody should check if I did it right] * adds back KAME Id, because KAME is the master repository * removes stupid c++ comments in pgcrypto.c * removes <sys/types.h> from the code, its not needed -- marko Marko Kreen
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
/* $Id: sha1.c,v 1.2 2000/12/04 01:20:38 tgl Exp $ */
|
||||
/* $Id: sha1.c,v 1.3 2001/01/09 16:07:13 momjian Exp $ */
|
||||
/* $KAME: sha1.c,v 1.3 2000/02/22 14:01:18 itojun Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
|
||||
@@ -35,7 +36,6 @@
|
||||
*/
|
||||
|
||||
#include <postgres.h>
|
||||
#include "pgcrypto.h"
|
||||
|
||||
#include "sha1.h"
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
#ifndef unsupported
|
||||
|
||||
/* constant table */
|
||||
static uint32_t _K[] = { 0x5a827999, 0x6ed9eba1, 0x8f1bbcdc, 0xca62c1d6 };
|
||||
static uint32 _K[] = { 0x5a827999, 0x6ed9eba1, 0x8f1bbcdc, 0xca62c1d6 };
|
||||
#define K(t) _K[(t) / 20]
|
||||
|
||||
#define F0(b, c, d) (((b) & (c)) | ((~(b)) & (d)))
|
||||
@@ -87,9 +87,9 @@ static void
|
||||
sha1_step(ctxt)
|
||||
struct sha1_ctxt *ctxt;
|
||||
{
|
||||
uint32_t a, b, c, d, e;
|
||||
uint32 a, b, c, d, e;
|
||||
size_t t, s;
|
||||
uint32_t tmp;
|
||||
uint32 tmp;
|
||||
|
||||
#if BYTE_ORDER == LITTLE_ENDIAN
|
||||
struct sha1_ctxt tctxt;
|
||||
@@ -221,13 +221,13 @@ sha1_loop(ctxt, input0, len)
|
||||
const caddr_t input0;
|
||||
size_t len;
|
||||
{
|
||||
const uint8_t *input;
|
||||
const uint8 *input;
|
||||
size_t gaplen;
|
||||
size_t gapstart;
|
||||
size_t off;
|
||||
size_t copysiz;
|
||||
|
||||
input = (const uint8_t *)input0;
|
||||
input = (const uint8 *)input0;
|
||||
off = 0;
|
||||
|
||||
while (off < len) {
|
||||
@@ -250,9 +250,9 @@ sha1_result(ctxt, digest0)
|
||||
struct sha1_ctxt *ctxt;
|
||||
caddr_t digest0;
|
||||
{
|
||||
uint8_t *digest;
|
||||
uint8 *digest;
|
||||
|
||||
digest = (uint8_t *)digest0;
|
||||
digest = (uint8 *)digest0;
|
||||
sha1_pad(ctxt);
|
||||
#if BYTE_ORDER == BIG_ENDIAN
|
||||
bcopy(&ctxt->h.b8[0], digest, 20);
|
||||
|
||||
Reference in New Issue
Block a user