#pragma once #include #include "types.hh" #include "serialise.hh" namespace nix { extern const string base32Chars; typedef enum { htUnknown = 0, htMD5 = GCRY_MD_MD5, htSHA1 = GCRY_MD_SHA1, htSHA256 = GCRY_MD_SHA256, htSHA512 = GCRY_MD_SHA512, htSHA3_256 = GCRY_MD_SHA3_256, htSHA3_512 = GCRY_MD_SHA3_512, htBLAKE2s_256 = GCRY_MD_BLAKE2S_256 } HashType; struct Hash { static const unsigned int maxHashSize = 64; unsigned int hashSize; unsigned char hash[maxHashSize]; HashType type; /* Create an unusable hash object. */ Hash(); /* Create a zero-filled hash object. */ Hash(HashType type); /* Check whether two hash are equal. */ bool operator == (const Hash & h2) const; /* Check whether two hash are not equal. */ bool operator != (const Hash & h2) const; /* For sorting. */ bool operator < (const Hash & h) const; }; /* Convert a hash to a hexadecimal representation. */ string printHash(const Hash & hash); /* Parse a hexadecima
aboutsummaryrefslogtreecommitdiff
path: root/gnu/bootloader
diff options
context:
space:
mode: