< draft-nystrom-smime-hmac-sha-01.txt   draft-nystrom-smime-hmac-sha-02.txt >
Network Working Group M. Nystrom Network Working Group M. Nystrom
Internet-Draft RSA Security Internet-Draft RSA Security
Expires: November 5, 2005 May 4, 2005 Expires: December 29, 2005 June 27, 2005
Identifiers and Test Vectors for HMAC-SHA-224, HMAC-SHA-256, HMAC-SHA- Identifiers and Test Vectors for HMAC-SHA-224, HMAC-SHA-256, HMAC-SHA-
384, and HMAC-SHA-512 384, and HMAC-SHA-512
draft-nystrom-smime-hmac-sha-01 draft-nystrom-smime-hmac-sha-02
Status of this Memo Status of this Memo
By submitting this Internet-Draft, each author represents that any By submitting this Internet-Draft, each author represents that any
applicable patent or other IPR claims of which he or she is aware applicable patent or other IPR claims of which he or she is aware
have been or will be disclosed, and any of which he or she becomes have been or will be disclosed, and any of which he or she becomes
aware will be disclosed, in accordance with Section 6 of BCP 79. aware will be disclosed, in accordance with Section 6 of BCP 79.
Internet-Drafts are working documents of the Internet Engineering Internet-Drafts are working documents of the Internet Engineering
Task Force (IETF), its areas, and its working groups. Note that Task Force (IETF), its areas, and its working groups. Note that
skipping to change at page 1, line 34 skipping to change at page 1, line 34
and may be updated, replaced, or obsoleted by other documents at any and may be updated, replaced, or obsoleted by other documents at any
time. It is inappropriate to use Internet-Drafts as reference time. It is inappropriate to use Internet-Drafts as reference
material or to cite them other than as "work in progress." material or to cite them other than as "work in progress."
The list of current Internet-Drafts can be accessed at The list of current Internet-Drafts can be accessed at
http://www.ietf.org/ietf/1id-abstracts.txt. http://www.ietf.org/ietf/1id-abstracts.txt.
The list of Internet-Draft Shadow Directories can be accessed at The list of Internet-Draft Shadow Directories can be accessed at
http://www.ietf.org/shadow.html. http://www.ietf.org/shadow.html.
This Internet-Draft will expire on November 5, 2005. This Internet-Draft will expire on December 29, 2005.
Copyright Notice Copyright Notice
Copyright (C) The Internet Society (2005). Copyright (C) The Internet Society (2005).
Abstract Abstract
This document provides test vectors for the HMAC-SHA-224, HMAC-SHA- This document provides test vectors for the HMAC-SHA-224, HMAC-SHA-
256, HMAC-SHA-384 and HMAC-SHA-512 message authentication schemes. 256, HMAC-SHA-384 and HMAC-SHA-512 message authentication schemes.
It also provides ASN.1 object identifiers and URIs to identify use of It also provides ASN.1 object identifiers and URIs to identify use of
skipping to change at page 2, line 15 skipping to change at page 2, line 15
Table of Contents Table of Contents
1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 3 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 3
2. Conventions used in this document . . . . . . . . . . . . . . 3 2. Conventions used in this document . . . . . . . . . . . . . . 3
3. Scheme identifiers . . . . . . . . . . . . . . . . . . . . . . 3 3. Scheme identifiers . . . . . . . . . . . . . . . . . . . . . . 3
3.1 ASN.1 Object Identifiers . . . . . . . . . . . . . . . . . 3 3.1 ASN.1 Object Identifiers . . . . . . . . . . . . . . . . . 3
3.2 Algorithm URIs . . . . . . . . . . . . . . . . . . . . . . 4 3.2 Algorithm URIs . . . . . . . . . . . . . . . . . . . . . . 4
4. Test vectors . . . . . . . . . . . . . . . . . . . . . . . . . 4 4. Test vectors . . . . . . . . . . . . . . . . . . . . . . . . . 4
4.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . 4 4.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . 4
4.2 Test case 1 . . . . . . . . . . . . . . . . . . . . . . . 4 4.2 Test case 1 . . . . . . . . . . . . . . . . . . . . . . . 4
4.3 Test case 2 . . . . . . . . . . . . . . . . . . . . . . . 5 4.3 Test case 2 . . . . . . . . . . . . . . . . . . . . . . . 4
4.4 Test case 3 . . . . . . . . . . . . . . . . . . . . . . . 5 4.4 Test case 3 . . . . . . . . . . . . . . . . . . . . . . . 5
4.5 Test case 4 . . . . . . . . . . . . . . . . . . . . . . . 6 4.5 Test case 4 . . . . . . . . . . . . . . . . . . . . . . . 5
4.6 Test case 5 . . . . . . . . . . . . . . . . . . . . . . . 6 4.6 Test case 5 . . . . . . . . . . . . . . . . . . . . . . . 6
4.7 Test case 6 . . . . . . . . . . . . . . . . . . . . . . . 7 4.7 Test case 6 . . . . . . . . . . . . . . . . . . . . . . . 6
4.8 Test case 7 . . . . . . . . . . . . . . . . . . . . . . . 8 4.8 Test case 7 . . . . . . . . . . . . . . . . . . . . . . . 7
5. IANA considerations . . . . . . . . . . . . . . . . . . . . . 8 5. IANA considerations . . . . . . . . . . . . . . . . . . . . . 8
6. Security Considerations . . . . . . . . . . . . . . . . . . . 8 6. Security Considerations . . . . . . . . . . . . . . . . . . . 8
7. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . 9 7. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . 9
8. References . . . . . . . . . . . . . . . . . . . . . . . . . . 9 8. References . . . . . . . . . . . . . . . . . . . . . . . . . . 9
8.1 Normative references . . . . . . . . . . . . . . . . . . . 9 8.1 Normative references . . . . . . . . . . . . . . . . . . . 9
8.2 Informative references . . . . . . . . . . . . . . . . . . 9 8.2 Informative references . . . . . . . . . . . . . . . . . . 9
Author's Address . . . . . . . . . . . . . . . . . . . . . . . 9 Author's Address . . . . . . . . . . . . . . . . . . . . . . . 9
Intellectual Property and Copyright Statements . . . . . . . . 10 Intellectual Property and Copyright Statements . . . . . . . . 10
1. Introduction 1. Introduction
skipping to change at page 3, line 25 skipping to change at page 3, line 25
code [1] using the SHA-224 hash function, HMAC-SHA-256 is the code [1] using the SHA-224 hash function, HMAC-SHA-256 is the
realization of the HMAC message authentication code using the SHA-256 realization of the HMAC message authentication code using the SHA-256
hash function, HMAC-SHA-384 is the realization of the HMAC message hash function, HMAC-SHA-384 is the realization of the HMAC message
authentication code using the SHA-384 hash function, and HMAC-SHA-512 authentication code using the SHA-384 hash function, and HMAC-SHA-512
is the realization of the HMAC message authentication code using the is the realization of the HMAC message authentication code using the
SHA-512 hash function. SHA-224, SHA-256, SHA-384, and SHA-512 are SHA-512 hash function. SHA-224, SHA-256, SHA-384, and SHA-512 are
all described in [2]. all described in [2].
2. Conventions used in this document 2. Conventions used in this document
The key word "SHALL" in this document is to be interpreted as The key word "SHOULD" in this document is to be interpreted as
described in RFC 2119 [3]. described in RFC 2119 [3].
3. Scheme identifiers 3. Scheme identifiers
3.1 ASN.1 Object Identifiers 3.1 ASN.1 Object Identifiers
The following ASN.1 object identifiers have been allocated for these The following ASN.1 object identifiers have been allocated for these
schemes: schemes:
rsadsi OBJECT IDENTIFIER ::= rsadsi OBJECT IDENTIFIER ::=
skipping to change at page 3, line 47 skipping to change at page 3, line 47
digestAlgorithm OBJECT IDENTIFIER ::= {rsadsi 2} digestAlgorithm OBJECT IDENTIFIER ::= {rsadsi 2}
id-hmacWithSHA224 OBJECT IDENTIFIER ::= {digestAlgorithm 8} id-hmacWithSHA224 OBJECT IDENTIFIER ::= {digestAlgorithm 8}
id-hmacWithSHA256 OBJECT IDENTIFIER ::= {digestAlgorithm 9} id-hmacWithSHA256 OBJECT IDENTIFIER ::= {digestAlgorithm 9}
id-hmacWithSHA384 OBJECT IDENTIFIER ::= {digestAlgorithm 10} id-hmacWithSHA384 OBJECT IDENTIFIER ::= {digestAlgorithm 10}
id-hmacWithSHA512 OBJECT IDENTIFIER ::= {digestAlgorithm 11} id-hmacWithSHA512 OBJECT IDENTIFIER ::= {digestAlgorithm 11}
When the "algorithm" component in a value of ASN.1 type When the "algorithm" component in a value of ASN.1 type
AlgorithmIdentifier (see, e.g. [4], Section 10) identifies one of AlgorithmIdentifier (see, e.g. [4], Section 10) identifies one of
these schemes, the "parameter" component SHALL be present but have these schemes, the "parameter" component SHOULD be present but have
type NULL. type NULL.
3.2 Algorithm URIs 3.2 Algorithm URIs
The following URIs have been allocated for these schemes: The following URIs have been allocated for these schemes:
http://www.rsasecurity.com/rsalabs/pkcs/schemas/pkcs-5#hmac-sha-224 http://www.rsasecurity.com/rsalabs/pkcs/schemas/pkcs-5#hmac-sha-224
http://www.rsasecurity.com/rsalabs/pkcs/schemas/pkcs-5#hmac-sha-256 http://www.rsasecurity.com/rsalabs/pkcs/schemas/pkcs-5#hmac-sha-256
http://www.rsasecurity.com/rsalabs/pkcs/schemas/pkcs-5#hmac-sha-384 http://www.rsasecurity.com/rsalabs/pkcs/schemas/pkcs-5#hmac-sha-384
http://www.rsasecurity.com/rsalabs/pkcs/schemas/pkcs-5#hmac-sha-512 http://www.rsasecurity.com/rsalabs/pkcs/schemas/pkcs-5#hmac-sha-512
skipping to change at page 5, line 7 skipping to change at page 4, line 48
HMAC-SHA-384 = afd03944d84895626b0825f4ab46907f HMAC-SHA-384 = afd03944d84895626b0825f4ab46907f
15f9dadbe4101ec682aa034c7cebc59c 15f9dadbe4101ec682aa034c7cebc59c
faea9ea9076ede7f4af152e8b2fa9cb6 faea9ea9076ede7f4af152e8b2fa9cb6
HMAC-SHA-512 = 87aa7cdea5ef619d4ff0b4241a1d6cb0 HMAC-SHA-512 = 87aa7cdea5ef619d4ff0b4241a1d6cb0
2379f4e2ce4ec2787ad0b30545e17cde 2379f4e2ce4ec2787ad0b30545e17cde
daa833b7d6b8a702038b274eaea3f4e4 daa833b7d6b8a702038b274eaea3f4e4
be9d914eeb61f1702e696c203a126854 be9d914eeb61f1702e696c203a126854
4.3 Test case 2 4.3 Test case 2
Test with key shorter than the length of the HMAC output.
Key = 4a656665 ("Jefe") Key = 4a656665 ("Jefe")
Data = 7768617420646f2079612077616e7420 ("what do ya want ") Data = 7768617420646f2079612077616e7420 ("what do ya want ")
666f72206e6f7468696e673f ("for nothing?") 666f72206e6f7468696e673f ("for nothing?")
HMAC-SHA-224 = a30e01098bc6dbbf45690f3a7e9e6d0f HMAC-SHA-224 = a30e01098bc6dbbf45690f3a7e9e6d0f
8bbea2a39e6148008fd05e44 8bbea2a39e6148008fd05e44
HMAC-SHA-256 = 5bdcc146bf60754e6a042426089575c7 HMAC-SHA-256 = 5bdcc146bf60754e6a042426089575c7
5a003f089d2739839dec58b964ec3843 5a003f089d2739839dec58b964ec3843
HMAC-SHA-384 = af45d2e376484031617f78d2b58a6b1b HMAC-SHA-384 = af45d2e376484031617f78d2b58a6b1b
9c7ef464f5a01b47e42ec3736322445e 9c7ef464f5a01b47e42ec3736322445e
8e2240ca5e69e2c78b3239ecfab21649 8e2240ca5e69e2c78b3239ecfab21649
HMAC-SHA-512 = 164b7a7bfcf819e2e395fbe73b56e0a3 HMAC-SHA-512 = 164b7a7bfcf819e2e395fbe73b56e0a3
87bd64222e831fd610270cd7ea250554 87bd64222e831fd610270cd7ea250554
9758bf75c05a994a6d034f65f8f0e6fd 9758bf75c05a994a6d034f65f8f0e6fd
caeab1a34d4a6b4b636e070a38bce737 caeab1a34d4a6b4b636e070a38bce737
4.4 Test case 3 4.4 Test case 3
Test with combined length of key and data larger than 64 bytes (=
block-size of SHA-224 and SHA-256).
Key aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa Key aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaa (20 bytes) aaaaaaaa (20 bytes)
Data = dddddddddddddddddddddddddddddddd Data = dddddddddddddddddddddddddddddddd
dddddddddddddddddddddddddddddddd dddddddddddddddddddddddddddddddd
dddddddddddddddddddddddddddddddd dddddddddddddddddddddddddddddddd
dddd (50 bytes) dddd (50 bytes)
HMAC-SHA-224 = 7fb3cb3588c6c1f6ffa9694d7d6ad264 HMAC-SHA-224 = 7fb3cb3588c6c1f6ffa9694d7d6ad264
9365b0c1f65d69d1ec8333ea 9365b0c1f65d69d1ec8333ea
HMAC-SHA-256 = 773ea91e36800e46854db8ebd09181a7 HMAC-SHA-256 = 773ea91e36800e46854db8ebd09181a7
skipping to change at page 6, line 7 skipping to change at page 5, line 47
HMAC-SHA-384 = 88062608d3e6ad8a0aa2ace014c8a86f HMAC-SHA-384 = 88062608d3e6ad8a0aa2ace014c8a86f
0aa635d947ac9febe83ef4e55966144b 0aa635d947ac9febe83ef4e55966144b
2a5ab39dc13814b94e3ab6e101a34f27 2a5ab39dc13814b94e3ab6e101a34f27
HMAC-SHA-512 = fa73b0089d56a284efb0f0756c890be9 HMAC-SHA-512 = fa73b0089d56a284efb0f0756c890be9
b1b5dbdd8ee81a3655f83e33b2279d39 b1b5dbdd8ee81a3655f83e33b2279d39
bf3e848279a722c806b485a47e67c807 bf3e848279a722c806b485a47e67c807
b946a337bee8942674278859e13292fb b946a337bee8942674278859e13292fb
4.5 Test case 4 4.5 Test case 4
Test with combined length of key and data larger than 64 bytes (=
block-size of SHA-224 and SHA-256).
Key = 0102030405060708090a0b0c0d0e0f10 Key = 0102030405060708090a0b0c0d0e0f10
111213141516171819 (25 bytes) 111213141516171819 (25 bytes)
Data = cdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcd Data = cdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcd
cdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcd cdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcd
cdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcd cdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcd
cdcd (50 bytes) cdcd (50 bytes)
HMAC-SHA-224 = 6c11506874013cac6a2abc1bb382627c HMAC-SHA-224 = 6c11506874013cac6a2abc1bb382627c
ec6a90d86efc012de7afec5a ec6a90d86efc012de7afec5a
HMAC-SHA-256 = 82558a389a443c0ea4cc819899f2083a HMAC-SHA-256 = 82558a389a443c0ea4cc819899f2083a
skipping to change at page 6, line 28 skipping to change at page 6, line 26
HMAC-SHA-384 = 3e8a69b7783c25851933ab6290af6ca7 HMAC-SHA-384 = 3e8a69b7783c25851933ab6290af6ca7
7a9981480850009cc5577c6e1f573b4e 7a9981480850009cc5577c6e1f573b4e
6801dd23c4a7d679ccf8a386c674cffb 6801dd23c4a7d679ccf8a386c674cffb
HMAC-SHA-512 = b0ba465637458c6990e5a8c5f61d4af7 HMAC-SHA-512 = b0ba465637458c6990e5a8c5f61d4af7
e576d97ff94b872de76f8050361ee3db e576d97ff94b872de76f8050361ee3db
a91ca5c11aa25eb4d679275cc5788063 a91ca5c11aa25eb4d679275cc5788063
a5f19741120c4f2de2adebeb10a298dd a5f19741120c4f2de2adebeb10a298dd
4.6 Test case 5 4.6 Test case 5
Note: Truncation to 128 bits. Test with truncation of output to 128 bits.
Key = 0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c Key = 0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c
0c0c0c0c (20 bytes) 0c0c0c0c (20 bytes)
Data = 546573742057697468205472756e6361 ("Test With Trunca") Data = 546573742057697468205472756e6361 ("Test With Trunca")
74696f6e ("tion") 74696f6e ("tion")
HMAC-SHA-224 = 0e2aea68a90c8d37c988bcdb9fca6fa8 HMAC-SHA-224 = 0e2aea68a90c8d37c988bcdb9fca6fa8
HMAC-SHA-256 = a3b6167473100ee06e0c796c2955552b HMAC-SHA-256 = a3b6167473100ee06e0c796c2955552b
HMAC-SHA-384 = 3abf34c3503b2a23a46efc619baef897 HMAC-SHA-384 = 3abf34c3503b2a23a46efc619baef897
HMAC-SHA-512 = 415fad6271580a531d4179bc891d87a6 HMAC-SHA-512 = 415fad6271580a531d4179bc891d87a6
4.7 Test case 6 4.7 Test case 6
Test with key larger than 128 bytes (= block-size of SHA-384 and SHA-
512).
Key = aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa Key = aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaa (131 bytes) aaaaaa (131 bytes)
Data = 54657374205573696e67204c61726765 ("Test Using Large") Data = 54657374205573696e67204c61726765 ("Test Using Large")
skipping to change at page 8, line 7 skipping to change at page 7, line 33
HMAC-SHA-384 = 4ece084485813e9088d2c63a041bc5b4 HMAC-SHA-384 = 4ece084485813e9088d2c63a041bc5b4
4f9ef1012a2b588f3cd11f05033ac4c6 4f9ef1012a2b588f3cd11f05033ac4c6
0c2ef6ab4030fe8296248df163f44952 0c2ef6ab4030fe8296248df163f44952
HMAC-SHA-512 = 80b24263c7c1a3ebb71493c1dd7be8b4 HMAC-SHA-512 = 80b24263c7c1a3ebb71493c1dd7be8b4
9b46d1f41b4aeec1121b013783f8f352 9b46d1f41b4aeec1121b013783f8f352
6b56d037e05f2598bd0fd2215d6a1e52 6b56d037e05f2598bd0fd2215d6a1e52
95e64f73f63f0aec8b915a985d786598 95e64f73f63f0aec8b915a985d786598
4.8 Test case 7 4.8 Test case 7
Test with key and data larger than 128 bytes (= block-size of SHA-384
and SHA-512).
Key = aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa Key = aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaa (131 bytes) aaaaaa (131 bytes)
Data = 54686973206973206120746573742075 ("This is a test u") Data = 54686973206973206120746573742075 ("This is a test u")
 End of changes. 14 change blocks. 
10 lines changed or deleted 24 lines changed or added

This html diff was produced by rfcdiff 1.48. The latest version is available from http://tools.ietf.org/tools/rfcdiff/