Exemple #1
0
func parseXORTables(in []byte) (out [9][32][3]table.Nibble, rest []byte) {
	if in == nil || len(in) < xorTableSize*9*32*3 {
		return
	}

	for i := 0; i < 9; i++ {
		for j := 0; j < 32; j++ {
			for k := 0; k < 3; k++ {
				loc := 32*3*i + 3*j + k
				out[i][j][k] = table.ParsedNibble(in[xorTableSize*loc : xorTableSize*(loc+1)])
			}
		}
	}

	return out, in[xorTableSize*9*32*3:]
}
Exemple #2
0
func ParseBlockMatrix(in []byte) (outM [16]table.Block, outXOR [32][15]table.Nibble, rest []byte) {
	if in == nil || len(in) < BlockMatrixSize {
		return
	}

	for i := 0; i < 16; i++ {
		outM[i] = table.ParsedBlock(in[SliceSize*i : SliceSize*(i+1)])
	}

	rest = in[16*SliceSize:]

	for i := 0; i < 32; i++ {
		for j := 0; j < 15; j++ {
			loc := 15*i + j
			outXOR[i][j] = table.ParsedNibble(rest[XorSize*loc : XorSize*(loc+1)])
		}
	}

	rest = rest[32*15*XorSize:]

	return
}