Skip to content

Commit

Permalink
allow make acme use Gm as default crypto lib
Browse files Browse the repository at this point in the history
  • Loading branch information
studyzy committed Jun 16, 2020
1 parent ac9241d commit b1bd944
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 1 deletion.
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ mainnet:
@echo "Done building."
@echo "Run \"./gptn\" to launch mainnet node."

acme:
go build -mod=vendor -tags "gm" ./cmd/gptn
@echo "Done building."
@echo "Run \"./gptn\" to launch acme node."

all:
build/env.sh go run -mod=vendor build/ci.go install

Expand Down
1 change: 0 additions & 1 deletion common/crypto/crypto.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ var (
secp256k1_N, _ = new(big.Int).SetString("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141", 16)
secp256k1_halfN = new(big.Int).Div(secp256k1_N, big.NewInt(2))
)
var MyCryptoLib ICrypto = &CryptoS256{}

// Keccak256 calculates and returns the Keccak256 hash of the input data.
func Keccak256(data ...[]byte) []byte {
Expand Down
26 changes: 26 additions & 0 deletions common/crypto/instance_gm.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// +build gm

/*
*
* This file is part of go-palletone.
* go-palletone 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 3 of the License, or
* (at your option) any later version.
* go-palletone 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 go-palletone. If not, see <http://www.gnu.org/licenses/>.
* /
*
*
* * @author PalletOne core developer <[email protected]>
* * @date 2018-2020
*
*/

package crypto

var MyCryptoLib ICrypto = &CryptoGm{}
26 changes: 26 additions & 0 deletions common/crypto/instance_s256.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// +build !gm

/*
*
* This file is part of go-palletone.
* go-palletone 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 3 of the License, or
* (at your option) any later version.
* go-palletone 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 go-palletone. If not, see <http://www.gnu.org/licenses/>.
* /
*
*
* * @author PalletOne core developer <[email protected]>
* * @date 2018-2020
*
*/

package crypto

var MyCryptoLib ICrypto = &CryptoS256{}

0 comments on commit b1bd944

Please sign in to comment.