Ejemplo n.º 1
0
func serializeXORTables(dst []byte, t [9][32][3]table.Nibble) int {
	base := 0
	for _, round := range t {
		for _, pos := range round {
			for _, gate := range pos {
				base += copy(dst[base:], table.SerializeNibble(gate))
			}
		}
	}

	return base
}
Ejemplo n.º 2
0
func SerializeBlockMatrix(dst []byte, m [16]table.Block, xor [32][15]table.Nibble) int {
	base := 0

	for _, slice := range m {
		base += copy(dst[base:], table.SerializeBlock(slice))
	}

	for _, rack := range xor {
		for _, xorTable := range rack {
			base += copy(dst[base:], table.SerializeNibble(xorTable))
		}
	}

	return base
}