Archived
1
0

start preparing for gutting of libsodium dependancy

This commit is contained in:
Jeff Becker 2017-08-26 09:40:24 -04:00
parent 0870b270cc
commit 2983eb6fbd
No known key found for this signature in database
GPG Key ID: F357B3B42F6F9B05
4 changed files with 41 additions and 4 deletions

View File

@ -30,11 +30,16 @@ $(JS): js-deps
$(SRND):
make -C $(SRND_DIR)
$(MAKE) -C $(SRND_DIR)
cp $(SRND_DIR)/srndv2 $(SRND)
pure:
$(MAKE) -C $(SRND_DIR) pure
cp $(SRND_DIR)/srndv2 $(SRND)
clean:
rm -f $(SRND) $(JS)
$(MAKE) -C $(SRND_DIR) clean
distclean: clean
rm -rf $(REPO_GOPATH)

View File

@ -1,10 +1,11 @@
REPO=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
all: clean build
build: srndv2
all: srndv2
srndv2:
GOPATH=$(REPO) go build -v -tags libsodium
pure:
GOPATH=$(REPO) go build -v
clean:

View File

@ -0,0 +1,29 @@
// +build !libsodium
package srnd
import (
"golang.org/x/crypto/curve25519"
)
func naclCryptoVerifyFucky(h, sig, pk []byte) bool {
return false
}
func naclCryptoSignFucky(hash, sk []byte) []byte {
return nil
}
func naclCryptoVerifyDetached(hash, sig, pk []byte) bool {
return false
}
func naclCryptoSignDetached(hash, sk []byte) []byte {
return nil
}
func naclSeedToKeyPair(seed []byte) (pk, sk []byte) {
return
}
var naclScalarBaseMult = curve25519.ScalarBaseMult

View File

@ -1,3 +1,5 @@
// +build libsodium
package srnd
import (