svn rev #24222: branches/camellia-ccm/src/lib/crypto/crypto_tests/
ghudson@MIT.EDU
ghudson at MIT.EDU
Fri Jul 30 16:14:53 EDT 2010
http://src.mit.edu/fisheye/changelog/krb5/?cs=24222
Commit By: ghudson
Log Message:
Fix/clarify some comments in the CMAC test program and untabify it.
Changed Files:
U branches/camellia-ccm/src/lib/crypto/crypto_tests/t_cmac.c
Modified: branches/camellia-ccm/src/lib/crypto/crypto_tests/t_cmac.c
===================================================================
--- branches/camellia-ccm/src/lib/crypto/crypto_tests/t_cmac.c 2010-07-30 20:13:20 UTC (rev 24221)
+++ branches/camellia-ccm/src/lib/crypto/crypto_tests/t_cmac.c 2010-07-30 20:14:53 UTC (rev 24222)
@@ -1,8 +1,8 @@
/* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */
/*
- * lib/crypto/t_hmac.c
+ * lib/crypto/t_cmac.c
*
- * Copyright 2001,2002 by the Massachusetts Institute of Technology.
+ * Copyright 2010 by the Massachusetts Institute of Technology.
* All Rights Reserved.
*
* Export of this software from the United States of America may
@@ -32,9 +32,10 @@
* them.
*
* Ideally we would test AES-CMAC against the expected results in RFC 4493,
- * instead of results we generated ourselves. This was done manually, but is
- * not convenient to do automatically since the AES-128 enc provider has no
- * cbc_mac method and therefore cannot be used with krb5int_cmac_checksum.
+ * instead of Camellia-CMAC against results we generated ourselves. This has
+ * been done manually, but is not convenient to do automatically since the
+ * AES-128 enc provider has no cbc_mac method and therefore cannot be used with
+ * krb5int_cmac_checksum.
*/
#include "k5-int.h"
@@ -85,15 +86,15 @@
static void
check_result(const char *name, const unsigned char *result,
- const unsigned char *expected)
+ const unsigned char *expected)
{
int i;
for (i = 0; i < 16; i++) {
- if (result[i] != expected[i]) {
- fprintf(stderr, "CMAC test vector failure: %s\n", name);
- exit(1);
- }
+ if (result[i] != expected[i]) {
+ fprintf(stderr, "CMAC test vector failure: %s\n", name);
+ exit(1);
+ }
}
}
@@ -126,12 +127,12 @@
assert(krb5int_cmac_checksum(enc, key, &iov, 1, &result) == 0);
check_result("example 2", resultbuf, cmac2);
- /* Example 1. */
+ /* Example 3. */
iov.data.length = 40;
assert(krb5int_cmac_checksum(enc, key, &iov, 1, &result) == 0);
check_result("example 3", resultbuf, cmac3);
- /* Example 1. */
+ /* Example 4. */
iov.data.length = 64;
assert(krb5int_cmac_checksum(enc, key, &iov, 1, &result) == 0);
check_result("example 4", resultbuf, cmac4);
More information about the cvs-krb5
mailing list