Skip to content
Snippets Groups Projects
Commit bfbfb725 authored by Jono Wenger's avatar Jono Wenger
Browse files

Add debug flags to give more information on the knownRounds implies() (XX-3071)

parent 9469ce6b
Branches
Tags
No related merge requests found
......@@ -233,8 +233,12 @@ func (kr *KnownRounds) RangeUncheckedMasked(mask *KnownRounds,
numChecked := 0
if mask.firstUnchecked != mask.lastChecked {
jww.DEBUG.Printf("mask (before Forward()) {\n\tbitStream: %064b\n\tfirstUnchecked: %d\n\tlastChecked: %d\n\tfuPos: %d\n}", mask.bitStream, mask.firstUnchecked, mask.lastChecked, mask.fuPos)
mask.Forward(kr.firstUnchecked)
subSample, delta := kr.subSample(mask.firstUnchecked, mask.lastChecked)
jww.DEBUG.Printf("mask (after Forward()) {\n\tbitStream: %064b\n\tfirstUnchecked: %d\n\tlastChecked: %d\n\tfuPos: %d\n}", mask.bitStream, mask.firstUnchecked, mask.lastChecked, mask.fuPos)
jww.DEBUG.Printf("kr {\n\tbitStream: %064b\n\tfirstUnchecked: %d\n\tlastChecked: %d\n\tfuPos: %d\n}", kr.bitStream, kr.firstUnchecked, kr.lastChecked, kr.fuPos)
jww.DEBUG.Printf("delta: %d", delta)
result := subSample.implies(mask.bitStream)
for i := mask.firstUnchecked + id.Round(delta) - 1; i >= mask.firstUnchecked && numChecked < maxChecked; i, numChecked = i-1, numChecked+1 {
......
......@@ -97,8 +97,9 @@ func (u64b uint64Buff) copy(start, end int) uint64Buff {
// https://en.wikipedia.org/wiki/Material_conditional
func (u64b uint64Buff) implies(mask uint64Buff) uint64Buff {
if len(u64b) != len(mask) {
jww.FATAL.Printf("REPORT THIS ERROR TO JONO ↓")
jww.FATAL.Panicf("Cannot imply two buffers of different lengths "+
"(%v and %v).", len(u64b), len(mask))
"(%v and %v).\nu64b: %064b\nmask: %064b", len(u64b), len(mask), u64b, mask)
}
result := make(uint64Buff, len(u64b))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment