private int affineTransformation(int value) {

        /*Prepare affineMatrix:
         
         [ 1, 0, 0, 0, 1, 1, 1, 1 ]
         [ 1, 1, 0, 0, 0, 1, 1, 1 ]
         [ 1, 1, 1, 0, 0, 0, 1, 1 ]
         [ 1, 1, 1, 1, 0, 0, 0, 1 ]
         [ 1, 1, 1, 1, 1, 0, 0, 0 ]
         [ 0, 1, 1, 1, 1, 1, 0, 0 ]
         [ 0, 0, 1, 1, 1, 1, 1, 0 ]
         [ 0, 0, 0, 1, 1, 1, 1, 1 ]
         
         */
        Matrix affineMatrix = new Matrix(8, 8);
        int pos = 0;
        for (int x = 0; x < 8; x++) {
            pos++;
            for (int y = 0; y < 8; y++) {
                if (!((y == (pos % 8)) || ((y == ((pos + 1) % 8))) || ((y == ((pos + 2) % 8))))) {
                    affineMatrix.setElement(x, y, 1);
                }
            }
        }

        GF2N aesField = new GF2N(283);
        MatrixGF2N aesMat = new MatrixGF2N(aesField);

        Matrix resultMatrix;
        if (value != 0) {
            resultMatrix = aesMat.multiply(affineMatrix, decimalNumberToBinaryVector(aesField.invert(value)));
        } else {
            resultMatrix = aesMat.multiply(affineMatrix, decimalNumberToBinaryVector(0));
        }

        Matrix addMatrix = new Matrix(8, 1);//{1,1,0,0,0,1,1,0};
        addMatrix.setElement(0, 0, 1);
        addMatrix.setElement(1, 0, 1);
        addMatrix.setElement(2, 0, 0);
        addMatrix.setElement(3, 0, 0);
        addMatrix.setElement(4, 0, 0);
        addMatrix.setElement(5, 0, 1);
        addMatrix.setElement(6, 0, 1);
        addMatrix.setElement(7, 0, 0);

        return (int) binaryMatrixToDecimalNumber(aesMat.add(resultMatrix, addMatrix));

    }