예제 #1
0
func (nxts NibbleXORTables) Serialize() []byte {
	dst, base := make([]byte, nxtsSize), 0

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

	return dst
}
예제 #2
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
}