]> Cypherpunks.ru repositories - pyssss.git/blobdiff - ssss.py
Depend on updated pygost
[pyssss.git] / ssss.py
diff --git a/ssss.py b/ssss.py
index 0abe82353cb45b2528171ef4ae431b52ed4f67f5..f8ce9589b04b0719cf238c3baca5196f81e8a57f 100644 (file)
--- a/ssss.py
+++ b/ssss.py
@@ -1,6 +1,6 @@
 # coding: utf-8
 # pyssss -- Pure Python Shamir's secret sharing scheme implementation
-# Copyright (C) 2015 Sergey Matveev <stargrave@stargrave.org>
+# Copyright (C) 2015-2016 Sergey Matveev <stargrave@stargrave.org>
 #
 # This program is free software: you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -21,8 +21,8 @@ https://en.wikipedia.org/wiki/Shamir%27s_Secret_Sharing
 
 from os import urandom
 
-from pygost.gost3410 import bytes2long
-from pygost.gost3410 import long2bytes
+from pygost.utils import bytes2long
+from pygost.utils import long2bytes
 
 
 SECRET_LEN = 32
@@ -93,7 +93,7 @@ def split(secret, n, t):
     if n < 0 or t < 0 or n < t or not secret:
         raise ValueError("Invalid parameters specified")
     for i in xrange(1, t):
-        coef.append(bytes2long(urandom(SECRET_LEN)[::-1]))
+        coef.append(bytes2long(urandom(SECRET_LEN)))
     out = []
     for i in xrange(1, n + 1):
         out.append((i, long2bytes(_horner(t, i, coef))[::-1]))