3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-07-31 08:23:19 +00:00

switching from unreliable typedefs to precisely sized uint32_t and uint64_t

This commit is contained in:
SlowRiot 2014-11-20 02:03:08 +00:00
parent 76cc2bf7b4
commit 4aae465867
2 changed files with 16 additions and 19 deletions

View file

@ -34,22 +34,19 @@ public:
static std::string from_file(const std::string &filename);
private:
typedef unsigned long int uint32; /* just needs to be at least 32bit */
typedef unsigned long long uint64; /* just needs to be at least 64bit */
static const unsigned int DIGEST_INTS = 5; /* number of 32bit integers per SHA1 digest */
static const unsigned int BLOCK_INTS = 16; /* number of 32bit integers per SHA1 block */
static const unsigned int BLOCK_BYTES = BLOCK_INTS * 4;
uint32 digest[DIGEST_INTS];
uint32_t digest[DIGEST_INTS];
std::string buffer;
uint64 transforms;
uint64_t transforms;
void reset();
void transform(uint32 block[BLOCK_BYTES]);
void transform(uint32_t block[BLOCK_BYTES]);
static void read(std::istream &is, std::string &s, size_t max);
static void buffer_to_block(const std::string &buffer, uint32 block[BLOCK_INTS]);
static void buffer_to_block(const std::string &buffer, uint32_t block[BLOCK_INTS]);
};
std::string sha1(const std::string &string);