keccak_Final step circuit implemented

This commit is contained in:
2021-11-24 17:33:40 +01:00
parent 7cd26a6a54
commit d9fdab3b8f
4 changed files with 95 additions and 1 deletions

View File

@@ -170,8 +170,12 @@ func TestFinal(t *testing.T) {
b[i] = byte(i)
}
bBits := bytesToBits(b)
fBits := final(bBits)
// printBytes("in", b[:])
// printU64Array("out", bitsToU64Array(fBits[:]))
qt.Assert(t, bitsToU64Array(fBits[:]), qt.DeepEquals,
[]uint64{16953415415620100490, 7495738965189503699,
12723370805759944158, 3295955328722933810,
@@ -184,4 +188,25 @@ func TestFinal(t *testing.T) {
14618962068930014237, 2721742233407503451,
12003265593030191290, 8109318293656735684, 6346795302983965746,
12210038122000333046})
// 2nd test
for i := 0; i < len(b); i++ {
b[i] = byte(254)
}
bBits = bytesToBits(b)
fBits = final(bBits)
// printBytes("in", b[:])
// printU64Array("out", bitsToU64Array(fBits[:]))
qt.Assert(t, bitsToU64Array(fBits[:]), qt.DeepEquals,
[]uint64{16852464862333879129, 9588646233186836430, 693207875935078627,
6545910230963382296, 3599194178366828471, 13130606490077331384,
10374798023615518933, 7285576075118720444, 4097382401500492461,
3968685317688314807, 3350659309646210303, 640023485234837464,
2550030127986774041, 8948768022010378840, 10678227883444996205,
1395278318096830339, 2744077813166753978, 13362598477502046010,
14601579319881128511, 4070707967569603186, 16833768365875755098,
1486295134719870048, 9161068934282437999, 8245604251371175619,
8421994351908003183})
}