1 /**********************************************************************
3 * Copyright (c) 2005-2006 Cryptocom LTD *
4 * This file is distributed under the same license as OpenSSL *
6 * Declaration of GOST R 34.11-94 hash functions *
7 * uses and gost89.h Doesn't need OpenSSL *
8 **********************************************************************/
14 # if (defined(_WIN32) || defined(_WIN64)) && !defined(__MINGW32__)
15 typedef __int64 ghosthash_len;
16 # elif defined(__arch64__)
17 typedef long ghosthash_len;
19 typedef long long ghosthash_len;
22 typedef struct gost_hash_ctx {
31 /* Initalizes gost hash ctx, including creation of gost cipher ctx */
33 int init_gost_hash_ctx(gost_hash_ctx * ctx,
34 const gost_subst_block * subst_block);
35 void done_gost_hash_ctx(gost_hash_ctx * ctx);
38 * Cleans up all fields, except cipher ctx preparing ctx for computing of new
41 int start_hash(gost_hash_ctx * ctx);
43 /* Hashes block of data */
44 int hash_block(gost_hash_ctx * ctx, const byte * block, size_t length);
47 * Finalizes computation of hash and fills buffer (which should be at least
48 * 32 bytes long) with value of computed hash.
50 int finish_hash(gost_hash_ctx * ctx, byte * hashval);