nasa / bplib

Apache License 2.0
30 stars 13 forks source link

Extend CRC calculation logic to be shared between v6 and v7 #74

Closed jphickey closed 2 years ago

jphickey commented 2 years ago

Both V6 and V7 will require calculation of CRC, but the actual algorithm parameters (x25/Castagnoli) are in bib.c which is restricted to v6. This should be moved into the generic/common crc definitions where both v6 and v7 can use it.

Additionally, V7 is likely to need an API call that can calculate a CRC in chunks, rather than the currently defined call which calculates the entire thing at once. This requires separate API calls for init, update, and finalize, but crc_get() does all these steps in one call.