hash_test.c revision f1b68725503ff3e46001eee5a1751e29a43a09d1
9178881e1bf6a4b01db886b355406c8bed61cc2aMichael Graff * Copyright (C) 2000, 2001 Internet Software Consortium.
9178881e1bf6a4b01db886b355406c8bed61cc2aMichael Graff * Permission to use, copy, modify, and distribute this software for any
9178881e1bf6a4b01db886b355406c8bed61cc2aMichael Graff * purpose with or without fee is hereby granted, provided that the above
9178881e1bf6a4b01db886b355406c8bed61cc2aMichael Graff * copyright notice and this permission notice appear in all copies.
9178881e1bf6a4b01db886b355406c8bed61cc2aMichael Graff * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
9178881e1bf6a4b01db886b355406c8bed61cc2aMichael Graff * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
9178881e1bf6a4b01db886b355406c8bed61cc2aMichael Graff * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
9178881e1bf6a4b01db886b355406c8bed61cc2aMichael Graff * INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
9178881e1bf6a4b01db886b355406c8bed61cc2aMichael Graff * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
9178881e1bf6a4b01db886b355406c8bed61cc2aMichael Graff * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
9178881e1bf6a4b01db886b355406c8bed61cc2aMichael Graff * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
9178881e1bf6a4b01db886b355406c8bed61cc2aMichael Graff * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
9178881e1bf6a4b01db886b355406c8bed61cc2aMichael Graff/* $Id: hash_test.c,v 1.9 2001/11/27 00:55:42 gson Exp $ */
9178881e1bf6a4b01db886b355406c8bed61cc2aMichael Graffprint_digest(char *s, const char *hash, unsigned char *d,
9178881e1bf6a4b01db886b355406c8bed61cc2aMichael Graff unsigned int words)
f9df80f4348ef68043903efa08299480324f4823Michael Graff unsigned int i, j;
f9df80f4348ef68043903efa08299480324f4823Michael Graff for (i = 0; i < words; i++) {
9178881e1bf6a4b01db886b355406c8bed61cc2aMichael Graff for (j = 0; j < 4; j++)
f9df80f4348ef68043903efa08299480324f4823Michael Graff const unsigned char *s;
f9df80f4348ef68043903efa08299480324f4823Michael Graff s = "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq";
d68838693666ba930ec4143f848c18bff2bfc244Michael Graff * The 3 HMAC-MD5 examples from RFC 2104
9178881e1bf6a4b01db886b355406c8bed61cc2aMichael Graff s = "Hi There";
97e7d389d54a9e3a1ba8313ed140b04afabc7081Michael Graff isc_hmacmd5_update(&hmacmd5, buffer, strlen(s));
9178881e1bf6a4b01db886b355406c8bed61cc2aMichael Graff s = "what do ya want for nothing?";
9178881e1bf6a4b01db886b355406c8bed61cc2aMichael Graff isc_hmacmd5_update(&hmacmd5, buffer, strlen(s));
9178881e1bf6a4b01db886b355406c8bed61cc2aMichael Graff s = "\335\335\335\335\335\335\335\335\335\335"
9178881e1bf6a4b01db886b355406c8bed61cc2aMichael Graff "\335\335\335\335\335\335\335\335\335\335"
9178881e1bf6a4b01db886b355406c8bed61cc2aMichael Graff "\335\335\335\335\335\335\335\335\335\335"
9178881e1bf6a4b01db886b355406c8bed61cc2aMichael Graff "\335\335\335\335\335\335\335\335\335\335"
9178881e1bf6a4b01db886b355406c8bed61cc2aMichael Graff "\335\335\335\335\335\335\335\335\335\335";