X-Git-Url: https://git.distorted.org.uk/u/mdw/catacomb/blobdiff_plain/eee161205f1139ee49e81c8efa33fe18380c917b..7280f7f44cfae62f6d34761ac88aa19da7da5dd8:/sha512.c diff --git a/sha512.c b/sha512.c index e9b7254..2f39472 100644 --- a/sha512.c +++ b/sha512.c @@ -1,13 +1,13 @@ /* -*-c-*- * - * $Id: sha512.c,v 1.1 2000/10/15 17:48:15 mdw Exp $ + * $Id: sha512.c,v 1.2 2004/04/08 01:36:15 mdw Exp $ * * Implementation of the SHA-512 hash function * * (c) 2000 Straylight/Edgeware */ -/*----- Licensing notice --------------------------------------------------* +/*----- Licensing notice --------------------------------------------------* * * This file is part of Catacomb. * @@ -15,26 +15,18 @@ * 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, * MA 02111-1307, USA. */ -/*----- Revision history --------------------------------------------------* - * - * $Log: sha512.c,v $ - * Revision 1.1 2000/10/15 17:48:15 mdw - * New SHA variants with longer outputs. - * - */ - /*----- Header files ------------------------------------------------------*/ #include @@ -292,8 +284,8 @@ void sha512_done(sha512_ctx *ctx, void *hash) { octet *p = hash; final(ctx); - STORE64_(p + 0, ctx->a); - STORE64_(p + 8, ctx->b); + STORE64_(p + 0, ctx->a); + STORE64_(p + 8, ctx->b); STORE64_(p + 16, ctx->c); STORE64_(p + 24, ctx->d); STORE64_(p + 32, ctx->e); @@ -306,8 +298,8 @@ void sha384_done(sha384_ctx *ctx, void *hash) { octet *p = hash; final(ctx); - STORE64_(p + 0, ctx->a); - STORE64_(p + 8, ctx->b); + STORE64_(p + 0, ctx->a); + STORE64_(p + 8, ctx->b); STORE64_(p + 16, ctx->c); STORE64_(p + 24, ctx->d); STORE64_(p + 32, ctx->e); @@ -328,8 +320,8 @@ void sha384_done(sha384_ctx *ctx, void *hash) unsigned long sha512_state(sha512_ctx *ctx, void *state) { octet *p = state; - STORE64_(p + 0, ctx->a); - STORE64_(p + 8, ctx->b); + STORE64_(p + 0, ctx->a); + STORE64_(p + 8, ctx->b); STORE64_(p + 16, ctx->c); STORE64_(p + 24, ctx->d); STORE64_(p + 32, ctx->e);