t_hashes.c revision 0c27b3fe77ac1d5094ba3521e8142d9e7973133f
36488004520b3a22fbd37ef8e10e5641be154ac1slive * Copyright (C) 2010, 2013, 2016 Internet Systems Consortium, Inc. ("ISC")
36488004520b3a22fbd37ef8e10e5641be154ac1slive * This Source Code Form is subject to the terms of the Mozilla Public
7db9f691a00ead175b03335457ca296a33ddf31bnd * License, v. 2.0. If a copy of the MPL was not distributed with this
36488004520b3a22fbd37ef8e10e5641be154ac1slive * file, You can obtain one at http://mozilla.org/MPL/2.0/.
36488004520b3a22fbd37ef8e10e5641be154ac1slive/* $Id: t_hashes.c,v 1.5 2010/10/04 22:27:41 marka Exp $ */
36488004520b3a22fbd37ef8e10e5641be154ac1slive * -d1 or larger shows hash or HMAC result even if correct
36488004520b3a22fbd37ef8e10e5641be154ac1slivetypedef void(*HASH_INIT)(void *);
36488004520b3a22fbd37ef8e10e5641be154ac1slivetypedef void(*HMAC_INIT)(void *, const unsigned char *, unsigned int);
36488004520b3a22fbd37ef8e10e5641be154ac1slivetypedef void(*UPDATE)(void *, const unsigned char *, unsigned int);
36488004520b3a22fbd37ef8e10e5641be154ac1slivetypedef void(*FINAL)(void *, const unsigned char *);
36488004520b3a22fbd37ef8e10e5641be154ac1slivetypedef void(*SIGN)(void *, const unsigned char *, unsigned int);
36488004520b3a22fbd37ef8e10e5641be154ac1slivetypedef struct {
36488004520b3a22fbd37ef8e10e5641be154ac1slive const char *name;
36488004520b3a22fbd37ef8e10e5641be154ac1slive const unsigned char *key;
36488004520b3a22fbd37ef8e10e5641be154ac1slive const unsigned int key_len;
36488004520b3a22fbd37ef8e10e5641be154ac1slive const unsigned char *str;
36488004520b3a22fbd37ef8e10e5641be154ac1slive const unsigned int str_len;
e970bfa9380b2a4d9e8636e3424f5d7adc8bd35djerenkrantz#define STR_INIT(s) (const unsigned char *)(s), sizeof(s)-1
e970bfa9380b2a4d9e8636e3424f5d7adc8bd35djerenkrantz unsigned char b[1024];
36488004520b3a22fbd37ef8e10e5641be154ac1slivetypedef struct {
36488004520b3a22fbd37ef8e10e5641be154ac1slive const char *str;
730d1b4323255d959841983947e735d892aec279erikabele const unsigned int digest_len;
36488004520b3a22fbd37ef8e10e5641be154ac1slive * two ad hoc hash examples
36488004520b3a22fbd37ef8e10e5641be154ac1slivestatic IN_ abc = { "\"abc\"", NULL, 0, STR_INIT("abc")};
const unsigned char *d, unsigned int d_len)
return buf;
const char *str_name;
if (T_debug != 0)
++nprobs;
++nprobs;
} ctx;
} ctx;
t1(void)
if (nprobs != 0)
#ifdef WIN32