diff options
| author | Andy Fiddaman <omnios@citrus-it.co.uk> | 2020-12-27 17:47:37 +0000 |
|---|---|---|
| committer | Andy Fiddaman <omnios@citrus-it.co.uk> | 2021-01-30 17:13:33 +0000 |
| commit | b30d193948be5a7794d7ae3ba0ed9c2f72c88e0f (patch) | |
| tree | 6a37e590faffb9bb9af66887de645c546445036c /usr/src/lib/libsum/common/sum-ast4.c | |
| parent | df36e06d12cbf655ddf22339ef8c39fa2b83ebf8 (diff) | |
| download | illumos-joyent-b30d193948be5a7794d7ae3ba0ed9c2f72c88e0f.tar.gz | |
13405 ksh93 update to 2012-08-01
13434 sh: mishandles backslash as last character of a block of input
11750 ksh mkdir builtin doesn't honor special file permissions
9199 ksh93 builtin *grep -v mishandles blank lines, blows up libgcrypt-config
6756 sh (and ksh) have issues with ${1+"$@"}
6520 ksh: sleep could wait forever
4860 ksh93: core in printf
3791 /bin/sh's builtin 'rm' busted: 'rm -f' without arguments returns error
1047 ksh overwrites child core files
880 ksh93 coredumps on 'unset'
499 "interrupted system call" when using "tee" builtin in ksh
Reviewed by: Robert Mustacchi <rm@fingolfin.org>
Reviewed by: Hans Rosenfeld <rosenfeld@grumpf.hope-2000.org>
Reviewed by: Dominik Hassler <hadfl@omnios.org>
Approved by: Rich Lowe <richlowe@richlowe.net>
Diffstat (limited to 'usr/src/lib/libsum/common/sum-ast4.c')
| -rw-r--r-- | usr/src/lib/libsum/common/sum-ast4.c | 120 |
1 files changed, 0 insertions, 120 deletions
diff --git a/usr/src/lib/libsum/common/sum-ast4.c b/usr/src/lib/libsum/common/sum-ast4.c deleted file mode 100644 index 1285b765de..0000000000 --- a/usr/src/lib/libsum/common/sum-ast4.c +++ /dev/null @@ -1,120 +0,0 @@ -/*********************************************************************** -* * -* This software is part of the ast package * -* Copyright (c) 1996-2010 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 * -* http://www.opensource.org/licenses/cpl1.0.txt * -* (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9) * -* * -* Information and Software Systems Research * -* AT&T Research * -* Florham Park NJ * -* * -* Glenn Fowler <gsf@research.att.com> * -* * -***********************************************************************/ -#pragma prototyped - -/* - * ast4 - */ - -#define ast4_description \ - "The \bast\b 128 bit PRNG hash generated by catenating 4 separate 32 \ - bit PNRG hashes. The block count is not printed." -#define ast4_options 0 -#define ast4_match "ast4|32x4|tw" -#define ast4_done long_done -#define ast4_scale 0 - -typedef struct Ast4_sum_s -{ - uint32_t sum0; - uint32_t sum1; - uint32_t sum2; - uint32_t sum3; -} Ast4_sum_t; - -typedef struct Ast4_s -{ - _SUM_PUBLIC_ - _SUM_PRIVATE_ - Ast4_sum_t cur; - Ast4_sum_t tot; - unsigned char buf[sizeof(Ast4_sum_t)]; -} Ast4_t; - -static int -ast4_init(Sum_t* p) -{ - register Ast4_t* a = (Ast4_t*)p; - - a->tot.sum0 ^= a->cur.sum0; - a->cur.sum0 = 0; - a->tot.sum1 ^= a->cur.sum1; - a->cur.sum1 = 0; - a->tot.sum2 ^= a->cur.sum2; - a->cur.sum2 = 0; - a->tot.sum3 ^= a->cur.sum3; - a->cur.sum3 = 0; - return 0; -} - -static Sum_t* -ast4_open(const Method_t* method, const char* name) -{ - Ast4_t* p; - - if (p = newof(0, Ast4_t, 1, 0)) - { - p->method = (Method_t*)method; - p->name = name; - } - return (Sum_t*)p; -} - -static int -ast4_block(Sum_t* p, const void* s, size_t n) -{ - register Ast4_sum_t* a = &((Ast4_t*)p)->cur; - register unsigned char* b = (unsigned char*)s; - register unsigned char* e = b + n; - register int c; - - while (b < e) - { - c = *b++; - a->sum0 = a->sum0 * 0x63c63cd9 + 0x9c39c33d + c; - a->sum1 = a->sum1 * 0x00000011 + 0x00017cfb + c; - a->sum2 = a->sum2 * 0x12345679 + 0x3ade68b1 + c; - a->sum3 = a->sum3 * 0xf1eac01d + 0xcafe10af + c; - } - return 0; -} - -static int -ast4_print(Sum_t* p, Sfio_t* sp, int flags, size_t scale) -{ - register Ast4_sum_t* a; - - a = (flags & SUM_TOTAL) ? &((Ast4_t*)p)->tot : &((Ast4_t*)p)->cur; - sfprintf(sp, "%06..64u%06..64u%06..64u%06..64u", a->sum0, a->sum1, a->sum2, a->sum3); - return 0; -} - -static int -ast4_data(Sum_t* p, Sumdata_t* data) -{ - data->size = sizeof(((Ast4_t*)p)->cur); - data->num = 0; -#if _ast_intswap - swapmem(_ast_intswap, data->buf = ((Ast4_t*)p)->buf, &((Ast4_t*)p)->cur, sizeof(((Ast4_t*)p)->cur)); -#else - data->buf = &((Ast4_t*)p)->cur; -#endif - return 0; -} |
