diff options
author | Jack Lloyd <[email protected]> | 2017-09-22 19:12:02 -0400 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2017-09-22 19:12:02 -0400 |
commit | 70a46a5b9059aa6b08a8f206406d1e856544ea3e (patch) | |
tree | dbde17d96768c18f76e298600aedae6fd67ab3f5 /src/lib | |
parent | 834533f5eff98ec308b8097c5709b039636aeba4 (diff) |
Reject very small inputs to the package transform
Causes breakage - #825
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/misc/aont/package.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/lib/misc/aont/package.cpp b/src/lib/misc/aont/package.cpp index 9c106e1d0..c9dd3dada 100644 --- a/src/lib/misc/aont/package.cpp +++ b/src/lib/misc/aont/package.cpp @@ -18,6 +18,9 @@ void aont_package(RandomNumberGenerator& rng, const uint8_t input[], size_t input_len, uint8_t output[]) { + if(input_len <= 1) + throw Encoding_Error("Package transform cannot encode small inputs"); + const size_t BLOCK_SIZE = cipher->block_size(); if(!cipher->valid_keylength(BLOCK_SIZE)) |