diff --git a/src/main/java/info/weboftrust/txrefconversion/Bech32.java b/src/main/java/info/weboftrust/txrefconversion/Bech32.java index 32554b9..5f7166f 100644 --- a/src/main/java/info/weboftrust/txrefconversion/Bech32.java +++ b/src/main/java/info/weboftrust/txrefconversion/Bech32.java @@ -85,7 +85,7 @@ private static int polymod(byte[] values) { for (byte b : values) { byte top = (byte)(chk >> 0x19); - chk = b ^ ((chk & 0x1ffffff) << 5); + chk = ((0xff) & b) ^ ((chk & 0x1ffffff) << 5); for (int i = 0; i < 5; i++) { chk ^= ((top >> i) & 1) == 1 ? GENERATORS[i] : 0; }