This package provides a toolbox of advanced cryptographic primitives for Go, targeting applications like Dissent that need more than straightforward signing and encryption. Please see the GoDoc documentation for this package for details on the library's purpose and functionality.
First make sure you have Go version 1.3 or newer installed.
Install C library dependencies.
OpenSSL: OpenSSL
Pairing-Based Cryptography: PBC
Mac (with homebrew): $ brew install pbc
Otherwise: Install from source.
# Download from source http://crypto.stanford.edu/pbc/download.html
# Unzip the source directory
# cd into the source directory
$ ./configure
$ make
$ make install
Now you can install the crypto library:
go get github.com/dedis/crypto
cd $GOPATH/src/github.com/dedis/crypto
go get ./... # install 3rd-party dependencies
You should then be able to test its basic function as follows:
cd $GOPATH/src/github.com/dedis/crypto
go test -v
You can recursively test all the packages in the library as follows, keeping in mind that some sub-packages will only build if certain dependencies are satisfied as described below:
go test -v ./...
The library's basic functionality depends only on the Go standard library. However, parts of the library will only build if certain other, optional system packages are installed with their header files and libraries (e.g., the "-dev" version of the package). In particular:
-
crypto.openssl: This sub-package is a wrapper that builds on the OpenSSL crypto library to provide a fast, mature implementation of NIST-standardized elliptic curves and symmetric cryptosystems.
-
crypto.pbc: This is a wrapper for the Stanford Pairing-Based Crypto (PBC) library, which will of course only work if the PBC library is installed.
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 the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.