MistServer  2.5.3-Pro-19-gf5e75b1 ( Generic_64)
Namespaces | Functions
auth.cpp File Reference
#include "auth.h"
#include <string.h>
#include <stdio.h>
#include <inttypes.h>
#include <sstream>
#include <iomanip>

Namespaces

 Secure
 

Functions

std::string Secure::hmac (std::string msg, std::string key, unsigned int hashSize, void hasher(const char *, const unsigned int, char *), unsigned int blockSize)
 Performs HMAC on msg with given key. More...
 
std::string Secure::hmac (const char *msg, const unsigned int msg_len, const char *key, const unsigned int key_len, unsigned int hashSize, void hasher(const char *, const unsigned int, char *), unsigned int blockSize)
 Performs HMAC on msg with given key. More...
 
std::string Secure::hmac_sha256 (std::string msg, std::string key)
 Convenience function that returns the hexadecimal alphanumeric HMAC-SHA256 of msg and key. More...
 
std::string Secure::hmac_sha256 (const char *msg, const unsigned int msg_len, const char *key, const unsigned int key_len)
 Convenience function that returns the hexadecimal alphanumeric HMAC-SHA256 of msg and key. More...
 
void Secure::hmac_sha256bin (const char *msg, const unsigned int msg_len, const char *key, const unsigned int key_len, char *output)
 Convenience function that sets output to the HMAC-SHA256 of msg and key in binary format. More...
 
void Secure::hmacbin (const char *msg, const unsigned int msg_len, const char *key, const unsigned int key_len, unsigned int hashSize, void hasher(const char *, const unsigned int, char *), unsigned int blockSize, char *output)
 Performs HMAC on msg with given key. More...
 
std::string Secure::md5 (std::string input)
 Calculates a MD5 digest as per rfc1321, returning it as a hexadecimal alphanumeric string. More...
 
std::string Secure::md5 (const char *input, const unsigned int in_len)
 Calculates a MD5 digest as per rfc1321, returning it as a hexadecimal alphanumeric string. More...
 
static void Secure::md5_add64 (uint32_t *hash, const char *data)
 Adds 64 bytes of data to the current MD5 hash. More...
 
void Secure::md5bin (const char *input, const unsigned int in_len, char *output)
 Calculates a MD5 digest as per rfc1321, returning it as binary. More...
 
static uint32_t Secure::rr (uint32_t x, uint32_t c)
 Right rotate function. Shifts bytes off the least significant end, wrapping them to the most significant end. More...
 
std::string Secure::sha256 (std::string input)
 Calculates a SHA256 digest as per NSAs SHA-2, returning it as a hexadecimal alphanumeric string. More...
 
std::string Secure::sha256 (const char *input, const unsigned int in_len)
 Calculates a SHA256 digest as per NSAs SHA-2, returning it as a hexadecimal alphanumeric string. More...
 
static void Secure::sha256_add64 (uint32_t *hash, const char *data)
 Adds 64 bytes of data to the current SHA256 hash. More...
 
void Secure::sha256bin (const char *input, const unsigned int in_len, char *output)
 Calculates a SHA256 digest as per NSAs SHA-2, returning it as binary. More...