Skip to content

Commit

Permalink
fixed litecoin_scrypt build on linux
Browse files Browse the repository at this point in the history
  • Loading branch information
forrestv committed Jan 14, 2012
1 parent 2c02767 commit 275d464
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions litecoin_scrypt/scryptmodule.c
Original file line number Diff line number Diff line change
@@ -1,22 +1,18 @@
//#include "stdint.h"

typedef char uint8_t;

#include <Python.h>

//#include "scrypt.h"

static PyObject *scrypt_getpowhash(PyObject *self, PyObject *args)
{
uint8_t *output;
char *output;
PyObject *value;
PyStringObject *input;
if (!PyArg_ParseTuple(args, "S", &input))
return NULL;
Py_INCREF(input);
output = PyMem_Malloc(32);

scrypt_1024_1_1_256((uint8_t *)PyString_AsString((PyObject*) input), output);
scrypt_1024_1_1_256((char *)PyString_AsString((PyObject*) input), output);
Py_DECREF(input);
value = Py_BuildValue("s#", output, 32);
PyMem_Free(output);
Expand All @@ -30,4 +26,4 @@ static PyMethodDef ScryptMethods[] = {

PyMODINIT_FUNC initltc_scrypt(void) {
(void) Py_InitModule("ltc_scrypt", ScryptMethods);
}
}

0 comments on commit 275d464

Please sign in to comment.