Commit graph

7 commits

Author SHA1 Message Date
Martin Hebnes Pedersen
29c24593f9 Support Rate 1/2 Data CRC Mask
The previous implementation hardcoded the mask for Rate 3/4 Data (0x01ff),
causing CRC check failure for Rate 1/2 on both encode and decode.

This patch also refactors to avoid code copying and fixes a bug where
calling DataBlock.Byte() on the output of Fragment.DataBlocks() produced
an incorrect CRC value due to Bytes() not resetting db.CRC before
performing it's own CRC calculation.
2019-05-13 15:53:04 +02:00
Martin Hebnes Pedersen
2851102398 Fix serialization of Confirmed DataBlock
The serialized form should be 10 octets of user-data plus the two octets
for serial/crc.

Previous implementation forgot to account for the two extra octets when
allocating the final data slice.
2019-05-07 22:38:16 +02:00
Martin Hebnes Pedersen
f4fff47365 Fix panic in Fragment.DataBlocks() duo to typo
store vs stored
2019-04-01 21:54:59 +02:00
Martin Hebnes Pedersen
d206b8c2bd Fix ParseDataBlock of unconfirmed data
The Data slice was not initialized before calling copy(dst, src)
2019-04-01 21:53:37 +02:00
Wijnand Modderman-Lenstra
3fe41e10ef Checkpoint 2015-12-19 00:00:52 +01:00
Wijnand Modderman-Lenstra
4f2b16dfcb Checkpoint 2015-12-18 15:30:16 +01:00
Wijnand Modderman-Lenstra
cca6817956 Checkpoint 2015-12-17 11:41:06 +01:00