zyliutw / pdid

Password-authenticated Decentralized Identities

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Code

  • lib/ contains main PDID procedures including the implementation of modified OPAQUE and HMQV protocols
  • lib/ecc.{c,h} are from Easy-ECC. It is modified (to be compatible with Intel SGX and its SDK) and extended by PDID-related functions (prefixed with pdid_)
  • lib/tweetnacl.{c,h} are from TweetNaCl
  • chaincode/ is the GPM smart contract to be deployed with Hyperledger Fabric Private Chaincode (FPC)

Local tests

Local (emulation) test should work out of box: make && ./local_test For better performance, you can use NaCl instead of TweetNaCl. Install NaCl, change the build path to yours export NACL_PATH=../../nacl-20110221/build/Latitude5280 and compile with the following flags (for x86_64) -I${NACL_PATH}/include/amd64 -L${NACL_PATH}/lib/amd64 -lnacl -DWITH_NACL

The integration test requires FPC deployment.

Hyperledger deployment

  • Generate ./integration_test by make
  • Install FPC as described here (version v1.0.0-rc3 branch.)
export GOPATH=~/
export FPC_PATH=$GOPATH/src/github.com/hyperledger/fabric-private-chaincode
git clone --recursive https://github.com/hyperledger/fabric-private-chaincode.git $FPC_PATH
cd $FPC_PATH/utils/docker
make pull-dev  // download image
make run-dev // enter container
cd $FPC_PATH
make // Build Fabric Private Chaincode
  • Delete original chaincode/ in the container
  • Copy chaincode/ and lib/ to FPC's samples/ (i.e., in the container). Then (in the container) cd samples/chaincode && make clean && make.
  • In another terminal, run ./integration_test and follow its instructions (do not directly run ./test.sh in samples/chaincode after the above step. Some parameter should be defined via ./integration_test)

About

Password-authenticated Decentralized Identities


Languages

Language:C 92.5%Language:CMake 3.0%Language:C++ 2.1%Language:Shell 1.8%Language:Makefile 0.6%