aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/error.c
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2015-06-22 01:52:57 +0300
committerEgor Tensin <Egor.Tensin@gmail.com>2015-06-22 01:52:57 +0300
commit3b705c046c53ee01ba3daed0d0e7468b1a682cbc (patch)
tree65b5769aaac6b4f950a79cd2690fc30c80923571 /src/error.c
parentbugfix & code style (diff)
downloadaes-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 'src/error.c')
-rw-r--r--src/error.c14
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);
}