Commits

Kelvin Wong committed 94d8d8d Draft

Default encryption values now match source distribution commandline tool encryption defaults

Comments (0)

Files changed (2)

 static char *g_kwlist[] = {"input", "password", "maxtime", "maxmem", "maxmemfrac", NULL};
 static const size_t g_maxmem_default = 0;
 static const double g_maxmemfrac_default = 0.5;
+static const double g_maxmemfrac_default_enc = 0.125;
 static const double g_maxtime_default = 300.0;
+static const double g_maxtime_default_enc = 5.0;
 
 static PyObject *scrypt_encrypt(PyObject *self, PyObject *args, PyObject *kwargs) {
     PyStringObject *input, *password;
     int inputlen, passwordlen;
     int errorcode;
     size_t maxmem = g_maxmem_default;
-    double maxmemfrac = g_maxmemfrac_default;
-    double maxtime = g_maxtime_default;
+    double maxmemfrac = g_maxmemfrac_default_enc;
+    double maxtime = g_maxtime_default_enc;
     uint8_t *outbuf;
 
     if (!PyArg_ParseTupleAndKeywords(args, kwargs, "SS|dnd", g_kwlist,
 static char *g_kwlist[] = {"input", "password", "maxtime", "maxmem", "maxmemfrac", NULL};
 static const size_t g_maxmem_default = 0;
 static const double g_maxmemfrac_default = 0.5;
+static const double g_maxmemfrac_default_enc = 0.125;
 static const double g_maxtime_default = 300.0;
+static const double g_maxtime_default_enc = 5.0;
 
 static PyObject *scrypt_encrypt(PyObject *self, PyObject *args, PyObject *kwargs) {
     const char *input, *password;
     int inputlen, passwordlen;
     int errorcode;
     size_t maxmem = g_maxmem_default;
-    double maxmemfrac = g_maxmemfrac_default;
-    double maxtime = g_maxtime_default;
+    double maxmemfrac = g_maxmemfrac_default_enc;
+    double maxtime = g_maxtime_default_enc;
     uint8_t *outbuf;
 
     if (!PyArg_ParseTupleAndKeywords(args, kwargs, "s#s#|dnd", g_kwlist,