Trying to implement the cipher "Grasshopper" in Java. But there was a problem. C ++ has a function that I just don’t know how to implement in Java. The following is my implementation, but the compiler does not like operations with &.
char mul_gf256(char x, char y) { char z = 0x0; while (y) { if (y & 0x01) z ^= x; x = (x << 0x01) ^ (x & 0x80 ? 0xC3 : 0x00); y >>= 1; } return z; } Implementing on c ++ you can look at the github https://github.com/mjosaarinen/kuznechik/blob/master/kuznechik_128bit.c