Documentation
¶
Index ¶
- Constants
- Variables
- func CalculateDeadline(accountId uint64, nonce uint64, genSig []byte, scoop int, baseTarget uint64, ...) uint64
- func CalculateDeadlineOfPoc2(accountId uint64, nonce uint64, genSig [32]byte, height uint64, ...) uint64
- func CalculateGenerationSignature(lastGenSig []byte, lastGenId uint64) []byte
- func CalculateHit(accountId uint64, nonce uint64, genSig []byte, scoop int, pocVersion int) uint64
- func CalculateScoop(genSig []byte, height uint64) int
- func ClampPrivateKey(privateKey []byte)
- func GetPublicKey(privateKey []byte) [32]byte
- func GetSharedSecret(privateKey []byte, publicKey []byte) [32]byte
- func SignMsg(message []byte, privateKey []byte) [64]byte
- func Sum256(data []byte) [Size]byte
- func VerifyMsg(message []byte, signature []byte, publicKey []byte, enforceCanonical bool) bool
- type Digest
- type MiningPlot
Constants ¶
View Source
const ( P25 = 33554431 /* (1 << 25) - 1 */ P26 = 67108863 /* (1 << 26) - 1 */ )
View Source
const ( HASH_SIZE int = 32 HASHES_PER_SCOOP int = 2 SCOOP_SIZE int = 64 SCOOPS_PER_PLOT int = 4096 PLOT_SIZE int = 262144 BASE_LENGTH int = 16 PLOT_TOTAL_SIZE int = PLOT_SIZE + BASE_LENGTH HASH_CAP int = 4096 )
View Source
const BlockSize = 64
The blocksize of SHABAL256 in bytes.
View Source
const Size = 32
The size of a SHABAL256 checksum in bytes.
Variables ¶
View Source
var ( ZERO = []byte{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} /* the prime 2^255-19 */ PRIME = []byte{237, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 127} /* group order (a prime near 2^252+2^124) */ ORDER = []byte{237, 211, 245, 92, 26, 99, 18, 88, 214, 156, 247, 162, 222, 249, 222, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16} /* smallest multiple of the order that's >= 2^255 */ ORDER_TIMES_8 = []byte{104, 159, 174, 231, 210, 24, 147, 192, 178, 230, 188, 23, 245, 206, 247, 166, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128} /* constants 2Gy and 1/(2Gy) */ BASE_2Y = long10{39999547, 18689728, 59995525, 1648697, 57546132, 24010086, 19059592, 5425144, 63499247, 16420658} BASE_R2Y = long10{5744, 8160848, 4790893, 13779497, 35730846, 12541209, 49101323, 30047407, 40071253, 6226132} )
View Source
var SCOOPS_PER_PLOT_BIGINT *big.Int = big.NewInt(int64(SCOOPS_PER_PLOT))
Functions ¶
func CalculateDeadline ¶
func CalculateDeadlineOfPoc2 ¶
func CalculateHit ¶
func CalculateScoop ¶
func ClampPrivateKey ¶
func ClampPrivateKey(privateKey []byte)
func GetPublicKey ¶
func GetSharedSecret ¶
Types ¶
type Digest ¶
type Digest struct {
// contains filtered or unexported fields
}
digest represents the partial evaluation of a checksum.
type MiningPlot ¶
type MiningPlot struct {
// contains filtered or unexported fields
}
func NewMiningPlot ¶
func NewMiningPlot(accountId uint64, nonce uint64, pocVersion int) *MiningPlot
func (*MiningPlot) HashScoop ¶
func (mp *MiningPlot) HashScoop(digist *Digest, pos int)
Click to show internal directories.
Click to hide internal directories.