pynacl

Python wrapper for http://nacl.cace-project.eu/
git clone https://code.literati.org/pynacl.git
Log | Files | Refs | README

commit f9109230a81896e3e65abe229b839fc3ba5c5a69
parent 67251bb8377947539fd05ce81c5a7caab3f2625c
Author: Sean Richard Lynch <seanl@literati.org>
Date:   Thu,  3 Oct 2013 22:52:30 -0700

Merge pull request #6 from glaslos/master

Test fixed and minor README changes
Diffstat:
MREADME.md | 17++++++++++++-----
Mtest.py | 4++--
2 files changed, 14 insertions(+), 7 deletions(-)

diff --git a/README.md b/README.md @@ -46,10 +46,17 @@ test.py and the [NaCl documentation](http://nacl.cace-project.eu/). Installation ---------- -First, download NaCl. NaCl does not build with the -fPIC flag and -therefore you must modify a file: +SWIG is required to generate the wrapper: - cd <location of extracted NaCl> + apt-get install swig + +Download pynacl with the embedded NaCL (verify it's the latest version): + + git clone git@github.com:seanlynch/pynacl.git + +NaCl does not build with the -fPIC flag and therefore you must modify a file: + + cd pynacl/nacl-20110221 sed -i "s/$/ -fPIC/" okcompilers/c* If you want the build status output printed to screen, you may also do: @@ -60,9 +67,9 @@ You can then build NaCl with: ./do -Once NaCl is successfully built, you can clone pynacl and run: +Once NaCl is successfully built, you can run: - export NACL_DIR=<location of extracted nacl directory> + cd ../ python setup.py build sudo python setup.py install diff --git a/test.py b/test.py @@ -118,8 +118,8 @@ class ScalarMultTestCase(unittest.TestCase): def test_sharedkey(self): dh_a = nacl.crypto_box_keypair() dh_b = nacl.crypto_box_keypair() - shk_a = nacl.crypto_scalarmult(dh_a[1], dh_b[0]) - shk_b = nacl.crypto_scalarmult(dh_b[1], dh_a[0]) + shk_a = nacl.crypto_scalarmult_curve25519(dh_a[1], dh_b[0]) + shk_b = nacl.crypto_scalarmult_curve25519(dh_b[1], dh_a[0]) self.assertEqual(shk_a, shk_b) def test_known(self):