Browse Source

Litecoin: Adapt scrypt code to C++

0.8
pooler 12 years ago committed by Warren Togami
parent
commit
d6e580d43f
  1. 4
      src/scrypt.cpp
  2. 10
      src/scrypt.h

4
src/scrypt.cpp

@ -73,11 +73,11 @@ typedef struct HMAC_SHA256Context { @@ -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). */

10
src/scrypt.h

@ -1,17 +1,9 @@ @@ -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

Loading…
Cancel
Save