CernVM-FS  2.9.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
hash.h File Reference
#include <stdint.h>
#include <cassert>
#include <cctype>
#include <cstdlib>
#include <cstring>
#include <string>
#include "logging.h"
#include "prng.h"
#include "smalloc.h"
Include dependency graph for hash.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  shash::HexPtr
 
struct  shash::AsciiPtr
 
struct  shash::Digest< digest_size_, algorithm_ >
 
class  shash::Digest< digest_size_, algorithm_ >::Hex
 
struct  shash::Md5
 
struct  shash::Sha1
 
struct  shash::Rmd160
 
struct  shash::Shake128
 
struct  shash::Any
 
class  shash::ContextPtr
 

Namespaces

 shash
 

Typedefs

typedef char shash::Suffix
 

Enumerations

enum  shash::Algorithms {
  shash::kMd5 = 0, shash::kSha1, shash::kRmd160, shash::kShake128,
  shash::kAny
}
 

Functions

unsigned shash::GetContextSize (const Algorithms algorithm)
 
void shash::Init (ContextPtr context)
 
void shash::Update (const unsigned char *buffer, const unsigned buffer_length, ContextPtr context)
 
void shash::Final (ContextPtr context, Any *any_digest)
 
bool shash::HashFile (const std::string &filename, Any *any_digest)
 
bool shash::HashFd (int fd, Any *any_digest)
 
void shash::HashMem (const unsigned char *buffer, const unsigned buffer_size, Any *any_digest)
 
void shash::HashString (const std::string &content, Any *any_digest)
 
void shash::Hmac (const std::string &key, const unsigned char *buffer, const unsigned buffer_size, Any *any_digest)
 
void shash::HmacString (const std::string &key, const std::string &content, Any *any_digest)
 
std::string shash::Hmac256 (const std::string &key, const std::string &content, bool raw_output)
 
std::string shash::Sha256File (const std::string &filename)
 
string shash::Sha256Mem (const unsigned char *buffer, const unsigned buffer_size)
 
std::string shash::Sha256String (const std::string &content)
 
Algorithms shash::ParseHashAlgorithm (const std::string &algorithm_option)
 
Any shash::MkFromHexPtr (const HexPtr hex, const char suffix)
 
Any shash::MkFromSuffixedHexPtr (const HexPtr hex)
 

Variables

const char shash::kSuffixNone = 0
 
const char shash::kSuffixCatalog = 'C'
 
const char shash::kSuffixHistory = 'H'
 
const char shash::kSuffixMicroCatalog = 'L'
 
const char shash::kSuffixPartial = 'P'
 
const char shash::kSuffixTemporary = 'T'
 
const char shash::kSuffixCertificate = 'X'
 
const char shash::kSuffixMetainfo = 'M'
 
const unsigned shash::kDigestSizes []
 
const unsigned shash::kMaxDigestSize = 20
 
const unsigned shash::kMaxContextSize = 256
 
const unsigned shash::kAlgorithmIdSizes []
 
const unsigned shash::kMaxAlgorithmIdentifierSize = 9
 
const unsigned shash::kBlockSizes []