Type 256 differently

This commit is contained in:
Łukasz Magiera 2019-12-02 23:49:41 +01:00
parent ab36a5aa04
commit fd92b8f19a

View File

@ -172,6 +172,8 @@ func CidArrsEqual(a, b []cid.Cid) bool {
var blocksPerEpoch = NewInt(build.BlocksPerEpoch)
const sha256bits = 256
func IsTicketWinner(partialTicket []byte, ssizeI uint64, totpow BigInt) bool {
ssize := NewInt(ssizeI)
@ -193,7 +195,7 @@ func IsTicketWinner(partialTicket []byte, ssizeI uint64, totpow BigInt) bool {
// rhs = sectorSize * 2^256
// rhs = sectorSize << 256
rhs := new(big.Int).Lsh(ssize.Int, 256)
rhs := new(big.Int).Lsh(ssize.Int, sha256bits)
rhs = rhs.Mul(rhs, blocksPerEpoch.Int)
// h(vrfout) * totalPower < e * sectorSize * 2^256?