예제 #1
0
파일: affine.go 프로젝트: OpenWhiteBox/AES
// 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)
}
예제 #2
0
파일: affine.go 프로젝트: OpenWhiteBox/AES
// 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)
}
예제 #3
0
파일: affine.go 프로젝트: OpenWhiteBox/AES
// 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)
}
예제 #4
0
파일: affine.go 프로젝트: OpenWhiteBox/AES
func (al affineLayer) Decode(in [16]byte) [16]byte {
	return encoding.BlockAffine(al).Decode(in)
}