_________ __                 __
        /   _____//  |_____________ _/  |______     ____  __ __  ______
        \_____  \\   __\_  __ \__  \\   __\__  \   / ___\|  |  \/  ___/
        /        \|  |  |  | \// __ \|  |  / __ \_/ /_/  >  |  /\___ \
       /_______  /|__|  |__|  (____  /__| (____  /\___  /|____//____  >
               \/                  \/          \//_____/            \/
    ______________________                           ______________________
                          T H E   W A R   B E G I N S
                   Stratagus - A free fantasy real time strategy game engine

Namespaces | Macros | Typedefs | Enumerations | Functions
xsha1.h File Reference
#include <cstdint>
#include <cstdio>
#include <cstring>

Go to the source code of this file.

Namespaces

 pvpgn
 

Macros

#define ROTL(x, n, w)   (((x)<<((n)&(w-1))) | ((x)>>(((-(n))&(w-1)))))
 
#define ROTL32(x, n)   ROTL(x,n,32)
 
#define ROTL16(x, n)   ROTL(x,n,16)
 

Typedefs

using pvpgn::bn_basic = std::uint8_t
 
using pvpgn::bn_byte = bn_basic[1]
 
using pvpgn::bn_short = bn_basic[2]
 
using pvpgn::bn_int = bn_basic[4]
 
using pvpgn::bn_long = bn_basic[8]
 
using pvpgn::t_hash = std::uint32_t[5]
 

Enumerations

enum  pvpgn::t_hash_variant { pvpgn::do_blizzard_hash, pvpgn::do_sha1_hash }
 

Functions

int pvpgn::bn_int_set (bn_int *dst, std::uint32_t src)
 
int pvpgn::bn_int_nset (bn_int *dst, std::uint32_t src)
 
std::uint32_t pvpgn::bn_int_get (bn_int const src)
 
static void pvpgn::hash_init (t_hash *hash)
 
static void pvpgn::do_hash (t_hash *hash, std::uint32_t *tmp)
 
static void pvpgn::hash_set_16 (std::uint32_t *dst, unsigned char const *src, unsigned int count, t_hash_variant hash_variant)
 
static void pvpgn::do_hash (t_hash *hash, std::uint32_t *tmp, t_hash_variant hash_variant)
 
int pvpgn::bnet_hash (t_hash *hashout, unsigned int size, void const *datain)
 
static void pvpgn::hash_set_length (std::uint32_t *dst, unsigned int size)
 
int pvpgn::sha1_hash (t_hash *hashout, unsigned int size, void const *datain)
 
int pvpgn::little_endian_sha1_hash (t_hash *hashout, unsigned int size, void const *datain)
 
int pvpgn::hash_eq (t_hash const h1, t_hash const h2)
 
const char * pvpgn::hash_get_str (t_hash const hash)
 
const char * pvpgn::little_endian_hash_get_str (t_hash const hash)
 
int pvpgn::hash_set_str (t_hash *hash, char const *str)
 
void pvpgn::bnhash_to_hash (bn_int const *bnhash, t_hash *hash)
 
void pvpgn::hash_to_bnhash (t_hash const *hash, bn_int *bnhash)
 

Macro Definition Documentation

◆ ROTL

#define ROTL (   x,
  n,
 
)    (((x)<<((n)&(w-1))) | ((x)>>(((-(n))&(w-1)))))

◆ ROTL16

#define ROTL16 (   x,
 
)    ROTL(x,n,16)

◆ ROTL32

#define ROTL32 (   x,
 
)    ROTL(x,n,32)
(C) Copyright 1998-2012 by The Stratagus Project under the GNU General Public License.
All trademarks and copyrights on this page are owned by their respective owners.