Skip to content

Commit e16fbe4

Browse files
committed
fixed size verification for very small output sizes
1 parent 0955639 commit e16fbe4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/de/ntcomputer/crypto/hash/HashCondenser.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ private HashCondenser(MessageDigest md, int outputSize) {
3838
this.outputSize = outputSize;
3939
digestLength = md.getDigestLength();
4040
if(digestLength==0) throw new IllegalArgumentException("could not determine message digest length (returned 0)");
41-
if(this.outputSize < this.digestLength) throw new IllegalArgumentException("output size is less than message digest length");
41+
if(this.outputSize < LONG_SIZE + this.digestLength) throw new IllegalArgumentException("output size is less than message digest length + overhead for one long value");
4242
this.hashCount = (this.outputSize - LONG_SIZE) / digestLength;
4343
}
4444

0 commit comments

Comments
 (0)