X-Git-Url: https://git.distorted.org.uk/u/mdw/catacomb/blobdiff_plain/b817bfc642225b8c3c0b6a7e42d1fb949b61a606..1d6d3b01cb40e0cfaeb816c87c513695aea0816a:/square.c diff --git a/square.c b/square.c index 7bdcfd8..6ed8d86 100644 --- a/square.c +++ b/square.c @@ -7,7 +7,7 @@ * (c) 2000 Straylight/Edgeware */ -/*----- Licensing notice --------------------------------------------------* +/*----- Licensing notice --------------------------------------------------* * * This file is part of Catacomb. * @@ -15,12 +15,12 @@ * it under the terms of the GNU Library General Public License as * published by the Free Software Foundation; either version 2 of the * License, or (at your option) any later version. - * + * * Catacomb is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Library General Public License for more details. - * + * * You should have received a copy of the GNU Library General Public * License along with Catacomb; if not, write to the Free * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, @@ -107,7 +107,7 @@ void square_init(square_ctx *k, const void *buf, size_t sz) for (i = 0; i < nr * 4; i++) { uint32 w = kk[i]; - k->w[i] = (U[0][U8(w >> 0)] ^ U[1][U8(w >> 8)] ^ + k->w[i] = (U[0][U8(w >> 0)] ^ U[1][U8(w >> 8)] ^ U[2][U8(w >> 16)] ^ U[3][U8(w >> 24)]); } for (; i < nw; i++) @@ -137,7 +137,7 @@ void square_init(square_ctx *k, const void *buf, size_t sz) */ #define SUB(s, sh, a, b, c, d) \ - (s[U8((a) >> sh)] << 0 | s[U8((b) >> sh)] << 8 | \ + (s[U8((a) >> sh)] << 0 | s[U8((b) >> sh)] << 8 | \ s[U8((c) >> sh)] << 16 | s[U8((d) >> sh)] << 24) #define MIX(t, sh, a, b, c, d) \ @@ -145,8 +145,8 @@ void square_init(square_ctx *k, const void *buf, size_t sz) t[2][U8((c) >> sh)] ^ t[3][U8((d) >> sh)]) #define DO(what, t, aa, bb, cc, dd, a, b, c, d, w) do { \ - aa = what(t, 0, a, b, c, d) ^ *w++; \ - bb = what(t, 8, a, b, c, d) ^ *w++; \ + aa = what(t, 0, a, b, c, d) ^ *w++; \ + bb = what(t, 8, a, b, c, d) ^ *w++; \ cc = what(t, 16, a, b, c, d) ^ *w++; \ dd = what(t, 24, a, b, c, d) ^ *w++; \ } while (0) @@ -155,7 +155,7 @@ void square_eblk(const square_ctx *k, const uint32 *s, uint32 *dst) { uint32 a = s[0], b = s[1], c = s[2], d = s[3]; uint32 aa, bb, cc, dd; - uint32 *w = k->w; + const uint32 *w = k->w; a ^= *w++; b ^= *w++; c ^= *w++; d ^= *w++; @@ -175,7 +175,7 @@ void square_dblk(const square_ctx *k, const uint32 *s, uint32 *dst) { uint32 a = s[0], b = s[1], c = s[2], d = s[3]; uint32 aa, bb, cc, dd; - uint32 *w = k->wi; + const uint32 *w = k->wi; a ^= *w++; b ^= *w++; c ^= *w++; d ^= *w++;