Esempio n. 1
0
// rightCompose composes a Block encoding on the right.
func (al *affineLayer) rightCompose(right encoding.Block) {
	temp, _ := encoding.DecomposeBlockAffine(encoding.ComposedBlocks{
		encoding.BlockAffine(*al), right,
	})

	*al = affineLayer(temp)
}
Esempio n. 2
0
// leftCompose composes a Block encoding on the left.
func (al *affineLayer) leftCompose(left encoding.Block) {
	temp, _ := encoding.DecomposeBlockAffine(encoding.ComposedBlocks{
		left, encoding.BlockAffine(*al),
	})

	*al = affineLayer(temp)
}
Esempio n. 3
0
// adjust fixes the affine layer for two block encodings which will be moved somewhere else.
func (al *affineLayer) adjust(input, output encoding.Block) {
	temp, _ := encoding.DecomposeBlockAffine(encoding.ComposedBlocks{
		encoding.InverseBlock{input},
		encoding.BlockAffine(*al),
		encoding.InverseBlock{output},
	})

	*al = affineLayer(temp)
}
Esempio n. 4
0
func (al affineLayer) Decode(in [16]byte) [16]byte {
	return encoding.BlockAffine(al).Decode(in)
}