RFC 2202 (rfc2202) - Page 1 of 9


Test Cases for HMAC-MD5 and HMAC-SHA-1



Alternative Format: Original Text Document



Network Working Group                                          P. Cheng
Request for Comments: 2202                                          IBM
Category: Informational                                        R. Glenn
                                                                   NIST
                                                         September 1997


                 Test Cases for HMAC-MD5 and HMAC-SHA-1

Status of This Memo

   This memo provides information for the Internet community.  This memo
   does not specify an Internet standard of any kind.  Distribution of
   this memo is unlimited.

Abstract

   This document provides two sets of test cases for HMAC-MD5 and HMAC-
   SHA-1, respectively. HMAC-MD5 and HMAC-SHA-1 are two constructs of
   the HMAC [HMAC] message authentication function using the MD5 [MD5]
   hash function and the SHA-1 [SHA] hash function. Both constructs are
   used by IPSEC [OG,CG] and other protocols to authenticate messages.
   The test cases and results provided in this document are meant to be
   used as a conformance test for HMAC-MD5 and HMAC-SHA-1
   implementations.

1. Introduction

   The general method for constructing a HMAC message authentication
   function using a particular hash function is described in section 2
   of [HMAC]. We will not repeat the description here. Section 5 of
   [HMAC] also discusses truncating the output of HMAC; the rule is that
   we should keep the more significant bits (the bits in the left,
   assuming a network byte order (big-endian)).

   In sections 2 and 3 we provide test cases for HMAC-MD5 and HMAC-SHA-
   1, respectively. Each case includes the key, the data, and the
   result.  The values of keys and data are either hexadecimal numbers
   (prefixed by "0x") or ASCII character strings in double quotes. If a
   value is an ASCII character string, then the HMAC computation for the
   corresponding test case DOES NOT include the trailing null character
   ('\0') in the string.









Cheng & Glenn                Informational