diff options
author | lloyd <[email protected]> | 2006-09-30 06:13:18 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2006-09-30 06:13:18 +0000 |
commit | e52d871393f180042822950966597d160b9adf70 (patch) | |
tree | f9ae4e2b368eb7390da2fffc6aefbc4de0a6ec4d /src/emsa2.cpp | |
parent | 2d823dfaee1f3fe329f5b2eaf79eb3d9c27943a9 (diff) |
Throw Encoding_Error instead of Invalid_Argument if a signature encoding
operation fails for some reason (typically parameters that the scheme can't
handle).
Diffstat (limited to 'src/emsa2.cpp')
-rw-r--r-- | src/emsa2.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/emsa2.cpp b/src/emsa2.cpp index ab805f335..d30ee8170 100644 --- a/src/emsa2.cpp +++ b/src/emsa2.cpp @@ -34,9 +34,9 @@ SecureVector<byte> EMSA2::encoding_of(const MemoryRegion<byte>& msg, u32bit output_length = (output_bits + 1) / 8; if(msg.size() != hash->OUTPUT_LENGTH) - throw Invalid_Argument("EMSA2::encoding_of: Bad input length"); + throw Encoding_Error("EMSA2::encoding_of: Bad input length"); if(output_length < hash->OUTPUT_LENGTH + 4) - throw Invalid_Argument("EMSA2::encoding_of: Output length is too small"); + throw Encoding_Error("EMSA2::encoding_of: Output length is too small"); bool empty = true; for(u32bit j = 0; j != hash->OUTPUT_LENGTH; ++j) @@ -62,7 +62,7 @@ EMSA2::EMSA2(const std::string& hash_name) { hash_id = ieee1363_hash_id(hash_name); if(hash_id == 0) - throw Invalid_Argument("EMSA2 cannot be used with " + hash->name()); + throw Encoding_Error("EMSA2 cannot be used with " + hash->name()); hash = get_hash(hash_name); empty_hash = hash->final(); } |