View on GitHub

Vistle

Distributed Data-parallel Scientific Visualization in VR

crypto.h
Go to the documentation of this file.
1#ifndef VISTLE_UTIL_CRYPTO_H
2#define VISTLE_UTIL_CRYPTO_H
3
4#include "export.h"
5
6#include <cstdint>
7#include <cstdlib>
8#include <vector>
9#include <string>
10
11namespace vistle {
12namespace crypto {
13
14V_UTILEXPORT bool initialize(size_t secret_size = 64);
15V_UTILEXPORT bool set_session_key(const std::string &hex_key);
16V_UTILEXPORT std::string get_session_key();
17
18V_UTILEXPORT const std::vector<uint8_t> &session_data();
19V_UTILEXPORT const std::vector<uint8_t> &session_key();
20
21V_UTILEXPORT std::vector<uint8_t> random_data(size_t length);
22V_UTILEXPORT std::vector<uint8_t> compute_mac(const void *data, size_t length, const std::vector<uint8_t> &key);
23V_UTILEXPORT bool verify_mac(const void *data, size_t length, const std::vector<uint8_t> &key,
24 const std::vector<uint8_t> &mac);
25
26} // namespace crypto
27} // namespace vistle
28#endif
const std::vector< uint8_t > & session_data()
Definition: crypto.cpp:163
std::vector< uint8_t > random_data(size_t length)
Definition: crypto.cpp:110
bool set_session_key(const std::string &hex_key)
Definition: crypto.cpp:88
const std::vector< uint8_t > & session_key()
Definition: crypto.cpp:174
std::string get_session_key()
Definition: crypto.cpp:103
bool verify_mac(const void *data, size_t length, const std::vector< uint8_t > &key, const std::vector< uint8_t > &mac)
Definition: crypto.cpp:143
bool initialize(size_t secret_size)
Definition: crypto.cpp:40
std::vector< uint8_t > compute_mac(const void *data, size_t length, const std::vector< uint8_t > &key)
Definition: crypto.cpp:122
Definition: allobjects.cpp:30
#define V_UTILEXPORT
Definition: export.h:19