diff options
author | Egor Tensin <Egor.Tensin@gmail.com> | 2015-06-22 01:52:57 +0300 |
---|---|---|
committer | Egor Tensin <Egor.Tensin@gmail.com> | 2015-06-22 01:52:57 +0300 |
commit | 3b705c046c53ee01ba3daed0d0e7468b1a682cbc (patch) | |
tree | 65b5769aaac6b4f950a79cd2690fc30c80923571 /src/error.c | |
parent | bugfix & code style (diff) | |
download | aes-tools-3b705c046c53ee01ba3daed0d0e7468b1a682cbc.tar.gz aes-tools-3b705c046c53ee01ba3daed0d0e7468b1a682cbc.zip |
boxes: a number of improvements
* Algorithm interfaces are no longer required to load partial blocks,
the space for which is allocated dynamically.
* Padding schemes are now also separated, perhaps in the future to
become a "box" parameter.
Consequently, algorithm interfaces are no longer required to implement
padding either.
Diffstat (limited to '')
-rw-r--r-- | src/error.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/error.c b/src/error.c index fd9136a..10550f3 100644 --- a/src/error.c +++ b/src/error.c @@ -26,7 +26,8 @@ static const char* aesni_strerror_messages[] = "Couldn't parse", "Invalid PKCS7 padding (wrong key?)", "Not implemented", - "Invalid plaintext length", + "Missing padding", + "Couldn't allocate memory", }; const char* aesni_strerror(AesNI_StatusCode ec) @@ -105,6 +106,7 @@ static AesNI_ErrorFormatter err_formatters[] = &aesni_format_error_strerror, &aesni_format_not_implemented_error, &aesni_format_error_strerror, + &aesni_format_error_strerror, }; size_t aesni_format_error( @@ -204,8 +206,14 @@ AesNI_StatusCode aesni_error_not_implemented( return status; } -AesNI_StatusCode aesni_error_invalid_plaintext_length( +AesNI_StatusCode aesni_error_missing_padding( + AesNI_ErrorDetails* err_details) +{ + return aesni_make_error(err_details, AESNI_MISSING_PADDING_ERROR); +} + +AesNI_StatusCode aesni_error_memory_allocation( AesNI_ErrorDetails* err_details) { - return aesni_make_error(err_details, AESNI_INVALID_PLAINTEXT_LENGTH_ERROR); + return aesni_make_error(err_details, AESNI_MEMORY_ALLOCATION_ERROR); } |