D
David Eather
Guest
On 19/05/2022 1:54 am, Clive Arthur wrote:
up table or maybe even none.
This one is out of the box: take the 14 bytes and append to bytes of a
known pattern 0x00 or 0xFF will work as well as anything else. Use a
128-bit (16 bytes) encryption algorithm and send that. On the receiving
end, decrypt. If the last two bytes are the same as the two you added
then all good.
if not then you have to brute force the data. All possible single bit
errors, all 2 bit errors etc until you get the answer or run out of
time. The good news is that this will pick up multiple bit errors
99.8% of all possible 1 bit errors - 128 in total
87.6% of all possible 2 bit errors - 8128 in total
each and every bit error has a ((2^16)-1)/2^16 chance to be detected.
that is a 99.999% chance.
Since you are not using the encryption algorithm as a cryptographic
device but just a randomizing device you can probably chop it length
down in half to double its speed.
this one shouldn\'t be thousands of compute cycles and only a small lookHi all
I have serial data in 14 byte packets on which I\'d like to detect and
correct errors. Two bit errors would be nice. I can put 2 extra EDC
bytes on the end to make a 16 byte packet.
I don\'t have the resources for Reed-Solomon. I could use a 16 bit CRC,
these are easy to generate with a small/moderate LUT.
In the past, I\'ve used a CRC16 for single bit error detection and
correction on a longer packet, but I didn\'t do the error detection part.
 Errors were very rare, time was not critical, and I understand that
this was simply done by changing each message bit in turn then
recalculating the CRC till it all worked out. That\'s far to slow for my
current needs.
If I\'m lucky, a 16 bit CRC might be able to detect and correct 2 bit
errors in 14 bytes (112 * 111 possibilities?), but is there a way of
quickly finding out which bits are wrong?
Or maybe a completely different approach? This has to be done on the
fly, and multi-kilobyte LUTs or thousands of clock cycles are out of the
question.
up table or maybe even none.
This one is out of the box: take the 14 bytes and append to bytes of a
known pattern 0x00 or 0xFF will work as well as anything else. Use a
128-bit (16 bytes) encryption algorithm and send that. On the receiving
end, decrypt. If the last two bytes are the same as the two you added
then all good.
if not then you have to brute force the data. All possible single bit
errors, all 2 bit errors etc until you get the answer or run out of
time. The good news is that this will pick up multiple bit errors
99.8% of all possible 1 bit errors - 128 in total
87.6% of all possible 2 bit errors - 8128 in total
each and every bit error has a ((2^16)-1)/2^16 chance to be detected.
that is a 99.999% chance.
Since you are not using the encryption algorithm as a cryptographic
device but just a randomizing device you can probably chop it length
down in half to double its speed.