X-Git-Url: https://git.distorted.org.uk/u/mdw/catacomb/blobdiff_plain/fe6657c961b01ec72e9f35f4c3d96b11b31cf09c..45c0fd363937c6e9b05da04a9167e9912c05ca0c:/rmd160.c diff --git a/rmd160.c b/rmd160.c index 05a2c5d..f481209 100644 --- a/rmd160.c +++ b/rmd160.c @@ -7,7 +7,7 @@ * (c) 1998 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, @@ -103,19 +103,19 @@ void rmd160_compress(rmd160_ctx *ctx, const void *sbuf) F1(e, a, b, c, d, 1, 14); F1(d, e, a, b, c, 2, 15); F1(c, d, e, a, b, 3, 12); - F1(b, c, d, e, a, 4, 5); - F1(a, b, c, d, e, 5, 8); - F1(e, a, b, c, d, 6, 7); - F1(d, e, a, b, c, 7, 9); + F1(b, c, d, e, a, 4, 5); + F1(a, b, c, d, e, 5, 8); + F1(e, a, b, c, d, 6, 7); + F1(d, e, a, b, c, 7, 9); F1(c, d, e, a, b, 8, 11); F1(b, c, d, e, a, 9, 13); F1(a, b, c, d, e, 10, 14); F1(e, a, b, c, d, 11, 15); - F1(d, e, a, b, c, 12, 6); - F1(c, d, e, a, b, 13, 7); - F1(b, c, d, e, a, 14, 9); - F1(a, b, c, d, e, 15, 8); - + F1(d, e, a, b, c, 12, 6); + F1(c, d, e, a, b, 13, 7); + F1(b, c, d, e, a, 14, 9); + F1(a, b, c, d, e, 15, 8); + G1(e, a, b, c, d, 7, 7); G1(d, e, a, b, c, 4, 6); G1(c, d, e, a, b, 13, 8); @@ -132,7 +132,7 @@ void rmd160_compress(rmd160_ctx *ctx, const void *sbuf) G1(b, c, d, e, a, 14, 7); G1(a, b, c, d, e, 11, 13); G1(e, a, b, c, d, 8, 12); - + H1(d, e, a, b, c, 3, 11); H1(c, d, e, a, b, 10, 13); H1(b, c, d, e, a, 14, 6); @@ -149,7 +149,7 @@ void rmd160_compress(rmd160_ctx *ctx, const void *sbuf) H1(a, b, c, d, e, 11, 12); H1(e, a, b, c, d, 5, 7); H1(d, e, a, b, c, 12, 5); - + I1(c, d, e, a, b, 1, 11); I1(b, c, d, e, a, 9, 12); I1(a, b, c, d, e, 11, 14); @@ -166,7 +166,7 @@ void rmd160_compress(rmd160_ctx *ctx, const void *sbuf) I1(e, a, b, c, d, 5, 6); I1(d, e, a, b, c, 6, 5); I1(c, d, e, a, b, 2, 12); - + J1(b, c, d, e, a, 4, 9); J1(a, b, c, d, e, 0, 15); J1(e, a, b, c, d, 5, 5); @@ -202,7 +202,7 @@ void rmd160_compress(rmd160_ctx *ctx, const void *sbuf) F2(C, D, E, A, B, 10, 14); F2(B, C, D, E, A, 3, 12); F2(A, B, C, D, E, 12, 6); - + G2(E, A, B, C, D, 6, 9); G2(D, E, A, B, C, 11, 13); G2(C, D, E, A, B, 3, 15); @@ -219,7 +219,7 @@ void rmd160_compress(rmd160_ctx *ctx, const void *sbuf) G2(B, C, D, E, A, 9, 15); G2(A, B, C, D, E, 1, 13); G2(E, A, B, C, D, 2, 11); - + H2(D, E, A, B, C, 15, 9); H2(C, D, E, A, B, 5, 7); H2(B, C, D, E, A, 1, 15); @@ -236,7 +236,7 @@ void rmd160_compress(rmd160_ctx *ctx, const void *sbuf) H2(A, B, C, D, E, 0, 13); H2(E, A, B, C, D, 4, 7); H2(D, E, A, B, C, 13, 5); - + I2(C, D, E, A, B, 8, 15); I2(B, C, D, E, A, 6, 5); I2(A, B, C, D, E, 4, 8); @@ -253,7 +253,7 @@ void rmd160_compress(rmd160_ctx *ctx, const void *sbuf) I2(E, A, B, C, D, 7, 5); I2(D, E, A, B, C, 10, 15); I2(C, D, E, A, B, 14, 8); - + J2(B, C, D, E, A, 12, 8); J2(A, B, C, D, E, 15, 5); J2(E, A, B, C, D, 10, 12); @@ -320,9 +320,9 @@ void rmd160_init(rmd160_ctx *ctx) void rmd160_set(rmd160_ctx *ctx, const void *buf, unsigned long count) { const octet *p = buf; - ctx->a = LOAD32_L(p + 0); - ctx->b = LOAD32_L(p + 4); - ctx->c = LOAD32_L(p + 8); + ctx->a = LOAD32_L(p + 0); + ctx->b = LOAD32_L(p + 4); + ctx->c = LOAD32_L(p + 8); ctx->d = LOAD32_L(p + 12); ctx->e = LOAD32_L(p + 16); ctx->off = 0; @@ -361,9 +361,9 @@ void rmd160_done(rmd160_ctx *ctx, void *hash) { octet *p = hash; HASH_MD5STRENGTH(RMD160, rmd160, ctx); - STORE32_L(p + 0, ctx->a); - STORE32_L(p + 4, ctx->b); - STORE32_L(p + 8, ctx->c); + STORE32_L(p + 0, ctx->a); + STORE32_L(p + 4, ctx->b); + STORE32_L(p + 8, ctx->c); STORE32_L(p + 12, ctx->d); STORE32_L(p + 16, ctx->e); } @@ -382,9 +382,9 @@ void rmd160_done(rmd160_ctx *ctx, void *hash) unsigned long rmd160_state(rmd160_ctx *ctx, void *state) { octet *p = state; - STORE32_L(p + 0, ctx->a); - STORE32_L(p + 4, ctx->b); - STORE32_L(p + 8, ctx->c); + STORE32_L(p + 0, ctx->a); + STORE32_L(p + 4, ctx->b); + STORE32_L(p + 8, ctx->c); STORE32_L(p + 12, ctx->d); STORE32_L(p + 16, ctx->e); return (ctx->nl | ((ctx->nh << 16) << 16));