Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
aes.hpp
Go to the documentation of this file.
1#pragma once
4#include <fc/uint128.hpp>
5#include <fc/fwd.hpp>
6#include <vector>
7
8namespace fc {
9 class path;
10
12 {
13 public:
14 void init( const fc::sha256& key, const fc::uint128& init_value );
15 uint32_t encode( const char* plaintxt, uint32_t len, char* ciphertxt );
16 // uint32_t final_encode( char* ciphertxt );
17
18 private:
19 struct impl;
21 };
23 {
24 public:
25 void init( const fc::sha256& key, const fc::uint128& init_value );
26 uint32_t decode( const char* ciphertxt, uint32_t len, char* plaintext );
27// uint32_t final_decode( char* plaintext );
28
29 private:
30 struct impl;
32 };
33
34 unsigned aes_encrypt(unsigned char *plaintext, int plaintext_len, unsigned char *key,
35 unsigned char *iv, unsigned char *ciphertext);
36 unsigned aes_decrypt(unsigned char *ciphertext, int ciphertext_len, unsigned char *key,
37 unsigned char *iv, unsigned char *plaintext);
38 unsigned aes_cfb_decrypt(unsigned char *ciphertext, int ciphertext_len, unsigned char *key,
39 unsigned char *iv, unsigned char *plaintext);
40
41 std::vector<char> aes_encrypt( const fc::sha512& key, const std::vector<char>& plain_text );
42 std::vector<char> aes_decrypt( const fc::sha512& key, const std::vector<char>& cipher_text );
43
47 void aes_save( const fc::path& file, const fc::sha512& key, std::vector<char> plain_text );
48
52 std::vector<char> aes_load( const fc::path& file, const fc::sha512& key );
53
54} // namespace fc
uint32_t decode(const char *ciphertxt, uint32_t len, char *plaintext)
Definition aes.cpp:116
uint32_t encode(const char *plaintxt, uint32_t len, char *ciphertxt)
Definition aes.cpp:57
Used to forward declare value types.
Definition fwd.hpp:11
wraps boost::filesystem::path to provide platform independent path manipulation.
an implementation of 128 bit unsigned integer
Definition uint128.hpp:22
void init()
Definition lib_test.cpp:3
namespace sysio::chain
Definition authority.cpp:3
unsigned aes_decrypt(unsigned char *ciphertext, int ciphertext_len, unsigned char *key, unsigned char *iv, unsigned char *plaintext)
Definition aes.cpp:208
unsigned aes_cfb_decrypt(unsigned char *ciphertext, int ciphertext_len, unsigned char *key, unsigned char *iv, unsigned char *plaintext)
Definition aes.cpp:257
unsigned aes_encrypt(unsigned char *plaintext, int plaintext_len, unsigned char *key, unsigned char *iv, unsigned char *ciphertext)
Definition aes.cpp:159
void aes_save(const fc::path &file, const fc::sha512 &key, std::vector< char > plain_text)
Definition aes.cpp:331
std::vector< char > aes_load(const fc::path &file, const fc::sha512 &key)
Definition aes.cpp:347
unsigned int uint32_t
Definition stdint.h:126
size_t len