Litecoin: Adapt scrypt code to C++

This commit is contained in:
pooler 2013-05-24 11:19:56 +02:00 committed by Warren Togami
parent 2acab1baf1
commit d6e580d43f
2 changed files with 3 additions and 11 deletions

View File

@ -73,11 +73,11 @@ typedef struct HMAC_SHA256Context {
/* Initialize an HMAC-SHA256 operation with the given key. */
static void
HMAC_SHA256_Init(HMAC_SHA256_CTX *ctx, const unsigned char *_K, size_t Klen)
HMAC_SHA256_Init(HMAC_SHA256_CTX *ctx, const void *_K, size_t Klen)
{
unsigned char pad[64];
unsigned char khash[32];
const unsigned char *K = _K;
const unsigned char *K = (const unsigned char *)_K;
size_t i;
/* If Klen > 64, the key is really SHA256(K). */

View File

@ -1,17 +1,9 @@
#ifndef SCRYPT_H
#define SCRYPT_H
#ifdef __cplusplus
extern "C" {
#endif
#define SCRYPT_SCRATCHPAD_SIZE (131072 + 63)
static const int SCRYPT_SCRATCHPAD_SIZE = 131072 + 63;
void scrypt_1024_1_1_256_sp(const char *input, char *output, char *scratchpad);
void scrypt_1024_1_1_256(const char *input, char *output);
#ifdef __cplusplus
}
#endif
#endif