View on GitHub

Vistle

Distributed Data-parallel Scientific Visualization in VR

Namespaces | Functions | Variables
crypto.cpp File Reference
#include "crypto.h"
#include <botan/botan.h>
#include <botan/rng.h>
#include <botan/hex.h>
#include <botan/hmac.h>
#include <botan/sha2_32.h>
#include <memory>
#include <cassert>
#include <cstdlib>
#include <mutex>
#include <iostream>
#include "sysdep.h"
#include "exception.h"
Include dependency graph for crypto.cpp:

Namespaces

namespace  vistle
 
namespace  vistle::crypto
 

Functions

template<typename C , class Container >
static std::vector< C > vistle::crypto::from_secure (const Container &secure)
 
bool vistle::crypto::initialize (size_t secret_size)
 
bool vistle::crypto::set_session_key (const std::string &hex_key)
 
std::string vistle::crypto::get_session_key ()
 
std::vector< uint8_t > vistle::crypto::random_data (size_t length)
 
std::vector< uint8_t > vistle::crypto::compute_mac (const void *data, size_t length, const std::vector< uint8_t > &key)
 
bool vistle::crypto::verify_mac (const void *data, size_t length, const std::vector< uint8_t > &key, const std::vector< uint8_t > &mac)
 
const std::vector< uint8_t > & vistle::crypto::session_data ()
 
const std::vector< uint8_t > & vistle::crypto::session_key ()
 

Variables

static std::recursive_mutex vistle::crypto::s_mutex
 
static bool vistle::crypto::s_initialized = false
 
static std::unique_ptr< Botan::LibraryInitializer > vistle::crypto::s_botan_lib
 
static std::vector< uint8_t > vistle::crypto::s_key
 
static std::vector< uint8_t > vistle::crypto::s_session_data
 
static const char vistle::crypto::mac_algorithm [] = "HMAC(SHA-256)"
 
static std::string vistle::crypto::s_temp_key