probably
bit.and(checksum_high - ((speed_1 + speed_2 + 0)/256),0xff)
bit.and(checksum_low - (speed_1 + speed_2 + 0),0xff)
or if you don't like the bit operations this might work when it's stored in an int
(checksum_high - ((speed_1 + speed_2 + 0)/256)) mod 256
(checksum_low - (speed_1 + speed_2 + 0) mod 256