https://gitlab.com/tezos/tezos
Raw File
Tip revision: 96c414508b66efb8edee4ced03a50de7ef3abc58 authored by Ole Krüger on 04 April 2024, 13:56:32 UTC
Nix: Provide Nix flake
Tip revision: 96c4145
xor_bytes_016.tz
parameter unit;
storage unit;
code { DROP;

       # 0x05 ^ 0x06 = 0x03
       PUSH bytes 0x05; PUSH bytes 0x06; XOR; PUSH bytes 0x03; ASSERT_CMPEQ;

       # 0x0005 ^ 0x0106 = 0x0103
       PUSH bytes 0x0005; PUSH bytes 0x0106; XOR; PUSH bytes 0x0103; ASSERT_CMPEQ;

       # Shorter bytes 0-padded to the left to have the same length as the longer one
       # 0x05 ^ 0x0106 = 0x0005 ^ 0x0106 = 0x0103, not 0x03
       PUSH bytes 0x05; PUSH bytes 0x0106; XOR; PUSH bytes 0x0103; ASSERT_CMPEQ;

       UNIT; NIL @noop operation; PAIR; };
back to top