view lib/hmac-sha512.c @ 39875:67e1644a2382

hmac-*: refactor to remove repetitive code A net removal of 240 lines. * lib/hmac.c: A new parameterized single implementation. * lib/hmac-md5.c: Define parameters and include implementation. * lib/hmac-sha1.c: Likewise. * lib/hmac-sha256.c: Likewise. * lib/hmac-sha512.c: Likewise. * modules/crypto/hmac-md5: Reference the new implementation file. * modules/crypto/hmac-sha1: Likewise. * modules/crypto/hmac-sha256: Likewise. * modules/crypto/hmac-sha512: Likewise. * tests/test-hmac-md5.c: Refactor common code to a single function. * tests/test-hmac-sha1.c: Likewise. * tests/test-hmac-sha256.c: Likewise. * tests/test-hmac-sha512.c: Likewise.
author Pádraig Brady <P@draigBrady.com>
date Sat, 29 Sep 2018 22:20:17 -0700
parents 96d0c10a7473
children b06060465f09
line wrap: on
line source

/* hmac-sha512.c -- hashed message authentication codes
   Copyright (C) 2018 Free Software Foundation, Inc.

   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation; either version 2, or (at your option)
   any later version.

   This program 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 General Public License for more details.

   You should have received a copy of the GNU General Public License
   along with this program; if not, see <https://www.gnu.org/licenses/>.  */

#include <config.h>

#include "hmac.h"

#include "sha512.h"

#define GL_HMAC_NAME 512
#define GL_HMAC_BLOCKSIZE 128
#define GL_HMAC_HASHSIZE 64
#include "hmac.c"