Skip to content

Commit 051d742

Browse files
committed
Add more javadoc on a private method.
1 parent 591e034 commit 051d742

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/main/java/org/owasp/esapi/crypto/CipherText.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -795,6 +795,15 @@ protected boolean canEqual(Object other) {
795795
* <pre>
796796
* HMAC-SHA1(nonce, IV + plaintext)
797797
* </pre>
798+
* Note that <i>only</i> HMAC-SHA1 is used for the MAC calcuation. Unlike
799+
* the PRF used for derived key generation in the {@code KeyDerivationFunction}
800+
* class, the user cannot change the algorithm used to compute the MAC itself.
801+
* One reason for that is that we don't want the MAC value to be excessively
802+
* long; 128 bits is already quite long when only encrypting short strings.
803+
* Also while the NSA reviewed this and were okay with it, Bellare, Canetti & Krawczyk
804+
* proved in 1996 [see http://pssic.free.fr/Extra%20Reading/SEC+/SEC+/hmac-cb.pdf] that
805+
* HMAC security doesn’t require that the underlying hash function be collision resistant,
806+
* but only that it acts as a pseudo-random function, which SHA1 satisfies.
798807
* @param ciphertext The ciphertext value for which the MAC is computed.
799808
* @return The value for the MAC.
800809
*/

0 commit comments

Comments
 (0)