Documentation ¶
Overview ¶
* Copyright 2020 The SealEVM Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.
Index ¶
Constants ¶
const EthPrecompiledMaxAddr = 9
const EthPrecompiledMinAddr = 1
const ContractsMaxAddress = 16
const ExtPrecompiled2030100MaxAddr = 15
const ExtPrecompiled2030100MinAddr = 10
const ExtPrecompiled2030200MaxAddr = 1007
const ExtPrecompiled2030200MinAddr = 1000
Variables ¶
var Contracts = map[uint64]PrecompiledContract{
1: &ecRecover{},
2: &sha256hash{},
3: &ripemd160hash{},
4: &dataCopy{},
5: &bigModExp{},
6: &bn256AddIstanbul{},
7: &bn256ScalarMulIstanbul{},
8: &bn256PairingIstanbul{},
9: &blake2F{},
10: &senderOrgId{},
11: &senderRole{},
12: &senderPk{},
13: &creatorOrgId{},
14: &creatorRole{},
15: &creatorPk{},
1007: &signVerify{},
}
var Contracts = [ContractsMaxAddress]PrecompiledContract{
var ContractsNew = map[uint64]PrecompiledContract{
1: &ecRecover{},
2: &sha256hash{},
3: &ripemd160hash{},
4: &dataCopy{},
5: &bigModExp{},
6: &bn256AddIstanbul{},
7: &bn256ScalarMulIstanbul{},
8: &bn256PairingIstanbul{},
9: &blake2F{},
1000: &senderOrgId{},
1001: &senderRole{},
1002: &senderPk{},
1003: &creatorOrgId{},
1004: &creatorRole{},
1005: &creatorPk{},
1006: &contractLog{},
1007: &signVerify{},
}
var IV = [8]uint64{
0x6a09e667f3bcc908, 0xbb67ae8584caa73b, 0x3c6ef372fe94f82b, 0xa54ff53a5f1d36f1,
0x510e527fade682d1, 0x9b05688c2b3e6c1f, 0x1f83d9abfb41bd6b, 0x5be0cd19137e2179,
}
IV is an initialization vector for BLAKE2b
Functions ¶
func F ¶
F is a compression function for BLAKE2b. It takes as an argument the state vector `h`, message block vector `m`, offset counter `t`, final block indicator flag `f`, and number of rounds `rounds`. The state vector provided as the first parameter is modified by the function.