aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/box.c
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2015-10-20 03:11:50 +0300
committerEgor Tensin <Egor.Tensin@gmail.com>2015-10-20 03:11:50 +0300
commitf9665896e3deb6c449c764ba8b30f700abe36cd5 (patch)
tree4203b64ccf2fb8ad4d40f20edad8aeff9448ab63 /src/box.c
parentadd missing `assert`s (diff)
downloadaes-tools-f9665896e3deb6c449c764ba8b30f700abe36cd5.tar.gz
aes-tools-f9665896e3deb6c449c764ba8b30f700abe36cd5.zip
cxx: implement "boxes"
Diffstat (limited to '')
-rw-r--r--src/box.c60
1 files changed, 60 insertions, 0 deletions
diff --git a/src/box.c b/src/box.c
index 5f63063..8869f69 100644
--- a/src/box.c
+++ b/src/box.c
@@ -620,3 +620,63 @@ AesNI_StatusCode aesni_box_decrypt_buffer(
return status;
}
}
+
+AesNI_StatusCode aesni_box_parse_block(
+ AesNI_BoxBlock* dest,
+ AesNI_Algorithm algorithm,
+ const char* src,
+ AesNI_ErrorDetails* err_details)
+{
+ if (dest == NULL)
+ return aesni_error_null_argument(err_details, "dest");
+ if (src == NULL)
+ return aesni_error_null_argument(err_details, "src");
+
+ return aesni_box_algorithms[algorithm]->parse_block(
+ dest, src, err_details);
+}
+
+AesNI_StatusCode aesni_box_parse_key(
+ AesNI_BoxKey* dest,
+ AesNI_Algorithm algorithm,
+ const char* src,
+ AesNI_ErrorDetails* err_details)
+{
+ if (dest == NULL)
+ return aesni_error_null_argument(err_details, "dest");
+ if (src == NULL)
+ return aesni_error_null_argument(err_details, "src");
+
+ return aesni_box_algorithms[algorithm]->parse_key(
+ dest, src, err_details);
+}
+
+AesNI_StatusCode aesni_box_format_block(
+ AesNI_BoxBlockString* dest,
+ AesNI_Algorithm algorithm,
+ const AesNI_BoxBlock* src,
+ AesNI_ErrorDetails* err_details)
+{
+ if (dest == NULL)
+ return aesni_error_null_argument(err_details, "dest");
+ if (src == NULL)
+ return aesni_error_null_argument(err_details, "src");
+
+ return aesni_box_algorithms[algorithm]->format_block(
+ dest, src, err_details);
+}
+
+AesNI_StatusCode aesni_box_format_key(
+ AesNI_BoxKeyString* dest,
+ AesNI_Algorithm algorithm,
+ const AesNI_BoxKey* src,
+ AesNI_ErrorDetails* err_details)
+{
+ if (dest == NULL)
+ return aesni_error_null_argument(err_details, "dest");
+ if (src == NULL)
+ return aesni_error_null_argument(err_details, "src");
+
+ return aesni_box_algorithms[algorithm]->format_key(
+ dest, src, err_details);
+}