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 /include/aesni/padding.h | |
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-- | include/aesni/padding.h | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/include/aesni/padding.h b/include/aesni/padding.h new file mode 100644 index 0000000..f76df16 --- /dev/null +++ b/include/aesni/padding.h @@ -0,0 +1,32 @@ +/** + * \file + * \author Egor Tensin <Egor.Tensin@gmail.com> + * \date 2015 + * \copyright This file is licensed under the terms of the MIT License. + * See LICENSE.txt for details. + */ + +#pragma once + +#include "error.h" + +#include <stdlib.h> + +typedef enum +{ + AESNI_PADDING_PKCS7, +} +AesNI_PaddingMethod; + +AesNI_StatusCode aesni_extract_padding_size( + AesNI_PaddingMethod, + const void* src, + size_t src_size, + size_t* padding_size, + AesNI_ErrorDetails*); + +AesNI_StatusCode aesni_fill_with_padding( + AesNI_PaddingMethod, + void* dest, + size_t padding_size, + AesNI_ErrorDetails*); |