21.03.2013 Views

Problem - Kevin Tafuro

Problem - Kevin Tafuro

Problem - Kevin Tafuro

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Table 6-2. MACs and their properties (continued)<br />

Small message<br />

speed (64<br />

MAC Built upon<br />

bytes)<br />

MAC127 hash127 + AES ~6 cpb ~6 cpb Yes No Yes<br />

OMAC1 AES 29.5 cpb 37 cpb Yes No No<br />

OMAC2 AES 29.5 cpb 37 cpb Yes No No<br />

PMAC-<br />

AES<br />

Block cipher 72 cpb 70 cpb Yes Yes Yes<br />

RMAC Block cipher 89 cpb 80 cpb Yes No No<br />

UMAC32 UHASH and AES 19 cpb cpb No No Yes<br />

XMACC-<br />

SHA1<br />

Any cipher or MD function 162 cpb 29 cpb Yes Yes Yes<br />

a<br />

Large<br />

Patent<br />

message Appropriate restricParallel- speed (8K) for hardware tionsizable a All timing values are best cases based on our empirical testing, and assume that the data being processed is already in cache. Do not<br />

expect that you’ll quite be able to match these speeds in practice.<br />

Note that our considerations for comparing MACs are different from our considerations<br />

for comparing cryptographic hash functions. First, all of the MACs we discuss<br />

provide a reasonable amount of assurance, assuming that the underlying<br />

construct is secure (though MACs without nonces do not resist the birthday attack<br />

without additional work; see Recipe 6.12). Second, all of the cryptographic hash<br />

functions we discussed are suitable for hardware, patent-free, and not parallelizable.<br />

Let’s look briefly at the pros and cons of using these functions.<br />

CMAC<br />

CMAC is the MAC portion of the CWC encryption mode, which can be used in<br />

a standalone fashion. It’s built upon a universal hash function that can be made<br />

to run very fast, especially in hardware. CMAC is discussed in Recipe 6.14.<br />

HMAC<br />

HMAC, discussed in Recipe 6.10, is a widely used MAC, largely because it was<br />

one of the first MAC constructs with provable security—even though the other<br />

MACs on this list also have provable security (and the proofs for those other<br />

MACs tend to be based on somewhat more favorable assumptions). HMAC is<br />

fairly fast, largely because it performs only two cryptographic operations, both<br />

hashes. One of the hashes is constant time; and the other takes time proportional<br />

to the length of the input, but it doesn’t have the large overhead block<br />

ciphers typically do as a result of hash functions having a very large block size<br />

internally (usually 64 bytes).<br />

HMAC is designed to take a one-way hash function with an arbitrary input and<br />

a key to produce a fixed-sized digest. Therefore, it cannot use block ciphers,<br />

unless you use a construction to turn a block cipher into a strong hash function,<br />

which will significantly slow down HMAC. If you want to use a block cipher to<br />

260 | Chapter 6: Hashes and Message Authentication<br />

This is the Title of the Book, eMatter Edition<br />

Copyright © 2007 O’Reilly & Associates, Inc. All rights reserved.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!