mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
Delete tests directory
Signed-off-by: Isabel Schöps Thiel @IsabelSchoepd <155141998+IST-Github@users.noreply.github.com>
This commit is contained in:
parent
4d2be91812
commit
f2b61ca622
170 changed files with 0 additions and 5101 deletions
|
|
@ -1,93 +0,0 @@
|
|||
// Copyright 2015 The go-ethereum Authors
|
||||
// This file is part of the go-ethereum library.
|
||||
//
|
||||
// The go-ethereum library is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// The go-ethereum library 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 Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
package tests
|
||||
|
||||
import (
|
||||
"math/rand"
|
||||
"runtime"
|
||||
"testing"
|
||||
|
||||
"github.com/ethereum/go-ethereum/common"
|
||||
"github.com/ethereum/go-ethereum/core/rawdb"
|
||||
)
|
||||
|
||||
func TestBlockchain(t *testing.T) {
|
||||
bt := new(testMatcher)
|
||||
// General state tests are 'exported' as blockchain tests, but we can run them natively.
|
||||
// For speedier CI-runs, the line below can be uncommented, so those are skipped.
|
||||
// For now, in hardfork-times (Berlin), we run the tests both as StateTests and
|
||||
// as blockchain tests, since the latter also covers things like receipt root
|
||||
bt.skipLoad(`^GeneralStateTests/`)
|
||||
|
||||
// Skip random failures due to selfish mining test
|
||||
bt.skipLoad(`.*bcForgedTest/bcForkUncle\.json`)
|
||||
|
||||
// Slow tests
|
||||
bt.slow(`.*bcExploitTest/DelegateCallSpam.json`)
|
||||
bt.slow(`.*bcExploitTest/ShanghaiLove.json`)
|
||||
bt.slow(`.*bcExploitTest/SuicideIssue.json`)
|
||||
bt.slow(`.*/bcForkStressTest/`)
|
||||
bt.slow(`.*/bcGasPricerTest/RPC_API_Test.json`)
|
||||
bt.slow(`.*/bcWalletTest/`)
|
||||
|
||||
// Very slow test
|
||||
bt.skipLoad(`.*/stTimeConsuming/.*`)
|
||||
// test takes a lot for time and goes easily OOM because of sha3 calculation on a huge range,
|
||||
// using 4.6 TGas
|
||||
bt.skipLoad(`.*randomStatetest94.json.*`)
|
||||
|
||||
bt.walk(t, blockTestDir, func(t *testing.T, name string, test *BlockTest) {
|
||||
if runtime.GOARCH == "386" && runtime.GOOS == "windows" && rand.Int63()%2 == 0 {
|
||||
t.Skip("test (randomly) skipped on 32-bit windows")
|
||||
}
|
||||
execBlockTest(t, bt, test)
|
||||
})
|
||||
// There is also a LegacyTests folder, containing blockchain tests generated
|
||||
// prior to Istanbul. However, they are all derived from GeneralStateTests,
|
||||
// which run natively, so there's no reason to run them here.
|
||||
}
|
||||
|
||||
// TestExecutionSpec runs the test fixtures from execution-spec-tests.
|
||||
func TestExecutionSpec(t *testing.T) {
|
||||
if !common.FileExist(executionSpecDir) {
|
||||
t.Skipf("directory %s does not exist", executionSpecDir)
|
||||
}
|
||||
bt := new(testMatcher)
|
||||
|
||||
bt.walk(t, executionSpecDir, func(t *testing.T, name string, test *BlockTest) {
|
||||
execBlockTest(t, bt, test)
|
||||
})
|
||||
}
|
||||
|
||||
func execBlockTest(t *testing.T, bt *testMatcher, test *BlockTest) {
|
||||
if err := bt.checkFailure(t, test.Run(false, rawdb.HashScheme, nil, nil)); err != nil {
|
||||
t.Errorf("test in hash mode without snapshotter failed: %v", err)
|
||||
return
|
||||
}
|
||||
if err := bt.checkFailure(t, test.Run(true, rawdb.HashScheme, nil, nil)); err != nil {
|
||||
t.Errorf("test in hash mode with snapshotter failed: %v", err)
|
||||
return
|
||||
}
|
||||
if err := bt.checkFailure(t, test.Run(false, rawdb.PathScheme, nil, nil)); err != nil {
|
||||
t.Errorf("test in path mode without snapshotter failed: %v", err)
|
||||
return
|
||||
}
|
||||
if err := bt.checkFailure(t, test.Run(true, rawdb.PathScheme, nil, nil)); err != nil {
|
||||
t.Errorf("test in path mode with snapshotter failed: %v", err)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
|
@ -1,377 +0,0 @@
|
|||
// Copyright 2015 The go-ethereum Authors
|
||||
// This file is part of the go-ethereum library.
|
||||
//
|
||||
// The go-ethereum library is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// The go-ethereum library 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 Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
// Package tests implements execution of Ethereum JSON tests.
|
||||
package tests
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/hex"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"math/big"
|
||||
"os"
|
||||
"reflect"
|
||||
|
||||
"github.com/ethereum/go-ethereum/common"
|
||||
"github.com/ethereum/go-ethereum/common/hexutil"
|
||||
"github.com/ethereum/go-ethereum/common/math"
|
||||
"github.com/ethereum/go-ethereum/consensus/beacon"
|
||||
"github.com/ethereum/go-ethereum/consensus/ethash"
|
||||
"github.com/ethereum/go-ethereum/core"
|
||||
"github.com/ethereum/go-ethereum/core/rawdb"
|
||||
"github.com/ethereum/go-ethereum/core/state"
|
||||
"github.com/ethereum/go-ethereum/core/types"
|
||||
"github.com/ethereum/go-ethereum/core/vm"
|
||||
"github.com/ethereum/go-ethereum/params"
|
||||
"github.com/ethereum/go-ethereum/rlp"
|
||||
"github.com/ethereum/go-ethereum/trie"
|
||||
"github.com/ethereum/go-ethereum/trie/triedb/hashdb"
|
||||
"github.com/ethereum/go-ethereum/trie/triedb/pathdb"
|
||||
)
|
||||
|
||||
// A BlockTest checks handling of entire blocks.
|
||||
type BlockTest struct {
|
||||
json btJSON
|
||||
}
|
||||
|
||||
// UnmarshalJSON implements json.Unmarshaler interface.
|
||||
func (t *BlockTest) UnmarshalJSON(in []byte) error {
|
||||
return json.Unmarshal(in, &t.json)
|
||||
}
|
||||
|
||||
type btJSON struct {
|
||||
Blocks []btBlock `json:"blocks"`
|
||||
Genesis btHeader `json:"genesisBlockHeader"`
|
||||
Pre core.GenesisAlloc `json:"pre"`
|
||||
Post core.GenesisAlloc `json:"postState"`
|
||||
BestBlock common.UnprefixedHash `json:"lastblockhash"`
|
||||
Network string `json:"network"`
|
||||
SealEngine string `json:"sealEngine"`
|
||||
}
|
||||
|
||||
type btBlock struct {
|
||||
BlockHeader *btHeader
|
||||
ExpectException string
|
||||
Rlp string
|
||||
UncleHeaders []*btHeader
|
||||
}
|
||||
|
||||
//go:generate go run github.com/fjl/gencodec -type btHeader -field-override btHeaderMarshaling -out gen_btheader.go
|
||||
|
||||
type btHeader struct {
|
||||
Bloom types.Bloom
|
||||
Coinbase common.Address
|
||||
MixHash common.Hash
|
||||
Nonce types.BlockNonce
|
||||
Number *big.Int
|
||||
Hash common.Hash
|
||||
ParentHash common.Hash
|
||||
ReceiptTrie common.Hash
|
||||
StateRoot common.Hash
|
||||
TransactionsTrie common.Hash
|
||||
UncleHash common.Hash
|
||||
ExtraData []byte
|
||||
Difficulty *big.Int
|
||||
GasLimit uint64
|
||||
GasUsed uint64
|
||||
Timestamp uint64
|
||||
BaseFeePerGas *big.Int
|
||||
WithdrawalsRoot *common.Hash
|
||||
BlobGasUsed *uint64
|
||||
ExcessBlobGas *uint64
|
||||
ParentBeaconBlockRoot *common.Hash
|
||||
}
|
||||
|
||||
type btHeaderMarshaling struct {
|
||||
ExtraData hexutil.Bytes
|
||||
Number *math.HexOrDecimal256
|
||||
Difficulty *math.HexOrDecimal256
|
||||
GasLimit math.HexOrDecimal64
|
||||
GasUsed math.HexOrDecimal64
|
||||
Timestamp math.HexOrDecimal64
|
||||
BaseFeePerGas *math.HexOrDecimal256
|
||||
BlobGasUsed *math.HexOrDecimal64
|
||||
ExcessBlobGas *math.HexOrDecimal64
|
||||
}
|
||||
|
||||
func (t *BlockTest) Run(snapshotter bool, scheme string, tracer vm.EVMLogger, postCheck func(error, *core.BlockChain)) (result error) {
|
||||
config, ok := Forks[t.json.Network]
|
||||
if !ok {
|
||||
return UnsupportedForkError{t.json.Network}
|
||||
}
|
||||
// import pre accounts & construct test genesis block & state root
|
||||
var (
|
||||
db = rawdb.NewMemoryDatabase()
|
||||
tconf = &trie.Config{
|
||||
Preimages: true,
|
||||
}
|
||||
)
|
||||
if scheme == rawdb.PathScheme {
|
||||
tconf.PathDB = pathdb.Defaults
|
||||
} else {
|
||||
tconf.HashDB = hashdb.Defaults
|
||||
}
|
||||
// Commit genesis state
|
||||
gspec := t.genesis(config)
|
||||
triedb := trie.NewDatabase(db, tconf)
|
||||
gblock, err := gspec.Commit(db, triedb)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
triedb.Close() // close the db to prevent memory leak
|
||||
|
||||
if gblock.Hash() != t.json.Genesis.Hash {
|
||||
return fmt.Errorf("genesis block hash doesn't match test: computed=%x, test=%x", gblock.Hash().Bytes()[:6], t.json.Genesis.Hash[:6])
|
||||
}
|
||||
if gblock.Root() != t.json.Genesis.StateRoot {
|
||||
return fmt.Errorf("genesis block state root does not match test: computed=%x, test=%x", gblock.Root().Bytes()[:6], t.json.Genesis.StateRoot[:6])
|
||||
}
|
||||
// Wrap the original engine within the beacon-engine
|
||||
engine := beacon.New(ethash.NewFaker())
|
||||
|
||||
cache := &core.CacheConfig{TrieCleanLimit: 0, StateScheme: scheme, Preimages: true}
|
||||
if snapshotter {
|
||||
cache.SnapshotLimit = 1
|
||||
cache.SnapshotWait = true
|
||||
}
|
||||
chain, err := core.NewBlockChain(db, cache, gspec, nil, engine, vm.Config{
|
||||
Tracer: tracer,
|
||||
}, nil, nil)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer chain.Stop()
|
||||
|
||||
validBlocks, err := t.insertBlocks(chain)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
// Import succeeded: regardless of whether the _test_ succeeds or not, schedule
|
||||
// the post-check to run
|
||||
if postCheck != nil {
|
||||
defer postCheck(result, chain)
|
||||
}
|
||||
cmlast := chain.CurrentBlock().Hash()
|
||||
if common.Hash(t.json.BestBlock) != cmlast {
|
||||
return fmt.Errorf("last block hash validation mismatch: want: %x, have: %x", t.json.BestBlock, cmlast)
|
||||
}
|
||||
newDB, err := chain.State()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if err = t.validatePostState(newDB); err != nil {
|
||||
return fmt.Errorf("post state validation failed: %v", err)
|
||||
}
|
||||
// Cross-check the snapshot-to-hash against the trie hash
|
||||
if snapshotter {
|
||||
if err := chain.Snapshots().Verify(chain.CurrentBlock().Root); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
return t.validateImportedHeaders(chain, validBlocks)
|
||||
}
|
||||
|
||||
func (t *BlockTest) genesis(config *params.ChainConfig) *core.Genesis {
|
||||
return &core.Genesis{
|
||||
Config: config,
|
||||
Nonce: t.json.Genesis.Nonce.Uint64(),
|
||||
Timestamp: t.json.Genesis.Timestamp,
|
||||
ParentHash: t.json.Genesis.ParentHash,
|
||||
ExtraData: t.json.Genesis.ExtraData,
|
||||
GasLimit: t.json.Genesis.GasLimit,
|
||||
GasUsed: t.json.Genesis.GasUsed,
|
||||
Difficulty: t.json.Genesis.Difficulty,
|
||||
Mixhash: t.json.Genesis.MixHash,
|
||||
Coinbase: t.json.Genesis.Coinbase,
|
||||
Alloc: t.json.Pre,
|
||||
BaseFee: t.json.Genesis.BaseFeePerGas,
|
||||
BlobGasUsed: t.json.Genesis.BlobGasUsed,
|
||||
ExcessBlobGas: t.json.Genesis.ExcessBlobGas,
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
See https://github.com/ethereum/tests/wiki/Blockchain-Tests-II
|
||||
|
||||
Whether a block is valid or not is a bit subtle, it's defined by presence of
|
||||
blockHeader, transactions and uncleHeaders fields. If they are missing, the block is
|
||||
invalid and we must verify that we do not accept it.
|
||||
|
||||
Since some tests mix valid and invalid blocks we need to check this for every block.
|
||||
|
||||
If a block is invalid it does not necessarily fail the test, if it's invalidness is
|
||||
expected we are expected to ignore it and continue processing and then validate the
|
||||
post state.
|
||||
*/
|
||||
func (t *BlockTest) insertBlocks(blockchain *core.BlockChain) ([]btBlock, error) {
|
||||
validBlocks := make([]btBlock, 0)
|
||||
// insert the test blocks, which will execute all transactions
|
||||
for bi, b := range t.json.Blocks {
|
||||
cb, err := b.decode()
|
||||
if err != nil {
|
||||
if b.BlockHeader == nil {
|
||||
continue // OK - block is supposed to be invalid, continue with next block
|
||||
} else {
|
||||
return nil, fmt.Errorf("block RLP decoding failed when expected to succeed: %v", err)
|
||||
}
|
||||
}
|
||||
// RLP decoding worked, try to insert into chain:
|
||||
blocks := types.Blocks{cb}
|
||||
i, err := blockchain.InsertChain(blocks)
|
||||
if err != nil {
|
||||
if b.BlockHeader == nil {
|
||||
continue // OK - block is supposed to be invalid, continue with next block
|
||||
} else {
|
||||
return nil, fmt.Errorf("block #%v insertion into chain failed: %v", blocks[i].Number(), err)
|
||||
}
|
||||
}
|
||||
if b.BlockHeader == nil {
|
||||
if data, err := json.MarshalIndent(cb.Header(), "", " "); err == nil {
|
||||
fmt.Fprintf(os.Stderr, "block (index %d) insertion should have failed due to: %v:\n%v\n",
|
||||
bi, b.ExpectException, string(data))
|
||||
}
|
||||
return nil, fmt.Errorf("block (index %d) insertion should have failed due to: %v",
|
||||
bi, b.ExpectException)
|
||||
}
|
||||
|
||||
// validate RLP decoding by checking all values against test file JSON
|
||||
if err = validateHeader(b.BlockHeader, cb.Header()); err != nil {
|
||||
return nil, fmt.Errorf("deserialised block header validation failed: %v", err)
|
||||
}
|
||||
validBlocks = append(validBlocks, b)
|
||||
}
|
||||
return validBlocks, nil
|
||||
}
|
||||
|
||||
func validateHeader(h *btHeader, h2 *types.Header) error {
|
||||
if h.Bloom != h2.Bloom {
|
||||
return fmt.Errorf("bloom: want: %x have: %x", h.Bloom, h2.Bloom)
|
||||
}
|
||||
if h.Coinbase != h2.Coinbase {
|
||||
return fmt.Errorf("coinbase: want: %x have: %x", h.Coinbase, h2.Coinbase)
|
||||
}
|
||||
if h.MixHash != h2.MixDigest {
|
||||
return fmt.Errorf("MixHash: want: %x have: %x", h.MixHash, h2.MixDigest)
|
||||
}
|
||||
if h.Nonce != h2.Nonce {
|
||||
return fmt.Errorf("nonce: want: %x have: %x", h.Nonce, h2.Nonce)
|
||||
}
|
||||
if h.Number.Cmp(h2.Number) != 0 {
|
||||
return fmt.Errorf("number: want: %v have: %v", h.Number, h2.Number)
|
||||
}
|
||||
if h.ParentHash != h2.ParentHash {
|
||||
return fmt.Errorf("parent hash: want: %x have: %x", h.ParentHash, h2.ParentHash)
|
||||
}
|
||||
if h.ReceiptTrie != h2.ReceiptHash {
|
||||
return fmt.Errorf("receipt hash: want: %x have: %x", h.ReceiptTrie, h2.ReceiptHash)
|
||||
}
|
||||
if h.TransactionsTrie != h2.TxHash {
|
||||
return fmt.Errorf("tx hash: want: %x have: %x", h.TransactionsTrie, h2.TxHash)
|
||||
}
|
||||
if h.StateRoot != h2.Root {
|
||||
return fmt.Errorf("state hash: want: %x have: %x", h.StateRoot, h2.Root)
|
||||
}
|
||||
if h.UncleHash != h2.UncleHash {
|
||||
return fmt.Errorf("uncle hash: want: %x have: %x", h.UncleHash, h2.UncleHash)
|
||||
}
|
||||
if !bytes.Equal(h.ExtraData, h2.Extra) {
|
||||
return fmt.Errorf("extra data: want: %x have: %x", h.ExtraData, h2.Extra)
|
||||
}
|
||||
if h.Difficulty.Cmp(h2.Difficulty) != 0 {
|
||||
return fmt.Errorf("difficulty: want: %v have: %v", h.Difficulty, h2.Difficulty)
|
||||
}
|
||||
if h.GasLimit != h2.GasLimit {
|
||||
return fmt.Errorf("gasLimit: want: %d have: %d", h.GasLimit, h2.GasLimit)
|
||||
}
|
||||
if h.GasUsed != h2.GasUsed {
|
||||
return fmt.Errorf("gasUsed: want: %d have: %d", h.GasUsed, h2.GasUsed)
|
||||
}
|
||||
if h.Timestamp != h2.Time {
|
||||
return fmt.Errorf("timestamp: want: %v have: %v", h.Timestamp, h2.Time)
|
||||
}
|
||||
if !reflect.DeepEqual(h.BaseFeePerGas, h2.BaseFee) {
|
||||
return fmt.Errorf("baseFeePerGas: want: %v have: %v", h.BaseFeePerGas, h2.BaseFee)
|
||||
}
|
||||
if !reflect.DeepEqual(h.WithdrawalsRoot, h2.WithdrawalsHash) {
|
||||
return fmt.Errorf("withdrawalsRoot: want: %v have: %v", h.WithdrawalsRoot, h2.WithdrawalsHash)
|
||||
}
|
||||
if !reflect.DeepEqual(h.BlobGasUsed, h2.BlobGasUsed) {
|
||||
return fmt.Errorf("blobGasUsed: want: %v have: %v", h.BlobGasUsed, h2.BlobGasUsed)
|
||||
}
|
||||
if !reflect.DeepEqual(h.ExcessBlobGas, h2.ExcessBlobGas) {
|
||||
return fmt.Errorf("excessBlobGas: want: %v have: %v", h.ExcessBlobGas, h2.ExcessBlobGas)
|
||||
}
|
||||
if !reflect.DeepEqual(h.ParentBeaconBlockRoot, h2.ParentBeaconRoot) {
|
||||
return fmt.Errorf("parentBeaconBlockRoot: want: %v have: %v", h.ParentBeaconBlockRoot, h2.ParentBeaconRoot)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (t *BlockTest) validatePostState(statedb *state.StateDB) error {
|
||||
// validate post state accounts in test file against what we have in state db
|
||||
for addr, acct := range t.json.Post {
|
||||
// address is indirectly verified by the other fields, as it's the db key
|
||||
code2 := statedb.GetCode(addr)
|
||||
balance2 := statedb.GetBalance(addr)
|
||||
nonce2 := statedb.GetNonce(addr)
|
||||
if !bytes.Equal(code2, acct.Code) {
|
||||
return fmt.Errorf("account code mismatch for addr: %s want: %v have: %s", addr, acct.Code, hex.EncodeToString(code2))
|
||||
}
|
||||
if balance2.Cmp(acct.Balance) != 0 {
|
||||
return fmt.Errorf("account balance mismatch for addr: %s, want: %d, have: %d", addr, acct.Balance, balance2)
|
||||
}
|
||||
if nonce2 != acct.Nonce {
|
||||
return fmt.Errorf("account nonce mismatch for addr: %s want: %d have: %d", addr, acct.Nonce, nonce2)
|
||||
}
|
||||
for k, v := range acct.Storage {
|
||||
v2 := statedb.GetState(addr, k)
|
||||
if v2 != v {
|
||||
return fmt.Errorf("account storage mismatch for addr: %s, slot: %x, want: %x, have: %x", addr, k, v, v2)
|
||||
}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (t *BlockTest) validateImportedHeaders(cm *core.BlockChain, validBlocks []btBlock) error {
|
||||
// to get constant lookup when verifying block headers by hash (some tests have many blocks)
|
||||
bmap := make(map[common.Hash]btBlock, len(t.json.Blocks))
|
||||
for _, b := range validBlocks {
|
||||
bmap[b.BlockHeader.Hash] = b
|
||||
}
|
||||
// iterate over blocks backwards from HEAD and validate imported
|
||||
// headers vs test file. some tests have reorgs, and we import
|
||||
// block-by-block, so we can only validate imported headers after
|
||||
// all blocks have been processed by BlockChain, as they may not
|
||||
// be part of the longest chain until last block is imported.
|
||||
for b := cm.CurrentBlock(); b != nil && b.Number.Uint64() != 0; b = cm.GetBlockByHash(b.ParentHash).Header() {
|
||||
if err := validateHeader(bmap[b.Hash()].BlockHeader, b); err != nil {
|
||||
return fmt.Errorf("imported block header validation failed: %v", err)
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (bb *btBlock) decode() (*types.Block, error) {
|
||||
data, err := hexutil.Decode(bb.Rlp)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
var b types.Block
|
||||
err = rlp.DecodeBytes(data, &b)
|
||||
return &b, err
|
||||
}
|
||||
|
|
@ -1,111 +0,0 @@
|
|||
// Copyright 2017 The go-ethereum Authors
|
||||
// This file is part of the go-ethereum library.
|
||||
//
|
||||
// The go-ethereum library is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// The go-ethereum library 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 Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
package tests
|
||||
|
||||
import (
|
||||
"math/big"
|
||||
"testing"
|
||||
|
||||
"github.com/ethereum/go-ethereum/params"
|
||||
)
|
||||
|
||||
var (
|
||||
mainnetChainConfig = params.ChainConfig{
|
||||
ChainID: big.NewInt(1),
|
||||
HomesteadBlock: big.NewInt(1150000),
|
||||
DAOForkBlock: big.NewInt(1920000),
|
||||
DAOForkSupport: true,
|
||||
EIP150Block: big.NewInt(2463000),
|
||||
EIP155Block: big.NewInt(2675000),
|
||||
EIP158Block: big.NewInt(2675000),
|
||||
ByzantiumBlock: big.NewInt(4370000),
|
||||
}
|
||||
|
||||
ropstenChainConfig = params.ChainConfig{
|
||||
ChainID: big.NewInt(3),
|
||||
HomesteadBlock: big.NewInt(0),
|
||||
DAOForkBlock: nil,
|
||||
DAOForkSupport: true,
|
||||
EIP150Block: big.NewInt(0),
|
||||
EIP155Block: big.NewInt(10),
|
||||
EIP158Block: big.NewInt(10),
|
||||
ByzantiumBlock: big.NewInt(1_700_000),
|
||||
ConstantinopleBlock: big.NewInt(4_230_000),
|
||||
PetersburgBlock: big.NewInt(4_939_394),
|
||||
IstanbulBlock: big.NewInt(6_485_846),
|
||||
MuirGlacierBlock: big.NewInt(7_117_117),
|
||||
BerlinBlock: big.NewInt(9_812_189),
|
||||
LondonBlock: big.NewInt(10_499_401),
|
||||
TerminalTotalDifficulty: new(big.Int).SetUint64(50_000_000_000_000_000),
|
||||
TerminalTotalDifficultyPassed: true,
|
||||
}
|
||||
)
|
||||
|
||||
func TestDifficulty(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
dt := new(testMatcher)
|
||||
// Not difficulty-tests
|
||||
dt.skipLoad("hexencodetest.*")
|
||||
dt.skipLoad("crypto.*")
|
||||
dt.skipLoad("blockgenesistest\\.json")
|
||||
dt.skipLoad("genesishashestest\\.json")
|
||||
dt.skipLoad("keyaddrtest\\.json")
|
||||
dt.skipLoad("txtest\\.json")
|
||||
|
||||
// files are 2 years old, contains strange values
|
||||
dt.skipLoad("difficultyCustomHomestead\\.json")
|
||||
|
||||
dt.config("Ropsten", ropstenChainConfig)
|
||||
dt.config("Frontier", params.ChainConfig{})
|
||||
|
||||
dt.config("Homestead", params.ChainConfig{
|
||||
HomesteadBlock: big.NewInt(0),
|
||||
})
|
||||
|
||||
dt.config("Byzantium", params.ChainConfig{
|
||||
ByzantiumBlock: big.NewInt(0),
|
||||
})
|
||||
|
||||
dt.config("Frontier", ropstenChainConfig)
|
||||
dt.config("MainNetwork", mainnetChainConfig)
|
||||
dt.config("CustomMainNetwork", mainnetChainConfig)
|
||||
dt.config("Constantinople", params.ChainConfig{
|
||||
ConstantinopleBlock: big.NewInt(0),
|
||||
})
|
||||
dt.config("EIP2384", params.ChainConfig{
|
||||
MuirGlacierBlock: big.NewInt(0),
|
||||
})
|
||||
dt.config("EIP4345", params.ChainConfig{
|
||||
ArrowGlacierBlock: big.NewInt(0),
|
||||
})
|
||||
dt.config("EIP5133", params.ChainConfig{
|
||||
GrayGlacierBlock: big.NewInt(0),
|
||||
})
|
||||
dt.config("difficulty.json", mainnetChainConfig)
|
||||
|
||||
dt.walk(t, difficultyTestDir, func(t *testing.T, name string, test *DifficultyTest) {
|
||||
cfg := dt.findConfig(t)
|
||||
if test.ParentDifficulty.Cmp(params.MinimumDifficulty) < 0 {
|
||||
t.Skip("difficulty below minimum")
|
||||
return
|
||||
}
|
||||
if err := dt.checkFailure(t, test.Run(cfg)); err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
|
@ -1,68 +0,0 @@
|
|||
// Copyright 2017 The go-ethereum Authors
|
||||
// This file is part of the go-ethereum library.
|
||||
//
|
||||
// The go-ethereum library is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// The go-ethereum library 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 Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
package tests
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"math/big"
|
||||
|
||||
"github.com/ethereum/go-ethereum/common"
|
||||
"github.com/ethereum/go-ethereum/common/math"
|
||||
"github.com/ethereum/go-ethereum/consensus/ethash"
|
||||
"github.com/ethereum/go-ethereum/core/types"
|
||||
"github.com/ethereum/go-ethereum/params"
|
||||
)
|
||||
|
||||
//go:generate go run github.com/fjl/gencodec -type DifficultyTest -field-override difficultyTestMarshaling -out gen_difficultytest.go
|
||||
|
||||
type DifficultyTest struct {
|
||||
ParentTimestamp uint64 `json:"parentTimestamp"`
|
||||
ParentDifficulty *big.Int `json:"parentDifficulty"`
|
||||
UncleHash common.Hash `json:"parentUncles"`
|
||||
CurrentTimestamp uint64 `json:"currentTimestamp"`
|
||||
CurrentBlockNumber uint64 `json:"currentBlockNumber"`
|
||||
CurrentDifficulty *big.Int `json:"currentDifficulty"`
|
||||
}
|
||||
|
||||
type difficultyTestMarshaling struct {
|
||||
ParentTimestamp math.HexOrDecimal64
|
||||
ParentDifficulty *math.HexOrDecimal256
|
||||
CurrentTimestamp math.HexOrDecimal64
|
||||
CurrentDifficulty *math.HexOrDecimal256
|
||||
UncleHash common.Hash
|
||||
CurrentBlockNumber math.HexOrDecimal64
|
||||
}
|
||||
|
||||
func (test *DifficultyTest) Run(config *params.ChainConfig) error {
|
||||
parentNumber := big.NewInt(int64(test.CurrentBlockNumber - 1))
|
||||
parent := &types.Header{
|
||||
Difficulty: test.ParentDifficulty,
|
||||
Time: test.ParentTimestamp,
|
||||
Number: parentNumber,
|
||||
UncleHash: test.UncleHash,
|
||||
}
|
||||
|
||||
actual := ethash.CalcDifficulty(config, test.CurrentTimestamp, parent)
|
||||
exp := test.CurrentDifficulty
|
||||
|
||||
if actual.Cmp(exp) != 0 {
|
||||
return fmt.Errorf("parent[time %v diff %v unclehash:%x] child[time %v number %v] diff %v != expected %v",
|
||||
test.ParentTimestamp, test.ParentDifficulty, test.UncleHash,
|
||||
test.CurrentTimestamp, test.CurrentBlockNumber, actual, exp)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
|
@ -1 +0,0 @@
|
|||
Subproject commit d8b88f4046a87d6b902378cef752591f95427b43
|
||||
|
|
@ -1,45 +0,0 @@
|
|||
## Fuzzers
|
||||
|
||||
To run a fuzzer locally, you need [go-fuzz](https://github.com/dvyukov/go-fuzz) installed.
|
||||
|
||||
First build a fuzzing-binary out of the selected package:
|
||||
|
||||
```
|
||||
(cd ./rlp && CGO_ENABLED=0 go-fuzz-build .)
|
||||
```
|
||||
That command should generate a `rlp-fuzz.zip` in the `rlp/` directory. If you are already in that directory, you can do
|
||||
|
||||
```
|
||||
[user@work rlp]$ go-fuzz
|
||||
2019/11/26 13:36:54 workers: 6, corpus: 3 (3s ago), crashers: 0, restarts: 1/0, execs: 0 (0/sec), cover: 0, uptime: 3s
|
||||
2019/11/26 13:36:57 workers: 6, corpus: 3 (6s ago), crashers: 0, restarts: 1/0, execs: 0 (0/sec), cover: 1054, uptime: 6s
|
||||
2019/11/26 13:37:00 workers: 6, corpus: 3 (9s ago), crashers: 0, restarts: 1/8358, execs: 25074 (2786/sec), cover: 1054, uptime: 9s
|
||||
2019/11/26 13:37:03 workers: 6, corpus: 3 (12s ago), crashers: 0, restarts: 1/8497, execs: 50986 (4249/sec), cover: 1054, uptime: 12s
|
||||
2019/11/26 13:37:06 workers: 6, corpus: 3 (15s ago), crashers: 0, restarts: 1/9330, execs: 74640 (4976/sec), cover: 1054, uptime: 15s
|
||||
2019/11/26 13:37:09 workers: 6, corpus: 3 (18s ago), crashers: 0, restarts: 1/9948, execs: 99482 (5527/sec), cover: 1054, uptime: 18s
|
||||
2019/11/26 13:37:12 workers: 6, corpus: 3 (21s ago), crashers: 0, restarts: 1/9428, execs: 122568 (5836/sec), cover: 1054, uptime: 21s
|
||||
2019/11/26 13:37:15 workers: 6, corpus: 3 (24s ago), crashers: 0, restarts: 1/9676, execs: 145152 (6048/sec), cover: 1054, uptime: 24s
|
||||
2019/11/26 13:37:18 workers: 6, corpus: 3 (27s ago), crashers: 0, restarts: 1/9855, execs: 167538 (6205/sec), cover: 1054, uptime: 27s
|
||||
2019/11/26 13:37:21 workers: 6, corpus: 3 (30s ago), crashers: 0, restarts: 1/9645, execs: 192901 (6430/sec), cover: 1054, uptime: 30s
|
||||
2019/11/26 13:37:24 workers: 6, corpus: 3 (33s ago), crashers: 0, restarts: 1/9967, execs: 219294 (6645/sec), cover: 1054, uptime: 33s
|
||||
|
||||
```
|
||||
Otherwise:
|
||||
```
|
||||
go-fuzz -bin ./rlp/rlp-fuzz.zip
|
||||
```
|
||||
|
||||
### Notes
|
||||
|
||||
Once a 'crasher' is found, the fuzzer tries to avoid reporting the same vector twice, so stores the fault in the `suppressions` folder. Thus, if you
|
||||
e.g. make changes to fix a bug, you should _remove_ all data from the `suppressions`-folder, to verify that the issue is indeed resolved.
|
||||
|
||||
Also, if you have only one and the same exit-point for multiple different types of test, the suppression can make the fuzzer hide different types of errors. So make
|
||||
sure that each type of failure is unique (for an example, see the rlp fuzzer, where a counter `i` is used to differentiate between failures:
|
||||
|
||||
```golang
|
||||
if !bytes.Equal(input, output) {
|
||||
panic(fmt.Sprintf("case %d: encode-decode is not equal, \ninput : %x\noutput: %x", i, input, output))
|
||||
}
|
||||
```
|
||||
|
||||
|
|
@ -1,305 +0,0 @@
|
|||
// Copyright 2021 The go-ethereum Authors
|
||||
// This file is part of the go-ethereum library.
|
||||
//
|
||||
// The go-ethereum library is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// The go-ethereum library 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 Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
//go:build cgo
|
||||
// +build cgo
|
||||
|
||||
package bls
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"crypto/rand"
|
||||
"fmt"
|
||||
"io"
|
||||
"math/big"
|
||||
|
||||
"github.com/consensys/gnark-crypto/ecc"
|
||||
gnark "github.com/consensys/gnark-crypto/ecc/bls12-381"
|
||||
"github.com/consensys/gnark-crypto/ecc/bls12-381/fp"
|
||||
"github.com/consensys/gnark-crypto/ecc/bls12-381/fr"
|
||||
"github.com/ethereum/go-ethereum/common"
|
||||
"github.com/ethereum/go-ethereum/crypto/bls12381"
|
||||
blst "github.com/supranational/blst/bindings/go"
|
||||
)
|
||||
|
||||
func fuzzCrossPairing(data []byte) int {
|
||||
input := bytes.NewReader(data)
|
||||
|
||||
// get random G1 points
|
||||
kpG1, cpG1, blG1, err := getG1Points(input)
|
||||
if err != nil {
|
||||
return 0
|
||||
}
|
||||
|
||||
// get random G2 points
|
||||
kpG2, cpG2, blG2, err := getG2Points(input)
|
||||
if err != nil {
|
||||
return 0
|
||||
}
|
||||
|
||||
// compute pairing using geth
|
||||
engine := bls12381.NewPairingEngine()
|
||||
engine.AddPair(kpG1, kpG2)
|
||||
kResult := engine.Result()
|
||||
|
||||
// compute pairing using gnark
|
||||
cResult, err := gnark.Pair([]gnark.G1Affine{*cpG1}, []gnark.G2Affine{*cpG2})
|
||||
if err != nil {
|
||||
panic(fmt.Sprintf("gnark/bls12381 encountered error: %v", err))
|
||||
}
|
||||
|
||||
// compare result
|
||||
if !(bytes.Equal(cResult.Marshal(), bls12381.NewGT().ToBytes(kResult))) {
|
||||
panic("pairing mismatch gnark / geth ")
|
||||
}
|
||||
|
||||
// compute pairing using blst
|
||||
blstResult := blst.Fp12MillerLoop(blG2, blG1)
|
||||
blstResult.FinalExp()
|
||||
res := massageBLST(blstResult.ToBendian())
|
||||
if !(bytes.Equal(res, bls12381.NewGT().ToBytes(kResult))) {
|
||||
panic("pairing mismatch blst / geth")
|
||||
}
|
||||
|
||||
return 1
|
||||
}
|
||||
|
||||
func massageBLST(in []byte) []byte {
|
||||
out := make([]byte, len(in))
|
||||
len := 12 * 48
|
||||
// 1
|
||||
copy(out[0:], in[len-1*48:len])
|
||||
copy(out[1*48:], in[len-2*48:len-1*48])
|
||||
// 2
|
||||
copy(out[6*48:], in[len-3*48:len-2*48])
|
||||
copy(out[7*48:], in[len-4*48:len-3*48])
|
||||
// 3
|
||||
copy(out[2*48:], in[len-5*48:len-4*48])
|
||||
copy(out[3*48:], in[len-6*48:len-5*48])
|
||||
// 4
|
||||
copy(out[8*48:], in[len-7*48:len-6*48])
|
||||
copy(out[9*48:], in[len-8*48:len-7*48])
|
||||
// 5
|
||||
copy(out[4*48:], in[len-9*48:len-8*48])
|
||||
copy(out[5*48:], in[len-10*48:len-9*48])
|
||||
// 6
|
||||
copy(out[10*48:], in[len-11*48:len-10*48])
|
||||
copy(out[11*48:], in[len-12*48:len-11*48])
|
||||
return out
|
||||
}
|
||||
|
||||
func fuzzCrossG1Add(data []byte) int {
|
||||
input := bytes.NewReader(data)
|
||||
|
||||
// get random G1 points
|
||||
kp1, cp1, bl1, err := getG1Points(input)
|
||||
if err != nil {
|
||||
return 0
|
||||
}
|
||||
|
||||
// get random G1 points
|
||||
kp2, cp2, bl2, err := getG1Points(input)
|
||||
if err != nil {
|
||||
return 0
|
||||
}
|
||||
|
||||
// compute kp = kp1 + kp2
|
||||
g1 := bls12381.NewG1()
|
||||
kp := bls12381.PointG1{}
|
||||
g1.Add(&kp, kp1, kp2)
|
||||
|
||||
// compute cp = cp1 + cp2
|
||||
_cp1 := new(gnark.G1Jac).FromAffine(cp1)
|
||||
_cp2 := new(gnark.G1Jac).FromAffine(cp2)
|
||||
cp := new(gnark.G1Affine).FromJacobian(_cp1.AddAssign(_cp2))
|
||||
|
||||
// compare result
|
||||
if !(bytes.Equal(cp.Marshal(), g1.ToBytes(&kp))) {
|
||||
panic("G1 point addition mismatch gnark / geth ")
|
||||
}
|
||||
|
||||
bl3 := blst.P1AffinesAdd([]*blst.P1Affine{bl1, bl2})
|
||||
if !(bytes.Equal(cp.Marshal(), bl3.Serialize())) {
|
||||
panic("G1 point addition mismatch blst / geth ")
|
||||
}
|
||||
|
||||
return 1
|
||||
}
|
||||
|
||||
func fuzzCrossG2Add(data []byte) int {
|
||||
input := bytes.NewReader(data)
|
||||
|
||||
// get random G2 points
|
||||
kp1, cp1, bl1, err := getG2Points(input)
|
||||
if err != nil {
|
||||
return 0
|
||||
}
|
||||
|
||||
// get random G2 points
|
||||
kp2, cp2, bl2, err := getG2Points(input)
|
||||
if err != nil {
|
||||
return 0
|
||||
}
|
||||
|
||||
// compute kp = kp1 + kp2
|
||||
g2 := bls12381.NewG2()
|
||||
kp := bls12381.PointG2{}
|
||||
g2.Add(&kp, kp1, kp2)
|
||||
|
||||
// compute cp = cp1 + cp2
|
||||
_cp1 := new(gnark.G2Jac).FromAffine(cp1)
|
||||
_cp2 := new(gnark.G2Jac).FromAffine(cp2)
|
||||
cp := new(gnark.G2Affine).FromJacobian(_cp1.AddAssign(_cp2))
|
||||
|
||||
// compare result
|
||||
if !(bytes.Equal(cp.Marshal(), g2.ToBytes(&kp))) {
|
||||
panic("G2 point addition mismatch gnark / geth ")
|
||||
}
|
||||
|
||||
bl3 := blst.P2AffinesAdd([]*blst.P2Affine{bl1, bl2})
|
||||
if !(bytes.Equal(cp.Marshal(), bl3.Serialize())) {
|
||||
panic("G1 point addition mismatch blst / geth ")
|
||||
}
|
||||
|
||||
return 1
|
||||
}
|
||||
|
||||
func fuzzCrossG1MultiExp(data []byte) int {
|
||||
var (
|
||||
input = bytes.NewReader(data)
|
||||
gethScalars []*big.Int
|
||||
gnarkScalars []fr.Element
|
||||
gethPoints []*bls12381.PointG1
|
||||
gnarkPoints []gnark.G1Affine
|
||||
)
|
||||
// n random scalars (max 17)
|
||||
for i := 0; i < 17; i++ {
|
||||
// note that geth/crypto/bls12381 works only with scalars <= 32bytes
|
||||
s, err := randomScalar(input, fr.Modulus())
|
||||
if err != nil {
|
||||
break
|
||||
}
|
||||
// get a random G1 point as basis
|
||||
kp1, cp1, _, err := getG1Points(input)
|
||||
if err != nil {
|
||||
break
|
||||
}
|
||||
gethScalars = append(gethScalars, s)
|
||||
var gnarkScalar = &fr.Element{}
|
||||
gnarkScalar = gnarkScalar.SetBigInt(s)
|
||||
gnarkScalars = append(gnarkScalars, *gnarkScalar)
|
||||
|
||||
gethPoints = append(gethPoints, new(bls12381.PointG1).Set(kp1))
|
||||
gnarkPoints = append(gnarkPoints, *cp1)
|
||||
}
|
||||
if len(gethScalars) == 0 {
|
||||
return 0
|
||||
}
|
||||
// compute multi exponentiation
|
||||
g1 := bls12381.NewG1()
|
||||
kp := bls12381.PointG1{}
|
||||
if _, err := g1.MultiExp(&kp, gethPoints, gethScalars); err != nil {
|
||||
panic(fmt.Sprintf("G1 multi exponentiation errored (geth): %v", err))
|
||||
}
|
||||
// note that geth/crypto/bls12381.MultiExp mutates the scalars slice (and sets all the scalars to zero)
|
||||
|
||||
// gnark multi exp
|
||||
cp := new(gnark.G1Affine)
|
||||
cp.MultiExp(gnarkPoints, gnarkScalars, ecc.MultiExpConfig{})
|
||||
|
||||
// compare result
|
||||
if !(bytes.Equal(cp.Marshal(), g1.ToBytes(&kp))) {
|
||||
panic("G1 multi exponentiation mismatch gnark / geth ")
|
||||
}
|
||||
|
||||
return 1
|
||||
}
|
||||
|
||||
func getG1Points(input io.Reader) (*bls12381.PointG1, *gnark.G1Affine, *blst.P1Affine, error) {
|
||||
// sample a random scalar
|
||||
s, err := randomScalar(input, fp.Modulus())
|
||||
if err != nil {
|
||||
return nil, nil, nil, err
|
||||
}
|
||||
|
||||
// compute a random point
|
||||
cp := new(gnark.G1Affine)
|
||||
_, _, g1Gen, _ := gnark.Generators()
|
||||
cp.ScalarMultiplication(&g1Gen, s)
|
||||
cpBytes := cp.Marshal()
|
||||
|
||||
// marshal gnark point -> geth point
|
||||
g1 := bls12381.NewG1()
|
||||
kp, err := g1.FromBytes(cpBytes)
|
||||
if err != nil {
|
||||
panic(fmt.Sprintf("Could not marshal gnark.G1 -> geth.G1: %v", err))
|
||||
}
|
||||
if !bytes.Equal(g1.ToBytes(kp), cpBytes) {
|
||||
panic("bytes(gnark.G1) != bytes(geth.G1)")
|
||||
}
|
||||
|
||||
// marshal gnark point -> blst point
|
||||
scalar := new(blst.Scalar).FromBEndian(common.LeftPadBytes(s.Bytes(), 32))
|
||||
p1 := new(blst.P1Affine).From(scalar)
|
||||
if !bytes.Equal(p1.Serialize(), cpBytes) {
|
||||
panic("bytes(blst.G1) != bytes(geth.G1)")
|
||||
}
|
||||
|
||||
return kp, cp, p1, nil
|
||||
}
|
||||
|
||||
func getG2Points(input io.Reader) (*bls12381.PointG2, *gnark.G2Affine, *blst.P2Affine, error) {
|
||||
// sample a random scalar
|
||||
s, err := randomScalar(input, fp.Modulus())
|
||||
if err != nil {
|
||||
return nil, nil, nil, err
|
||||
}
|
||||
|
||||
// compute a random point
|
||||
cp := new(gnark.G2Affine)
|
||||
_, _, _, g2Gen := gnark.Generators()
|
||||
cp.ScalarMultiplication(&g2Gen, s)
|
||||
cpBytes := cp.Marshal()
|
||||
|
||||
// marshal gnark point -> geth point
|
||||
g2 := bls12381.NewG2()
|
||||
kp, err := g2.FromBytes(cpBytes)
|
||||
if err != nil {
|
||||
panic(fmt.Sprintf("Could not marshal gnark.G2 -> geth.G2: %v", err))
|
||||
}
|
||||
if !bytes.Equal(g2.ToBytes(kp), cpBytes) {
|
||||
panic("bytes(gnark.G2) != bytes(geth.G2)")
|
||||
}
|
||||
|
||||
// marshal gnark point -> blst point
|
||||
// Left pad the scalar to 32 bytes
|
||||
scalar := new(blst.Scalar).FromBEndian(common.LeftPadBytes(s.Bytes(), 32))
|
||||
p2 := new(blst.P2Affine).From(scalar)
|
||||
if !bytes.Equal(p2.Serialize(), cpBytes) {
|
||||
panic("bytes(blst.G2) != bytes(geth.G2)")
|
||||
}
|
||||
|
||||
return kp, cp, p2, nil
|
||||
}
|
||||
|
||||
func randomScalar(r io.Reader, max *big.Int) (k *big.Int, err error) {
|
||||
for {
|
||||
k, err = rand.Int(r, max)
|
||||
if err != nil || k.Sign() > 0 {
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,100 +0,0 @@
|
|||
// Copyright 2023 The go-ethereum Authors
|
||||
// This file is part of the go-ethereum library.
|
||||
//
|
||||
// The go-ethereum library is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// The go-ethereum library 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 Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
//go:build cgo
|
||||
// +build cgo
|
||||
|
||||
package bls
|
||||
|
||||
import "testing"
|
||||
|
||||
func FuzzCrossPairing(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
fuzzCrossPairing(data)
|
||||
})
|
||||
}
|
||||
|
||||
func FuzzCrossG1Add(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
fuzzCrossG1Add(data)
|
||||
})
|
||||
}
|
||||
|
||||
func FuzzCrossG2Add(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
fuzzCrossG2Add(data)
|
||||
})
|
||||
}
|
||||
|
||||
func FuzzCrossG1MultiExp(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
fuzzCrossG1MultiExp(data)
|
||||
})
|
||||
}
|
||||
|
||||
func FuzzG1Add(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
fuzz(blsG1Add, data)
|
||||
})
|
||||
}
|
||||
|
||||
func FuzzG1Mul(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
fuzz(blsG1Mul, data)
|
||||
})
|
||||
}
|
||||
|
||||
func FuzzG1MultiExp(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
fuzz(blsG1MultiExp, data)
|
||||
})
|
||||
}
|
||||
|
||||
func FuzzG2Add(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
fuzz(blsG2Add, data)
|
||||
})
|
||||
}
|
||||
|
||||
func FuzzG2Mul(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
fuzz(blsG2Mul, data)
|
||||
})
|
||||
}
|
||||
|
||||
func FuzzG2MultiExp(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
fuzz(blsG2MultiExp, data)
|
||||
})
|
||||
}
|
||||
|
||||
func FuzzPairing(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
fuzz(blsPairing, data)
|
||||
})
|
||||
}
|
||||
|
||||
func FuzzMapG1(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
fuzz(blsMapG1, data)
|
||||
})
|
||||
}
|
||||
|
||||
func FuzzMapG2(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
fuzz(blsMapG2, data)
|
||||
})
|
||||
}
|
||||
|
|
@ -1,93 +0,0 @@
|
|||
// Copyright 2020 The go-ethereum Authors
|
||||
// This file is part of the go-ethereum library.
|
||||
//
|
||||
// The go-ethereum library is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// The go-ethereum library 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 Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
package bls
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
|
||||
"github.com/ethereum/go-ethereum/common"
|
||||
"github.com/ethereum/go-ethereum/core/vm"
|
||||
)
|
||||
|
||||
const (
|
||||
blsG1Add = byte(10)
|
||||
blsG1Mul = byte(11)
|
||||
blsG1MultiExp = byte(12)
|
||||
blsG2Add = byte(13)
|
||||
blsG2Mul = byte(14)
|
||||
blsG2MultiExp = byte(15)
|
||||
blsPairing = byte(16)
|
||||
blsMapG1 = byte(17)
|
||||
blsMapG2 = byte(18)
|
||||
)
|
||||
|
||||
func checkInput(id byte, inputLen int) bool {
|
||||
switch id {
|
||||
case blsG1Add:
|
||||
return inputLen == 256
|
||||
case blsG1Mul:
|
||||
return inputLen == 160
|
||||
case blsG1MultiExp:
|
||||
return inputLen%160 == 0
|
||||
case blsG2Add:
|
||||
return inputLen == 512
|
||||
case blsG2Mul:
|
||||
return inputLen == 288
|
||||
case blsG2MultiExp:
|
||||
return inputLen%288 == 0
|
||||
case blsPairing:
|
||||
return inputLen%384 == 0
|
||||
case blsMapG1:
|
||||
return inputLen == 64
|
||||
case blsMapG2:
|
||||
return inputLen == 128
|
||||
}
|
||||
panic("programmer error")
|
||||
}
|
||||
|
||||
// The function must return
|
||||
//
|
||||
// - 1 if the fuzzer should increase priority of the
|
||||
// given input during subsequent fuzzing (for example, the input is lexically
|
||||
// correct and was parsed successfully);
|
||||
// - -1 if the input must not be added to corpus even if gives new coverage; and
|
||||
// - 0 otherwise
|
||||
//
|
||||
// other values are reserved for future use.
|
||||
func fuzz(id byte, data []byte) int {
|
||||
// Even on bad input, it should not crash, so we still test the gas calc
|
||||
precompile := vm.PrecompiledContractsBLS[common.BytesToAddress([]byte{id})]
|
||||
gas := precompile.RequiredGas(data)
|
||||
if !checkInput(id, len(data)) {
|
||||
return 0
|
||||
}
|
||||
// If the gas cost is too large (25M), bail out
|
||||
if gas > 25*1000*1000 {
|
||||
return 0
|
||||
}
|
||||
cpy := make([]byte, len(data))
|
||||
copy(cpy, data)
|
||||
_, err := precompile.Run(cpy)
|
||||
if !bytes.Equal(cpy, data) {
|
||||
panic(fmt.Sprintf("input data modified, precompile %d: %x %x", id, data, cpy))
|
||||
}
|
||||
if err != nil {
|
||||
return 0
|
||||
}
|
||||
return 1
|
||||
}
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -1,183 +0,0 @@
|
|||
// Copyright 2018 The go-ethereum Authors
|
||||
// This file is part of the go-ethereum library.
|
||||
//
|
||||
// The go-ethereum library is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// The go-ethereum library 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 Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
package bn256
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"io"
|
||||
"math/big"
|
||||
|
||||
"github.com/consensys/gnark-crypto/ecc/bn254"
|
||||
cloudflare "github.com/ethereum/go-ethereum/crypto/bn256/cloudflare"
|
||||
google "github.com/ethereum/go-ethereum/crypto/bn256/google"
|
||||
)
|
||||
|
||||
func getG1Points(input io.Reader) (*cloudflare.G1, *google.G1, *bn254.G1Affine) {
|
||||
_, xc, err := cloudflare.RandomG1(input)
|
||||
if err != nil {
|
||||
// insufficient input
|
||||
return nil, nil, nil
|
||||
}
|
||||
xg := new(google.G1)
|
||||
if _, err := xg.Unmarshal(xc.Marshal()); err != nil {
|
||||
panic(fmt.Sprintf("Could not marshal cloudflare -> google: %v", err))
|
||||
}
|
||||
xs := new(bn254.G1Affine)
|
||||
if err := xs.Unmarshal(xc.Marshal()); err != nil {
|
||||
panic(fmt.Sprintf("Could not marshal cloudflare -> gnark: %v", err))
|
||||
}
|
||||
return xc, xg, xs
|
||||
}
|
||||
|
||||
func getG2Points(input io.Reader) (*cloudflare.G2, *google.G2, *bn254.G2Affine) {
|
||||
_, xc, err := cloudflare.RandomG2(input)
|
||||
if err != nil {
|
||||
// insufficient input
|
||||
return nil, nil, nil
|
||||
}
|
||||
xg := new(google.G2)
|
||||
if _, err := xg.Unmarshal(xc.Marshal()); err != nil {
|
||||
panic(fmt.Sprintf("Could not marshal cloudflare -> google: %v", err))
|
||||
}
|
||||
xs := new(bn254.G2Affine)
|
||||
if err := xs.Unmarshal(xc.Marshal()); err != nil {
|
||||
panic(fmt.Sprintf("Could not marshal cloudflare -> gnark: %v", err))
|
||||
}
|
||||
return xc, xg, xs
|
||||
}
|
||||
|
||||
// fuzzAdd fuzzez bn256 addition between the Google and Cloudflare libraries.
|
||||
func fuzzAdd(data []byte) int {
|
||||
input := bytes.NewReader(data)
|
||||
xc, xg, xs := getG1Points(input)
|
||||
if xc == nil {
|
||||
return 0
|
||||
}
|
||||
yc, yg, ys := getG1Points(input)
|
||||
if yc == nil {
|
||||
return 0
|
||||
}
|
||||
// Ensure both libs can parse the second curve point
|
||||
// Add the two points and ensure they result in the same output
|
||||
rc := new(cloudflare.G1)
|
||||
rc.Add(xc, yc)
|
||||
|
||||
rg := new(google.G1)
|
||||
rg.Add(xg, yg)
|
||||
|
||||
tmpX := new(bn254.G1Jac).FromAffine(xs)
|
||||
tmpY := new(bn254.G1Jac).FromAffine(ys)
|
||||
rs := new(bn254.G1Affine).FromJacobian(tmpX.AddAssign(tmpY))
|
||||
|
||||
if !bytes.Equal(rc.Marshal(), rg.Marshal()) {
|
||||
panic("add mismatch: cloudflare/google")
|
||||
}
|
||||
|
||||
if !bytes.Equal(rc.Marshal(), rs.Marshal()) {
|
||||
panic("add mismatch: cloudflare/gnark")
|
||||
}
|
||||
return 1
|
||||
}
|
||||
|
||||
// fuzzMul fuzzez bn256 scalar multiplication between the Google and Cloudflare
|
||||
// libraries.
|
||||
func fuzzMul(data []byte) int {
|
||||
input := bytes.NewReader(data)
|
||||
pc, pg, ps := getG1Points(input)
|
||||
if pc == nil {
|
||||
return 0
|
||||
}
|
||||
// Add the two points and ensure they result in the same output
|
||||
remaining := input.Len()
|
||||
if remaining == 0 {
|
||||
return 0
|
||||
}
|
||||
if remaining > 128 {
|
||||
// The evm only ever uses 32 byte integers, we need to cap this otherwise
|
||||
// we run into slow exec. A 236Kb byte integer cause oss-fuzz to report it as slow.
|
||||
// 128 bytes should be fine though
|
||||
return 0
|
||||
}
|
||||
buf := make([]byte, remaining)
|
||||
input.Read(buf)
|
||||
|
||||
rc := new(cloudflare.G1)
|
||||
rc.ScalarMult(pc, new(big.Int).SetBytes(buf))
|
||||
|
||||
rg := new(google.G1)
|
||||
rg.ScalarMult(pg, new(big.Int).SetBytes(buf))
|
||||
|
||||
rs := new(bn254.G1Jac)
|
||||
psJac := new(bn254.G1Jac).FromAffine(ps)
|
||||
rs.ScalarMultiplication(psJac, new(big.Int).SetBytes(buf))
|
||||
rsAffine := new(bn254.G1Affine).FromJacobian(rs)
|
||||
|
||||
if !bytes.Equal(rc.Marshal(), rg.Marshal()) {
|
||||
panic("scalar mul mismatch: cloudflare/google")
|
||||
}
|
||||
if !bytes.Equal(rc.Marshal(), rsAffine.Marshal()) {
|
||||
panic("scalar mul mismatch: cloudflare/gnark")
|
||||
}
|
||||
return 1
|
||||
}
|
||||
|
||||
func fuzzPair(data []byte) int {
|
||||
input := bytes.NewReader(data)
|
||||
pc, pg, ps := getG1Points(input)
|
||||
if pc == nil {
|
||||
return 0
|
||||
}
|
||||
tc, tg, ts := getG2Points(input)
|
||||
if tc == nil {
|
||||
return 0
|
||||
}
|
||||
|
||||
// Pair the two points and ensure they result in the same output
|
||||
clPair := cloudflare.Pair(pc, tc).Marshal()
|
||||
gPair := google.Pair(pg, tg).Marshal()
|
||||
if !bytes.Equal(clPair, gPair) {
|
||||
panic("pairing mismatch: cloudflare/google")
|
||||
}
|
||||
cPair, err := bn254.Pair([]bn254.G1Affine{*ps}, []bn254.G2Affine{*ts})
|
||||
if err != nil {
|
||||
panic(fmt.Sprintf("gnark/bn254 encountered error: %v", err))
|
||||
}
|
||||
|
||||
// gnark uses a different pairing algorithm which might produce
|
||||
// different but also correct outputs, we need to scale the output by s
|
||||
|
||||
u, _ := new(big.Int).SetString("0x44e992b44a6909f1", 0)
|
||||
u_exp2 := new(big.Int).Exp(u, big.NewInt(2), nil) // u^2
|
||||
u_6_exp2 := new(big.Int).Mul(big.NewInt(6), u_exp2) // 6*u^2
|
||||
u_3 := new(big.Int).Mul(big.NewInt(3), u) // 3*u
|
||||
inner := u_6_exp2.Add(u_6_exp2, u_3) // 6*u^2 + 3*u
|
||||
inner.Add(inner, big.NewInt(1)) // 6*u^2 + 3*u + 1
|
||||
u_2 := new(big.Int).Mul(big.NewInt(2), u) // 2*u
|
||||
s := u_2.Mul(u_2, inner) // 2*u(6*u^2 + 3*u + 1)
|
||||
|
||||
gRes := new(bn254.GT)
|
||||
if err := gRes.SetBytes(clPair); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
gRes = gRes.Exp(*gRes, s)
|
||||
if !bytes.Equal(cPair.Marshal(), gRes.Marshal()) {
|
||||
panic("pairing mismatch: cloudflare/gnark")
|
||||
}
|
||||
|
||||
return 1
|
||||
}
|
||||
|
|
@ -1,37 +0,0 @@
|
|||
// Copyright 2023 The go-ethereum Authors
|
||||
// This file is part of the go-ethereum library.
|
||||
//
|
||||
// The go-ethereum library is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// The go-ethereum library 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 Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
package bn256
|
||||
|
||||
import "testing"
|
||||
|
||||
func FuzzAdd(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
fuzzAdd(data)
|
||||
})
|
||||
}
|
||||
|
||||
func FuzzMul(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
fuzzMul(data)
|
||||
})
|
||||
}
|
||||
|
||||
func FuzzPair(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
fuzzPair(data)
|
||||
})
|
||||
}
|
||||
|
|
@ -1,146 +0,0 @@
|
|||
// Copyright 2020 The go-ethereum Authors
|
||||
// This file is part of the go-ethereum library.
|
||||
//
|
||||
// The go-ethereum library is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// The go-ethereum library 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 Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
package difficulty
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/binary"
|
||||
"fmt"
|
||||
"io"
|
||||
"math/big"
|
||||
|
||||
"github.com/ethereum/go-ethereum/consensus/ethash"
|
||||
"github.com/ethereum/go-ethereum/core/types"
|
||||
)
|
||||
|
||||
type fuzzer struct {
|
||||
input io.Reader
|
||||
exhausted bool
|
||||
}
|
||||
|
||||
func (f *fuzzer) read(size int) []byte {
|
||||
out := make([]byte, size)
|
||||
if _, err := f.input.Read(out); err != nil {
|
||||
f.exhausted = true
|
||||
}
|
||||
return out
|
||||
}
|
||||
|
||||
func (f *fuzzer) readSlice(min, max int) []byte {
|
||||
var a uint16
|
||||
binary.Read(f.input, binary.LittleEndian, &a)
|
||||
size := min + int(a)%(max-min)
|
||||
out := make([]byte, size)
|
||||
if _, err := f.input.Read(out); err != nil {
|
||||
f.exhausted = true
|
||||
}
|
||||
return out
|
||||
}
|
||||
|
||||
func (f *fuzzer) readUint64(min, max uint64) uint64 {
|
||||
if min == max {
|
||||
return min
|
||||
}
|
||||
var a uint64
|
||||
if err := binary.Read(f.input, binary.LittleEndian, &a); err != nil {
|
||||
f.exhausted = true
|
||||
}
|
||||
a = min + a%(max-min)
|
||||
return a
|
||||
}
|
||||
func (f *fuzzer) readBool() bool {
|
||||
return f.read(1)[0]&0x1 == 0
|
||||
}
|
||||
|
||||
// Fuzz function must return
|
||||
//
|
||||
// - 1 if the fuzzer should increase priority of the
|
||||
// given input during subsequent fuzzing (for example, the input is lexically
|
||||
// correct and was parsed successfully);
|
||||
// - -1 if the input must not be added to corpus even if gives new coverage; and
|
||||
// - 0 otherwise
|
||||
//
|
||||
// other values are reserved for future use.
|
||||
func fuzz(data []byte) int {
|
||||
f := fuzzer{
|
||||
input: bytes.NewReader(data),
|
||||
exhausted: false,
|
||||
}
|
||||
return f.fuzz()
|
||||
}
|
||||
|
||||
var minDifficulty = big.NewInt(0x2000)
|
||||
|
||||
type calculator func(time uint64, parent *types.Header) *big.Int
|
||||
|
||||
func (f *fuzzer) fuzz() int {
|
||||
// A parent header
|
||||
header := &types.Header{}
|
||||
if f.readBool() {
|
||||
header.UncleHash = types.EmptyUncleHash
|
||||
}
|
||||
// Difficulty can range between 0x2000 (2 bytes) and up to 32 bytes
|
||||
{
|
||||
diff := new(big.Int).SetBytes(f.readSlice(2, 32))
|
||||
if diff.Cmp(minDifficulty) < 0 {
|
||||
diff.Set(minDifficulty)
|
||||
}
|
||||
header.Difficulty = diff
|
||||
}
|
||||
// Number can range between 0 and up to 32 bytes (but not so that the child exceeds it)
|
||||
{
|
||||
// However, if we use astronomic numbers, then the bomb exp karatsuba calculation
|
||||
// in the legacy methods)
|
||||
// times out, so we limit it to fit within reasonable bounds
|
||||
number := new(big.Int).SetBytes(f.readSlice(0, 4)) // 4 bytes: 32 bits: block num max 4 billion
|
||||
header.Number = number
|
||||
}
|
||||
// Both parent and child time must fit within uint64
|
||||
var time uint64
|
||||
{
|
||||
childTime := f.readUint64(1, 0xFFFFFFFFFFFFFFFF)
|
||||
//fmt.Printf("childTime: %x\n",childTime)
|
||||
delta := f.readUint64(1, childTime)
|
||||
//fmt.Printf("delta: %v\n", delta)
|
||||
pTime := childTime - delta
|
||||
header.Time = pTime
|
||||
time = childTime
|
||||
}
|
||||
// Bomb delay will never exceed uint64
|
||||
bombDelay := new(big.Int).SetUint64(f.readUint64(1, 0xFFFFFFFFFFFFFFFe))
|
||||
|
||||
if f.exhausted {
|
||||
return 0
|
||||
}
|
||||
|
||||
for i, pair := range []struct {
|
||||
bigFn calculator
|
||||
u256Fn calculator
|
||||
}{
|
||||
{ethash.FrontierDifficultyCalculator, ethash.CalcDifficultyFrontierU256},
|
||||
{ethash.HomesteadDifficultyCalculator, ethash.CalcDifficultyHomesteadU256},
|
||||
{ethash.DynamicDifficultyCalculator(bombDelay), ethash.MakeDifficultyCalculatorU256(bombDelay)},
|
||||
} {
|
||||
want := pair.bigFn(time, header)
|
||||
have := pair.u256Fn(time, header)
|
||||
if want.Cmp(have) != 0 {
|
||||
panic(fmt.Sprintf("pair %d: want %x have %x\nparent.Number: %x\np.Time: %x\nc.Time: %x\nBombdelay: %v\n", i, want, have,
|
||||
header.Number, header.Time, time, bombDelay))
|
||||
}
|
||||
}
|
||||
return 1
|
||||
}
|
||||
|
|
@ -1,25 +0,0 @@
|
|||
// Copyright 2023 The go-ethereum Authors
|
||||
// This file is part of the go-ethereum library.
|
||||
//
|
||||
// The go-ethereum library is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// The go-ethereum library 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 Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
package difficulty
|
||||
|
||||
import "testing"
|
||||
|
||||
func Fuzz(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
fuzz(data)
|
||||
})
|
||||
}
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -1,198 +0,0 @@
|
|||
// Copyright 2020 The go-ethereum Authors
|
||||
// This file is part of the go-ethereum library.
|
||||
//
|
||||
// The go-ethereum library is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// The go-ethereum library 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 Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
package rangeproof
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/binary"
|
||||
"fmt"
|
||||
"io"
|
||||
|
||||
"github.com/ethereum/go-ethereum/common"
|
||||
"github.com/ethereum/go-ethereum/core/rawdb"
|
||||
"github.com/ethereum/go-ethereum/ethdb/memorydb"
|
||||
"github.com/ethereum/go-ethereum/trie"
|
||||
"golang.org/x/exp/slices"
|
||||
)
|
||||
|
||||
type kv struct {
|
||||
k, v []byte
|
||||
t bool
|
||||
}
|
||||
|
||||
type fuzzer struct {
|
||||
input io.Reader
|
||||
exhausted bool
|
||||
}
|
||||
|
||||
func (f *fuzzer) randBytes(n int) []byte {
|
||||
r := make([]byte, n)
|
||||
if _, err := f.input.Read(r); err != nil {
|
||||
f.exhausted = true
|
||||
}
|
||||
return r
|
||||
}
|
||||
|
||||
func (f *fuzzer) readInt() uint64 {
|
||||
var x uint64
|
||||
if err := binary.Read(f.input, binary.LittleEndian, &x); err != nil {
|
||||
f.exhausted = true
|
||||
}
|
||||
return x
|
||||
}
|
||||
|
||||
func (f *fuzzer) randomTrie(n int) (*trie.Trie, map[string]*kv) {
|
||||
trie := trie.NewEmpty(trie.NewDatabase(rawdb.NewMemoryDatabase(), nil))
|
||||
vals := make(map[string]*kv)
|
||||
size := f.readInt()
|
||||
// Fill it with some fluff
|
||||
for i := byte(0); i < byte(size); i++ {
|
||||
value := &kv{common.LeftPadBytes([]byte{i}, 32), []byte{i}, false}
|
||||
value2 := &kv{common.LeftPadBytes([]byte{i + 10}, 32), []byte{i}, false}
|
||||
trie.MustUpdate(value.k, value.v)
|
||||
trie.MustUpdate(value2.k, value2.v)
|
||||
vals[string(value.k)] = value
|
||||
vals[string(value2.k)] = value2
|
||||
}
|
||||
if f.exhausted {
|
||||
return nil, nil
|
||||
}
|
||||
// And now fill with some random
|
||||
for i := 0; i < n; i++ {
|
||||
k := f.randBytes(32)
|
||||
v := f.randBytes(20)
|
||||
value := &kv{k, v, false}
|
||||
trie.MustUpdate(k, v)
|
||||
vals[string(k)] = value
|
||||
if f.exhausted {
|
||||
return nil, nil
|
||||
}
|
||||
}
|
||||
return trie, vals
|
||||
}
|
||||
|
||||
func (f *fuzzer) fuzz() int {
|
||||
maxSize := 200
|
||||
tr, vals := f.randomTrie(1 + int(f.readInt())%maxSize)
|
||||
if f.exhausted {
|
||||
return 0 // input too short
|
||||
}
|
||||
var entries []*kv
|
||||
for _, kv := range vals {
|
||||
entries = append(entries, kv)
|
||||
}
|
||||
if len(entries) <= 1 {
|
||||
return 0
|
||||
}
|
||||
slices.SortFunc(entries, func(a, b *kv) int {
|
||||
return bytes.Compare(a.k, b.k)
|
||||
})
|
||||
|
||||
var ok = 0
|
||||
for {
|
||||
start := int(f.readInt() % uint64(len(entries)))
|
||||
end := 1 + int(f.readInt()%uint64(len(entries)-1))
|
||||
testcase := int(f.readInt() % uint64(6))
|
||||
index := int(f.readInt() & 0xFFFFFFFF)
|
||||
index2 := int(f.readInt() & 0xFFFFFFFF)
|
||||
if f.exhausted {
|
||||
break
|
||||
}
|
||||
proof := memorydb.New()
|
||||
if err := tr.Prove(entries[start].k, proof); err != nil {
|
||||
panic(fmt.Sprintf("Failed to prove the first node %v", err))
|
||||
}
|
||||
if err := tr.Prove(entries[end-1].k, proof); err != nil {
|
||||
panic(fmt.Sprintf("Failed to prove the last node %v", err))
|
||||
}
|
||||
var keys [][]byte
|
||||
var vals [][]byte
|
||||
for i := start; i < end; i++ {
|
||||
keys = append(keys, entries[i].k)
|
||||
vals = append(vals, entries[i].v)
|
||||
}
|
||||
if len(keys) == 0 {
|
||||
return 0
|
||||
}
|
||||
var first = keys[0]
|
||||
testcase %= 6
|
||||
switch testcase {
|
||||
case 0:
|
||||
// Modified key
|
||||
keys[index%len(keys)] = f.randBytes(32) // In theory it can't be same
|
||||
case 1:
|
||||
// Modified val
|
||||
vals[index%len(vals)] = f.randBytes(20) // In theory it can't be same
|
||||
case 2:
|
||||
// Gapped entry slice
|
||||
index = index % len(keys)
|
||||
keys = append(keys[:index], keys[index+1:]...)
|
||||
vals = append(vals[:index], vals[index+1:]...)
|
||||
case 3:
|
||||
// Out of order
|
||||
index1 := index % len(keys)
|
||||
index2 := index2 % len(keys)
|
||||
keys[index1], keys[index2] = keys[index2], keys[index1]
|
||||
vals[index1], vals[index2] = vals[index2], vals[index1]
|
||||
case 4:
|
||||
// Set random key to nil, do nothing
|
||||
keys[index%len(keys)] = nil
|
||||
case 5:
|
||||
// Set random value to nil, deletion
|
||||
vals[index%len(vals)] = nil
|
||||
|
||||
// Other cases:
|
||||
// Modify something in the proof db
|
||||
// add stuff to proof db
|
||||
// drop stuff from proof db
|
||||
}
|
||||
if f.exhausted {
|
||||
break
|
||||
}
|
||||
ok = 1
|
||||
//nodes, subtrie
|
||||
hasMore, err := trie.VerifyRangeProof(tr.Hash(), first, keys, vals, proof)
|
||||
if err != nil {
|
||||
if hasMore {
|
||||
panic("err != nil && hasMore == true")
|
||||
}
|
||||
}
|
||||
}
|
||||
return ok
|
||||
}
|
||||
|
||||
// Fuzz is the fuzzing entry-point.
|
||||
// The function must return
|
||||
//
|
||||
// - 1 if the fuzzer should increase priority of the
|
||||
// given input during subsequent fuzzing (for example, the input is lexically
|
||||
// correct and was parsed successfully);
|
||||
// - -1 if the input must not be added to corpus even if gives new coverage; and
|
||||
// - 0 otherwise
|
||||
//
|
||||
// other values are reserved for future use.
|
||||
func fuzz(input []byte) int {
|
||||
if len(input) < 100 {
|
||||
return 0
|
||||
}
|
||||
r := bytes.NewReader(input)
|
||||
f := fuzzer{
|
||||
input: r,
|
||||
exhausted: false,
|
||||
}
|
||||
return f.fuzz()
|
||||
}
|
||||
|
|
@ -1,25 +0,0 @@
|
|||
// Copyright 2023 The go-ethereum Authors
|
||||
// This file is part of the go-ethereum library.
|
||||
//
|
||||
// The go-ethereum library is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// The go-ethereum library 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 Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
package rangeproof
|
||||
|
||||
import "testing"
|
||||
|
||||
func Fuzz(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
fuzz(data)
|
||||
})
|
||||
}
|
||||
|
|
@ -1,53 +0,0 @@
|
|||
// Copyright 2021 The go-ethereum Authors
|
||||
// This file is part of the go-ethereum library.
|
||||
//
|
||||
// The go-ethereum library is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// The go-ethereum library 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 Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
package secp256k1
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"testing"
|
||||
|
||||
"github.com/btcsuite/btcd/btcec/v2"
|
||||
"github.com/ethereum/go-ethereum/crypto/secp256k1"
|
||||
)
|
||||
|
||||
func TestFuzzer(t *testing.T) {
|
||||
a, b := "00000000N0000000/R0000000000000000", "0U0000S0000000mkhP000000000000000U"
|
||||
fuzz([]byte(a), []byte(b))
|
||||
}
|
||||
|
||||
func Fuzz(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, a, b []byte) {
|
||||
fuzz(a, b)
|
||||
})
|
||||
}
|
||||
|
||||
func fuzz(dataP1, dataP2 []byte) {
|
||||
var (
|
||||
curveA = secp256k1.S256()
|
||||
curveB = btcec.S256()
|
||||
)
|
||||
// first point
|
||||
x1, y1 := curveB.ScalarBaseMult(dataP1)
|
||||
// second points
|
||||
x2, y2 := curveB.ScalarBaseMult(dataP2)
|
||||
resAX, resAY := curveA.Add(x1, y1, x2, y2)
|
||||
resBX, resBY := curveB.Add(x1, y1, x2, y2)
|
||||
if resAX.Cmp(resBX) != 0 || resAY.Cmp(resBY) != 0 {
|
||||
fmt.Printf("%s %s %s %s\n", x1, y1, x2, y2)
|
||||
panic(fmt.Sprintf("Addition failed: geth: %s %s btcd: %s %s", resAX, resAY, resBX, resBY))
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
|
@ -1,12 +0,0 @@
|
|||
TESTING KEY-----
|
||||
MIICXgIBAAKBgQDuLnQAI3mDgey3VBzWnB2L39JUU4txjeVE6myuDqkM/uGlfjb9
|
||||
SjY1bIw4iAJm2gsvvZhIrCHS3l6afab4pZB
|
||||
l2+XsDlrKBxKKtDrGxlG4LjncdabFn9gvLZad2bSysqz/qTAUStTtqJQIDAQAB
|
||||
AoGAGRzwwir7XvBOAy5tuV6ef6anZzus1s1Y1Clb6HbnWWF/wbZGOpet
|
||||
3m4vD6MXc7jpTLryzTQIvVdfQbRc6+MUVeLKZTXtdZrh+k7hx0nTP8Jcb
|
||||
uqFk541awmMogY/EfbWd6IOkp+4xqjlFBEDytgbIECQQDvH/6nk+hgN4H
|
||||
qzzVtxxr397vWrjrIgPbJpQvBsafG7b0dA4AFjwVbFLmQcj2PprIMmPcQrooz84SHEg1Ak/7KCxmD/sfgS5TeuNi8DoUBEmiSJwm7FX
|
||||
ftxuvL7XvjwjN5B30pNEbc6Iuyt7y4MQJBAIt21su43sjXNueLKH8+ph2UfQuU9txblTu14q3N7gHRZB4ZMhFYyDy8CKrN2cPg/Fvyt0Xl/DoCzjA0CQQDU
|
||||
y2pGsuSmgUtWj3NM9xuwYPm+Z/F84K6+ARYiZ6PYj013sovGKUFfYAqVXVlxtI痂Ⅴ
|
||||
qUn3Xh9ps8ZfjLZO7BAkEAlT4R5Yl6cGhaJQYZHOde3JMhNRcVFMO8dDaFo
|
||||
f9Oeos0UotgiDktdQHxdNEwLjQlJBz+OtwwA=---E RATTIEY-
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
¸&^£áo‡È—-----BEGIN RSA TESTING KEY-----
|
||||
MIICXgIBAAKBgQDuLnQAI3mDgey3VBzWnB2L39JUU4txjeVE6myuDqkM/uGlfjb9
|
||||
SjY1bIw4iA5sBBZzHi3z0h1YV8QPuxEbi4nW91IJm2gsvvZhIrCHS3l6afab4pZB
|
||||
l2+XsDulrKBxKKtD1rGxlG4LjncdabFn9gvLZad2bSysqz/qTAUStTvqJQIDAQAB
|
||||
AoGAGRzwwir7XvBOAy5tM/uV6e+Zf6anZzus1s1Y1ClbjbE6HXbnWWF/wbZGOpet
|
||||
3Zm4vD6MXc7jpTLryzTQIvVdfQbRc6+MUVeLKwZatTXtdZrhu+Jk7hx0nTPy8Jcb
|
||||
uJqFk541aEw+mMogY/xEcfbWd6IOkp+4xqjlFLBEDytgbIECQQDvH/E6nk+hgN4H
|
||||
qzzVtxxr397vWrjrIgPbJpQvBsafG7b0dA4AFjwVbFLmQcj2PprIMmPcQrooz8vp
|
||||
jy4SHEg1AkEA/v13/5M47K9vCxmb8QeD/asydfsgS5TeuNi8DoUBEmiSJwma7FXY
|
||||
fFUtxuvL7XvjwjN5B30pNEbc6Iuyt7y4MQJBAIt21su4b3sjXNueLKH85Q+phy2U
|
||||
fQtuUE9txblTu14q3N7gHRZB4ZMhFYyDy8CKrN2cPg/Fvyt0Xlp/DoCzjA0CQQDU
|
||||
y2ptGsuSmgUtWj3NM9xuwYPm+Z/F84K6+ARYiZ6PYj013sovGKUFfYAqVXVlxtIX
|
||||
qyUBnu3X9ps8ZfjLZO7BAkEAlT4R5Yl6cGhaJQYZHOde3JEMhNRcVFMO8dJDaFeo
|
||||
f9Oeos0UUothgiDktdQHxdNEwLjQf7lJJBzV+5OtwswCWA==
|
||||
-----END RSA TESTING KEY-----Q_
|
||||
|
|
@ -1 +0,0 @@
|
|||
π½apοΏοοοΏ½οΏ½οΏοΏΏ½½½ΏΏ½½οΏ½οΏ½Ώ½οΏοΏ½οΏοΣΜV½Ώ½οοοΏοΏ½#οΏοΏ½&οΏ½οΏ½
|
||||
Binary file not shown.
Binary file not shown.
|
|
@ -1,11 +0,0 @@
|
|||
TAKBgDuLnQA3gey3VBznB39JUtxjeE6myuDkM/uGlfjb
|
||||
S1w4iA5sBzzh8uxEbi4nW91IJm2gsvvZhICHS3l6ab4pZB
|
||||
l2DulrKBxKKtD1rGxlG4LncabFn9vLZad2bSysqz/qTAUSTvqJQIDAQAB
|
||||
AoGAGRzwwir7XvBOAy5tM/uV6e+Zf6anZzus1s1Y1ClbjbE6HXbnWWF/wbZGOpet
|
||||
3Z4vMXc7jpTLryzTQIvVdfQbRc6+MUVeLKZatTXtdZrhu+Jk7hx0nTPy8Jcb
|
||||
uJqFk54MogxEcfbWd6IOkp+4xqFLBEDtgbIECnk+hgN4H
|
||||
qzzxxr397vWrjrIgbJpQvBv8QeeuNi8DoUBEmiSJwa7FXY
|
||||
FUtxuvL7XvjwjN5B30pEbc6Iuyt7y4MQJBAIt21su4b3sjphy2tuUE9xblTu14qgHZ6+AiZovGKU--FfYAqVXVlxtIX
|
||||
qyU3X9ps8ZfjLZ45l6cGhaJQYZHOde3JEMhNRcVFMO8dJDaFeo
|
||||
f9Oeos0UUothgiDktdQHxdNEwLjQf7lJJBzV+5OtwswCWA==
|
||||
-----END RSA T
|
||||
Binary file not shown.
|
|
@ -1 +0,0 @@
|
|||
0000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -1 +0,0 @@
|
|||
<EFBFBD>&
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
DtQvfQ+MULKZTXk78c
|
||||
/fWkpxlQQ/+hgNzVtx9vWgJsafG7b0dA4AFjwVbFLmQcj2PprIMmPNQrooX
|
||||
L
|
||||
Binary file not shown.
|
|
@ -1,12 +0,0 @@
|
|||
4txjeVE6myuDqkM/uGlfjb9
|
||||
SjY1bIw4iA5sBBZzHi3z0h1YV8QPuxEbi4nW91IJm2gsvvZeIrCHS3l6afab4pZB
|
||||
l2+XsDlrKBxKKtD1rGxlG4jncdabFn9gvLZad2bSysqz/qTAUSTvqJQIDAQAB
|
||||
AoGAGRzwwXvBOAy5tM/uV6e+Zf6aZzus1s1Y1ClbjbE6HXbnWWF/wbZGOpet
|
||||
3Z4vD6Mc7pLryzTQIVdfQbRc6+MUVeLKZaTXtdZru+Jk70PJJqFk541aEw+mMogY/xEcfbWd6IOkp+4xqjlFLBEDytgbIECQQDvH/E6nk+gN4H
|
||||
qzzVtxxr397vWrjrIgPbJpQvBsafG7b0dA4AFjwVbFLmQ2PprIMPcQroo8vpjSHg1Ev14KxmQeDydfsgeuN8UBESJwm7F
|
||||
UtuL7Xvjw50pNEbc6Iuyty4QJA21su4sjXNueLQphy2U
|
||||
fQtuUE9txblTu14qN7gHRZB4ZMhFYyDy8CKrN2cPg/Fvyt0Xlp/DoCzjA0CQQDU
|
||||
y2ptGsuSmgUtWj3NM9xuwYPm+Z/F84K6ARYiZPYj1oGUFfYAVVxtI
|
||||
qyBnu3X9pfLZOAkEAlT4R5Yl6cJQYZHOde3JEhNRcVFMO8dJFo
|
||||
f9Oeos0UUhgiDkQxdEwLjQf7lJJz5OtwC=
|
||||
-NRSA TESINGKEY-Q_
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -1,10 +0,0 @@
|
|||
jXbnWWF/wbZGOpet
|
||||
3Zm4vD6MXc7jpTLryzTQIvVdfQbRc6+MUVeLKwZatTXtdZrhu+Jk7hx0nTPy8Jcb
|
||||
uJqFk541aEw+mMogY/xEcfbWd6IOkp+4xqjlFLBEDytgbIECQQDvH/E6nk+hgN4H
|
||||
qzzVtxxr397vWrjrIgPbJpQvBsafG7b0dA4AFjwVbFLmQcj2PprIMmPcQrooz8vp
|
||||
jy4SHEg1AkEA/v13/5M47K9vCxb8QeD/asydfsgS5TeuNi8DoUBEmiSJwma7FXY
|
||||
fFUtxuvL7XvjwjN5B30pNEbc6Iuyt7y4MQJBAIt21su4b3sjXNueLKH85Q+phy2U
|
||||
fQtuUE9txblTu14q3N7gHRZB4ZMhFYyDy8CKrN2cPg/Fvyt0Xl/DoCzjA0CQQDU
|
||||
y2ptGsuSmgUtWj3NM9xuwYPm+Z/F84K6+ARYiZ6Yj013sovGKUFfYAqVXVlxtIX
|
||||
qyUBnu3Xh9ps8ZfjLZO7BAkEAlT4R5Yl6cGhaJQYZHOde3JEMhNRcVFMO8dDaFeo
|
||||
f9Oeos0UotgiDktdQHxdNEwLjQfl
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
¸^áo‡È—----BEGIN RA TTING KEY-----
|
||||
IIXgIBAAKBQDuLnQI3mDgey3VBzWnB2L39JUU4txjeVE6myuDqkM/uGlfjb9
|
||||
SjY1bIw4iA5sBBZzHi3z0h1YV8QPuxEbi4nW91IJmgsvvZhrCHSl6afab4pZB
|
||||
l2+XsDulrKBxKKtD1rGxlG4LjcdabF9gvLZad2bSysqz/qTAUStTvqJQDAQAB
|
||||
AoGAGRzwwir7XvBOAy5tM/uV6e+Zf6anZzus1s1Y1ClbjbE6HXbnWWF/wbZGOpet
|
||||
3Z4vD6MXc7jpTLryzTQIvVdfQbRc6+MUVeLKwZatTXtdZrhu+Jk7hx0nTPy8Jcb
|
||||
uJqFk541aEw+mMogY/xEcfbWd6IOkp+4xqjlFLBEDytgbIECQQDvH/E6nk+hgN4H
|
||||
qzzVtxxr397vWrjrIgPbJpQvBsafG7b0dA4AFjwVbFLmQcj2PprIMmPcQrooz8vp
|
||||
jy4SHEg1AkEA/v13/5M47K9vCxmb8QeD/asydfsgS5TeuNi8DoUBEmiSJwma7FXY
|
||||
fFUtxuvL7XvjwjN5B30pNEbc6Iuyt7y4MQJBAIt21su4b3sjXNueLKH85Q+phy2U
|
||||
fQtuUE9txblTu14q3N7gHRZB4ZMhFYyDy8CKrN2cPg/Fvyt0Xlp/DoCzjA0CQQDU
|
||||
y2ptGsuSmgUtWj3NM9xuwYPm+Z/F84K6+ARYiZ6PYj043sovGKUFfYAqVXVlxtIX
|
||||
qyUBnu3X9ps8ZfjLZO7BAkEAlT4R5Yl6cGhaJQYZHOde3JEMhNRcVFMO8dJDaFeo
|
||||
f9Oeos0UUothgiDktdQHxdNEwLjQf7lJJBzV+5OtwswCWA==
|
||||
-----END RSA TESTING KEY-----Q_
|
||||
Binary file not shown.
|
|
@ -1 +0,0 @@
|
|||
<EFBFBD>
|
||||
Binary file not shown.
Binary file not shown.
|
|
@ -1,7 +0,0 @@
|
|||
|
||||
lGAGRzwwir7XvBOAy5tM/uV6e+Zf6anZzus1s1Y1ClbjbE6HXbnWWF/wbZGOpet
|
||||
3Zm4vD6MXc7jpTLryzTQIvVdfQbRc6+MUVeLKwZatTXtdZrhu+Jk7hx0nTPy8Jcb
|
||||
uJqFk541aEw+mMogY/xEcfbWd6IOkp+4xqjlFLBEDytgbIECQQDvH/E6nk+hgN4H
|
||||
qzzVtxxr397vWrjrIgPbJpQvBsafG7b0dA4AFjwVbFLmQcj2PprIMmPcQrooz8vp
|
||||
jy4SHEg1AkEA/v13/5M47K9vCxmb8QeD/asydfsgS5TeuNi8DoUBEmiSJwma7FXY
|
||||
fFUtxuvL7XvjwjN5
|
||||
Binary file not shown.
|
|
@ -1,2 +0,0 @@
|
|||
カネ哿ソス<03>スツ<01>ス<01>ス<01>ス<01>ス<01>ス<01>ス<01>ス<01>ス<01>ス <01>ス
|
||||
<01>ス<01>ス<01>ス
<01>ス<01>ス<01>ス<01><01>ス<01>ス<01>ス<01>ス<01>ス<01>ス<01>ス<01>ス<01>ス<01>ス<01>ス<01>ス<01>ス<01>ス<01>ス <01>ス!<01>ス"<01>ス#<01>ス$<01>ス%<01>ス&<01>ス'<01>ス(<01>ス)<01>ス*<01>ス+<01>ス,<01>ス-<01>ス.<01>ス/ソス0
|
||||
|
|
@ -1 +0,0 @@
|
|||
LvhaJQHOe3EhRcdaFofeoogkjQfJB
|
||||
Binary file not shown.
Binary file not shown.
|
|
@ -1 +0,0 @@
|
|||
И&^Ѓсo<D181>
|
||||
Binary file not shown.
|
|
@ -1 +0,0 @@
|
|||
đ˝apfffffffffffffffffffffffffffffffebadce6f48a0ź_3bbfd2364
|
||||
Binary file not shown.
|
|
@ -1,3 +0,0 @@
|
|||
DtQvfQ+MULKZTXk78c
|
||||
/fWkpxlyEQQ/+hgNzVtx9vWgJsafG7b0dA4AFjwVbFLmQcj2PprIMmPNQg1Ak/7KCxmDgS5TDEmSJwFX
|
||||
txLjbt4xTgeXVlXsjLZ
|
||||
Binary file not shown.
Binary file not shown.
|
|
@ -1 +0,0 @@
|
|||
ð½ï½ï¿½Ù¯0,1,2,3,4,5,6,7,-3420794409,(2,a)
|
||||
Binary file not shown.
Binary file not shown.
|
|
@ -1 +0,0 @@
|
|||
88242871'392752200424491531672177074144720616417147514758635765020556616ソ
|
||||
Binary file not shown.
|
|
@ -1 +0,0 @@
|
|||
21888242871'392752200424452601091531672177074144720616417147514758635765020556616ソス
|
||||
Binary file not shown.
|
|
@ -1 +0,0 @@
|
|||
LvhaJcdaFofenogkjQfJB
|
||||
Binary file not shown.
|
|
@ -1,2 +0,0 @@
|
|||
DtQvfQ+MULKZTXk78c
|
||||
/fWkpxlyEQQ/+hgNzVtx9vWgJsafG7b0dA4AFjwVbFLmQcj2PprIMmPNQg1AkS5TDEmSJwFVlXsjLZ
|
||||
Binary file not shown.
|
|
@ -1,14 +0,0 @@
|
|||
TESTING KEY-----
|
||||
MIICXgIBAAKBgQDuLnQAI3mDgey3VBzWnB2L39JUU4txjeVE6myuDqkM/uGlfjb9
|
||||
SjY1bIw4iAJm2gsvvZhIrCHS3l6afab4pZB
|
||||
l2+XsDulrKBxKKtD1rGxlG4LjncdabFn9gvLZad2bSysqz/qTAUStTvqJQIDAQAB
|
||||
AoGAGRzwwir7XvBOAy5tM/uV6e+Zf6anZzus1s1Y1ClbjbE6HXbnWWF/wbZGOpet
|
||||
3Zm4vD6MXc7jpTLryzTQIvVdfQbRc6+MUVeLKwZatTXtdZrhu+Jk7hx0nTPy8Jcb
|
||||
uJqFk541aEw+mMogY/xEcfbWd6IOkp+4xqjlFLBEDytgbIECQQDvH/E6nk+hgN4H
|
||||
qzzVtxxr397vWrjrIgPbJpQvBsafG7b0dA4AFjwVbFLmQcj2PprIMmPcQrooz8vp
|
||||
jy4SHEg1AkEA/v13/5M47K9vCxmb8QeD/asydfsgS5TeuNi8DoUBEmiSJwma7FXY
|
||||
fFUtxuvL7XvjwjN5B30pNEbc6Iuyt7y4MQJBAIt21su4b3sjXNueLKH85Q+phy2U
|
||||
fQtuUE9txblTu14q3N7gHRZB4ZMhFYyDy8CKrN2cPg/Fvyt0Xl/DoCzjA0CQQDU
|
||||
y2ptGsuSmgUtWj3NM9xuwYPm+Z/F84K6+ARYiZ6PYj013sovGKUFfYAqVXVlxtIX
|
||||
qyUBnu3Xh9ps8ZfjLZO7BAkEAlT4R5Yl6cGhaJQYZHOde3JEMhNRcVFMO8dDaFeo
|
||||
f9Oeos0UotgiDktdQHxdNEwLjQflJJBzV+5OtwswCA=----EN RATESTI EY-----Q
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
l6afab4pZB
|
||||
l2+XsDlrKBxKKtDrGxlG4LjncdabFn9gvLZad2bSysqz/qTAUStTtqJQIDAQAB
|
||||
AoGAGRzwwir7XvBOAy5tuV6ef6anZzus1s1Y1Clb6HbnWWF/wbZGOpet
|
||||
3m4vD6MXc7jpTLryzTQIvVdfQbRc6+MUVeLKZTXtdZrh+k7hx0nTP8Jcb
|
||||
uqFk541awmMogY/EfbWd6IOkp+4xqjlFBEDytgbIECQQDvH/6nk+hgN4H
|
||||
qzzVtxxr397vWrjrIgPbJpQvBsafG7b0dA4AFjwVbFLmQcj2PprIMmPcQrooz84SHEg1Ak/7KCxmD/sfgS5TeuNi8DoUBEmiSJwm7FX
|
||||
ftxuvL7XvjwjN5B30pNEbc6Iuyt7y4MQJBAIt21su43sjXNueLKH8+ph2UfQuU9txblTu14q3N7gHRZB4ZMhFYyDy8CKrN2cPg/Fvyt0Xl/DoCzjA0CQQDU
|
||||
y2pGsuSmgUtWj3NM9xuwYPm+Z/F84K6+ARYiZ6PYj13sovGKUFfYAqVXVlxtI痂Ⅴ
|
||||
qUn3X9ps8ZfjLZO7BAkEAlT4R5Yl6cGhaJQYZHOde3JMhNRcVFMO8dDaFo
|
||||
f9Oeos0UotgiDktdQHxdNEwLjQlJBz+OtwwA=---E ATTIEY-
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
|
||||
l2+DulrKBxKKtD1rGxlG4LjncdabFn9gvLZad2bSysqz/qTAUStTvqJQIDAQAB
|
||||
AoGAGRzwwir7XvBOAy5tM/uV6e+Zf6anZzus1s1Y1ClbjbE6HXbnWWF/wbZGOpet
|
||||
3Zm4vD6MXc7jpTLryzTQIvVdfQbRc6+MUVeLKwZatTXtdZrhu+Jk7hx0nTPy8Jcb
|
||||
uJqFk541aEw+mMogY/xEcfbWd6IOkp+4xqjlFLBEDytgbIECQQDvH/E6nk+hgN4H
|
||||
qzzVtxxr397vWrjrIgPbJpQvBsafG7b0dA4AFjwVbFLmQcj2PprIMmPcQrooz8vp
|
||||
jy4SHEg1AkEA/v13/5M47K9vCxmb8QeD/asydfsgS5TeuNi8DoUBEmiSJwma7FXY
|
||||
fFUtxuvL7XvjwjN5B30pNEbc6Iuyt7y4MQJBAIt21su4b3sjXNueLKH85Q+phy2U
|
||||
fQtuUE9txblTu14q3N7gHRZB4ZMhFYyDy8CKrN2cPg/Fvyt0Xlp/DoCzjA0CQQDU
|
||||
|
|
@ -1 +0,0 @@
|
|||
KKtDlbjVeLKwZatTXtdZrhu+Jk7hx0xxr397vWrjrIgPbJpQvBsafG7b0dA4AFjwVbFLQcmPcQETT YQ
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -1 +0,0 @@
|
|||
<EFBFBD>
|
||||
|
|
@ -1 +0,0 @@
|
|||
<EFBFBD>39402006196394479212279040100143613805079739270465446667948293404245721771496870329047266088258938001861606973112319<EFBFBD><EFBFBD>
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -1,5 +0,0 @@
|
|||
l2+DulrKBxKKtD1rGxlG4LjncdabFn9gvLZad2bSysqz/qTAUStTvqJQIDAQAB
|
||||
AoGAGRzwwir7XvBOAy5tM/uV6e+Zf6anZzus1s1Y1ClbjbE6HXbnWWF/wbZGOpwVbFLmQet
|
||||
3Zm4vD6MXc7jpTLryzTQIvVdfQbRc6+MUVeLKwZatTXtdZrhu+Jk7hx0nTPy8Jcb
|
||||
uJqFk541aEw+mMogY/xEcfbWd6IOkp+4xqjlFLBEDytgbIECQQDvH/E6nk+hgN4H
|
||||
qzzVtxxr397vWrjr
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
&<26><>w<EFBFBD><77><03><01><01><01><01><01><01><01><01><01> <01>
|
||||
<01><01><01>
<01><01><01><01><><01><01><01><><7F><EFBFBD><01><01><01><01><01><01><01><01><01><01><01> <01>!<01>"<01>#<01>$<01>%<01>&<01>'<01>(<01>)<01>*<01>+<01>,<01>-<01>.<01>/<01><>0
|
||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue