From 3b705c046c53ee01ba3daed0d0e7468b1a682cbc Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Mon, 22 Jun 2015 01:52:57 +0300 Subject: 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. --- include/aesni/padding.h | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 include/aesni/padding.h (limited to 'include/aesni/padding.h') 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 + * \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 + +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*); -- cgit v1.2.3