From 0cf0c45e7492c652705584e5abe4a531f66dd2a4 Mon Sep 17 00:00:00 2001 From: Avinal Kumar Date: Mon, 29 Mar 2021 23:49:34 +0530 Subject: [PATCH] add initial documentation Signed-off-by: Avinal Kumar --- src/Encryptor.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/Encryptor.cpp b/src/Encryptor.cpp index 94a5ab7..351767f 100644 --- a/src/Encryptor.cpp +++ b/src/Encryptor.cpp @@ -5,11 +5,23 @@ * @since March 06, 2021 * * Encryptor class implementation + * The Encryptor class is a thin wrapper around Blowfish implmentation to encrypt + * and decrypt the file. */ #include "Encryptor.h" namespace krypto { + +/** + * A wrapper over Blowfish::encrypt() function to encrypt files. + * + * @param input_buf Input char buffer + * @param key Password + * @param in_size Input size of the buffer + * + * @return Size of buffer after encryption + */ uint64_t Encryptor::blowfish_encrypt(std::vector &input_buf, std::string const &key, uint64_t in_size) { uint32_t L = 0, R = 0; @@ -36,6 +48,15 @@ uint64_t Encryptor::blowfish_encrypt(std::vector &input_buf, return input_buf.size(); } +/** + * A wrapper over Blowfish::decrypt() function to decrypt files. + * + * @param input_buf Input char buffer + * @param key Password + * @param in_size Input size of the buffer + * + * @return Size of buffer after decryption + */ uint64_t Encryptor::blowfish_decrypt(std::vector &input_buf, std::string const &key, uint64_t in_size) { uint32_t L = 0, R = 0;