add initial documentation

Signed-off-by: Avinal Kumar <avinal.xlvii@gmail.com>
This commit is contained in:
2021-03-29 23:49:34 +05:30
parent 16cfb7f016
commit 0cf0c45e74

View File

@@ -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<char> &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<char> &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<char> &input_buf,
std::string const &key, uint64_t in_size) {
uint32_t L = 0, R = 0;