diff options
author | Andrew Bartlett <abartlet@samba.org> | 2006-05-07 04:51:30 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 14:05:39 -0500 |
commit | 835926c87921a0f4186a9331b6e31b2e6f1c0d90 (patch) | |
tree | 1086d806019f4f7a86dc7b0073017a0fb876b6c2 /source4/heimdal/lib/des/sha256.c | |
parent | 7a0b65efce3669643d21a2e209d4bf2626a5e948 (diff) | |
download | samba-835926c87921a0f4186a9331b6e31b2e6f1c0d90.tar.gz samba-835926c87921a0f4186a9331b6e31b2e6f1c0d90.tar.bz2 samba-835926c87921a0f4186a9331b6e31b2e6f1c0d90.zip |
r15481: Update heimdal/ to match current lorikeet-heimdal.
This includes many useful upstream changes, many of which should
reduce warnings in our compile.
It also includes a change to the HDB interface, which removes the need
for Samba4/lorikeet-heimdal to deviate from upstream for hdb_fetch().
The new flags replace the old entry type enum.
(This required the rework in hdb-ldb.c included in this commit)
Andrew Bartlett
(This used to be commit ef5604b87744c89e66e4d845f45b23563754ec05)
Diffstat (limited to 'source4/heimdal/lib/des/sha256.c')
-rw-r--r-- | source4/heimdal/lib/des/sha256.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/source4/heimdal/lib/des/sha256.c b/source4/heimdal/lib/des/sha256.c index 8c12ce504c..58fb92815a 100644 --- a/source4/heimdal/lib/des/sha256.c +++ b/source4/heimdal/lib/des/sha256.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995 - 2001, 2006 Kungliga Tekniska Högskolan + * Copyright (c) 2006 Kungliga Tekniska Högskolan * (Royal Institute of Technology, Stockholm, Sweden). * All rights reserved. * @@ -34,7 +34,7 @@ #ifdef HAVE_CONFIG_H #include "config.h" -RCSID("$Id: sha256.c,v 1.1 2006/04/15 07:53:07 lha Exp $"); +RCSID("$Id: sha256.c,v 1.2 2006/05/05 10:25:37 lha Exp $"); #endif #include "hash.h" @@ -59,7 +59,7 @@ RCSID("$Id: sha256.c,v 1.1 2006/04/15 07:53:07 lha Exp $"); #define G m->counter[6] #define H m->counter[7] -static const u_int32_t constant_256[64] = { +static const uint32_t constant_256[64] = { 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5, 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, @@ -94,10 +94,10 @@ SHA256_Init (SHA256_CTX *m) } static void -calc (SHA256_CTX *m, u_int32_t *in) +calc (SHA256_CTX *m, uint32_t *in) { - u_int32_t AA, BB, CC, DD, EE, FF, GG, HH; - u_int32_t data[64]; + uint32_t AA, BB, CC, DD, EE, FF, GG, HH; + uint32_t data[64]; int i; AA = A; @@ -116,7 +116,7 @@ calc (SHA256_CTX *m, u_int32_t *in) sigma0(data[i-15]) + data[i - 16]; for (i = 0; i < 64; i++) { - u_int32_t T1, T2; + uint32_t T1, T2; T1 = HH + Sigma1(EE) + Ch(EE, FF, GG) + constant_256[i] + data[i]; T2 = Sigma0(AA) + Maj(AA,BB,CC); @@ -146,11 +146,11 @@ calc (SHA256_CTX *m, u_int32_t *in) */ #if !defined(WORDS_BIGENDIAN) || defined(_CRAY) -static inline u_int32_t -swap_u_int32_t (u_int32_t t) +static inline uint32_t +swap_uint32_t (uint32_t t) { #define ROL(x,n) ((x)<<(n))|((x)>>(32-(n))) - u_int32_t temp1, temp2; + uint32_t temp1, temp2; temp1 = cshift(t, 16); temp2 = temp1 >> 8; @@ -186,15 +186,15 @@ SHA256_Update (SHA256_CTX *m, const void *v, size_t len) if(offset == 64){ #if !defined(WORDS_BIGENDIAN) || defined(_CRAY) int i; - u_int32_t current[16]; + uint32_t current[16]; struct x32 *u = (struct x32*)m->save; for(i = 0; i < 8; i++){ - current[2*i+0] = swap_u_int32_t(u[i].a); - current[2*i+1] = swap_u_int32_t(u[i].b); + current[2*i+0] = swap_uint32_t(u[i].a); + current[2*i+1] = swap_uint32_t(u[i].b); } calc(m, current); #else - calc(m, (u_int32_t*)m->save); + calc(m, (uint32_t*)m->save); #endif offset = 0; } |