< draft-eastlake-sha2b-01.txt   draft-eastlake-sha2b-02.txt >
Network Working Group Donald Eastlake 3rd Network Working Group Donald Eastlake 3rd
INTERNET-DRAFT Stellar Switches INTERNET-DRAFT Stellar Switches
Obsoletes: 4634 Tony Hansen Obsoletes: 4634 Tony Hansen
Updates: 3174 AT&T Labs Updates: 3174 AT&T Labs
Intended Status: Informational Intended Status: Informational
Expires: October 27, 2010 April 28, 2010 Expires: November 8, 2010 May 9, 2010
US Secure Hash Algorithms US Secure Hash Algorithms
(SHA and SHA based HMAC and HKDF) (SHA and SHA based HMAC and HKDF)
<draft-eastlake-sha2b-01.txt> <draft-eastlake-sha2b-02.txt>
Abstract Abstract
This document is an update of [RFC4634] to fix errata and to add code This document is an update of [RFC4634] to fix errata and to add code
for an HMAC-based extract-and-expand key derivation function. for an HMAC-based extract-and-expand key derivation function.
The United States of America has adopted a suite of secure hash The United States of America has adopted a suite of secure hash
algorithms (SHAs), including four beyond SHA-1, as part of a Federal algorithms (SHAs), including four beyond SHA-1, as part of a Federal
Information Processing Standard (FIPS), specifically SHA-224, Information Processing Standard (FIPS), specifically SHA-224,
SHA-256, SHA-384, and SHA-512. The purpose of this document is to SHA-256, SHA-384, and SHA-512. The purpose of this document is to
make open source code performing the SHA hash functions conveniently make open source code performing the SHA hash functions conveniently
skipping to change at page 2, line 9 skipping to change at page 2, line 9
The list of current Internet-Drafts can be accessed at The list of current Internet-Drafts can be accessed at
http://www.ietf.org/1id-abstracts.html http://www.ietf.org/1id-abstracts.html
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
INTERNET-DRAFT SHAs, HMAC-SHAs, and HKDF INTERNET-DRAFT SHAs, HMAC-SHAs, and HKDF
Table of Contents Table of Contents
Abstract...................................................1
Status of This Memo........................................1
1. Overview of Contents....................................3 1. Overview of Contents....................................3
2. Notation for Bit Strings and Integers...................4 2. Notation for Bit Strings and Integers...................4
3. Operations on Words.....................................5 3. Operations on Words.....................................5
4. Message Padding and Parsing.............................7 4. Message Padding and Parsing.............................7
4.1 SHA-224 and SHA-256....................................7 4.1 SHA-224 and SHA-256....................................7
4.2 SHA-384 and SHA-512....................................8 4.2 SHA-384 and SHA-512....................................8
5. Functions and Constants Used...........................10 5. Functions and Constants Used...........................10
5.1 SHA-224 and SHA-256...................................10 5.1 SHA-224 and SHA-256...................................10
skipping to change at page 2, line 55 skipping to change at page 2, line 52
9. IANA Considerations...................................122 9. IANA Considerations...................................122
10. Security Considerations..............................122 10. Security Considerations..............................122
11. Acknowledgements.....................................122 11. Acknowledgements.....................................122
12. References...........................................123 12. References...........................................123
12.1 Normative References................................123 12.1 Normative References................................123
12.2 Informative References..............................123 12.2 Informative References..............................123
Appendix: Changes from RFC 4634..........................125 Appendix: Changes from RFC 4634..........................125
Edit History.............................................126 Edit History.............................................126
Changes from -00 to -01..................................126 Changes from -00 to -01..................................126
Author's Address.........................................127 Changes from -01 to -02..................................126
Copyright, Disclaimer, and Additional IPR Provisions.....128
INTERNET-DRAFT SHAs, HMAC-SHAs, and HKDF INTERNET-DRAFT SHAs, HMAC-SHAs, and HKDF
1. Overview of Contents 1. Overview of Contents
This document obsoletes [RFC4634] and the changes from that RFC are This document obsoletes [RFC4634] and the changes from that RFC are
summarized in the Appendix below. summarized in the Appendix below.
This document includes specifications for the United States of This document includes specifications for the United States of
America (USA) Federal Information Processing Standard (FIPS) Secure America (USA) Federal Information Processing Standard (FIPS) Secure
skipping to change at page 103, line 55 skipping to change at page 103, line 55
SHA1, SHA1,
22, "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b" 22, "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b"
"\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b", "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b",
0, "", 0, "",
0, "", 0, "",
20, "DA8C8A73C7FA77288EC6F5E7C297786AA0D32D01", 20, "DA8C8A73C7FA77288EC6F5E7C297786AA0D32D01",
42, "0AC1AF7002B3D761D1E55298DA9D0506" 42, "0AC1AF7002B3D761D1E55298DA9D0506"
"B9AE52057220A306E07B6B87E8DF21D0" "B9AE52057220A306E07B6B87E8DF21D0"
"EA00033DE03984D34918" "EA00033DE03984D34918"
}, },
{ /* Extra test case, not in RFC XXXX. */ { /* A.7. Test Case 7. */
SHA1, SHA1,
INTERNET-DRAFT SHAs, HMAC-SHAs, and HKDF INTERNET-DRAFT SHAs, HMAC-SHAs, and HKDF
22, "\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c" 22, "\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c"
"\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c", "\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c",
0, 0, 0, 0,
0, "", 0, "",
20, "2ADCCADA18779E7C2077AD2EB19D3F3E731385DD", 20, "2ADCCADA18779E7C2077AD2EB19D3F3E731385DD",
42, "2C91117204D745F3500D636A62F64F0A" 42, "2C91117204D745F3500D636A62F64F0A"
skipping to change at page 119, line 42 skipping to change at page 119, line 42
if (u1 != u2) if (u1 != u2)
return u1 - u2; return u1 - u2;
if (u1 == '\0') if (u1 == '\0')
return 0; return 0;
} }
} }
/* /*
* This is a copy of getopt provided for those systems that do not * This is a copy of getopt provided for those systems that do not
* have it. The name was changed to xgetopt to not conflict on those * have it. The name was changed to xgetopt to not conflict on those
* systems that do have it. Similarly, optarg, optind and opterr * systems that do have it. Similarly, optarg, optopt, optind and
* were renamed to xoptarg, xoptind and xopterr. * opterr were renamed to xoptarg, xoptopt, xoptind and xopterr,
* * respectively.
* Copyright 1990, 1991, 1992 by the Massachusetts Institute of
* Technology and UniSoft Group Limited.
*
* Permission to use, copy, modify, distribute, and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear in
* supporting documentation, and that the names of MIT and UniSoft not
* be used in advertising or publicity pertaining to distribution of
* the software without specific, written prior permission. MIT and
* UniSoft make no representations about the suitability of this
* software for any purpose. It is provided "as is" without express
INTERNET-DRAFT SHAs, HMAC-SHAs, and HKDF
* or implied warranty.
*
* $XConsortium: getopt.c,v 1.2 92/07/01 11:59:04 rws Exp $
* NB: Reformatted to match above style.
*/ */
char *xoptarg; int xoptind = 1; /* location in argv */
int xoptind = 1; char *xoptarg = 0; /* argument to option */
int xopterr = 1; int xoptopt = 0; /* current option */
int xopterr = 1; /* print error messages */
static int xoptplace = 0; /* internal state */
static int xgetopt(int argc, char **argv, const char *optstring) int xgetopt(int argc, char **argv, const char *optstring)
{ {
static int avplace; char *p;
char *ap; xoptarg = 0; /* reset argument */
char *cp;
int c;
if (xoptind >= argc)
return EOF;
ap = argv[xoptind] + avplace;
/* At beginning of arg but not an option */
if (avplace == 0) {
if (ap[0] != '-')
return EOF;
else if (ap[1] == '-') {
/* Special end of options option */
xoptind++;
return EOF;
} else if (ap[1] == '\0')
return EOF; /* single '-' is not allowed */
}
/* Get next letter */
avplace++;
c = *++ap;
cp = strchr(optstring, c); INTERNET-DRAFT SHAs, HMAC-SHAs, and HKDF
if (cp == NULL || c == ':') {
if (xopterr)
fprintf(stderr, "Unrecognised option -- %c\n", c);
return '?';
}
if (cp[1] == ':') { if (xoptind == argc) { /* end of options */
/* There should be an option arg */ return -1;
avplace = 0; }
if (ap[1] == '\0') { if (xoptplace == 0) { /* at beginning of an option */
/* It is a separate arg */ if (argv[xoptind][0] != '-') { /* hit a non-option */
xoptplace = 0;
return -1;
}
if (argv[xoptind][1] == '-') { /* found --, skip past, end */
xoptind++;
xoptplace = 0;
return -1;
}
xoptplace = 1;
xoptopt = argv[xoptind][xoptplace];
p = strchr(optstring, xoptopt);
if (p == 0) { /* option unknown */
if (xopterr) fprintf(stderr, "Unknown option: %c\n",
xoptopt);
xoptind++; /* prevent infinite loop */
xoptplace = 0;
return '?';
}
if (p[1] == ':') { /* need an argument */
if (argv[xoptind][xoptplace+1]) { /* arg inline */
xoptarg = argv[xoptind] + xoptplace + 1;
xoptind++;
xoptplace = 0;
return xoptopt;
}
if (xoptind == argc) {
if (xopterr) fprintf(stderr,
"Option -%c requires an argument\n", xoptopt);
return '?';
}
xoptarg = argv[++xoptind]; /* next is arg */
xoptind++; /* and move past it */
xoptplace = 0;
return xoptopt;
}
if (argv[xoptind][xoptplace+1]) { /* more inline */
xoptplace++;
return xoptopt;
}
xoptind++; /* move forward one */
xoptplace = 0;
return xoptopt;
}
xoptopt = argv[xoptind][xoptplace];
p = strchr(optstring, xoptopt);
INTERNET-DRAFT SHAs, HMAC-SHAs, and HKDF INTERNET-DRAFT SHAs, HMAC-SHAs, and HKDF
if (++xoptind >= argc) { if (p == 0) { /* option unknown */
if (xopterr) if (xopterr) fprintf(stderr, "Unknown option: %c\n", xoptopt);
fprintf(stderr, "Option requires an argument\n"); xoptind++; /* prevent infinite loop */
xoptplace = 0;
return '?'; return '?';
}
xoptarg = argv[xoptind++];
} else {
/* is attached to option letter */
xoptarg = ap + 1;
++xoptind;
} }
} else { if (p[1] == ':') { /* need an argument */
/* If we are out of letters then go to next arg */ if (xopterr) fprintf(stderr,
if (ap[1] == '\0') { "Option -%c with argument must not be part of "
++xoptind; "multi-character option list\n", xoptopt);
avplace = 0; xoptind++;
xoptplace = 0;
return '?';
} }
if (argv[xoptind][xoptplace+1]) { /* more inline */
xoptarg = NULL; xoptplace++;
} return xoptopt;
return c; }
xoptind++; /* move forward one */
xoptplace = 0;
return xoptopt;
} }
INTERNET-DRAFT SHAs, HMAC-SHAs, and HKDF INTERNET-DRAFT SHAs, HMAC-SHAs, and HKDF
9. IANA Considerations 9. IANA Considerations
This document requires no IANA Actions. The RFC Editor should delete This document requires no IANA Actions. The RFC Editor should delete
this section before publication. this section before publication.
10. Security Considerations 10. Security Considerations
skipping to change at page 127, line 5 skipping to change at page 126, line 16
Edit History Edit History
RFC Editor, Please delete this section on publication. RFC Editor, Please delete this section on publication.
Changes from -00 to -01 Changes from -00 to -01
Add hash function OIDs and informational reference to [RFC4055]. A Add hash function OIDs and informational reference to [RFC4055]. A
few Editorial changes and typo fixes. few Editorial changes and typo fixes.
Changes from -01 to -02
In shatest.c, replace MIT getopt (xgetopt) code with new code to
avoid possible conflict between MIT license and IETF required BSD
license.
INTERNET-DRAFT SHAs, HMAC-SHAs, and HKDF INTERNET-DRAFT SHAs, HMAC-SHAs, and HKDF
Author's Address Author's Address
Donald E. Eastlake, 3rd Donald E. Eastlake, 3rd
Stellar Switches Stellar Switches
155 Beaver Street 155 Beaver Street
Milford, MA 01757 USA Milford, MA 01757 USA
Telephone: +1-508-333-2270 Telephone: +1-508-333-2270
 End of changes. 17 change blocks. 
88 lines changed or deleted 91 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/