Skip to Content.

rare-dev - Re: [rare-dev] custom crc32 library in freerouter

Subject: Rare project developers

List archive


Re: [rare-dev] custom crc32 library in freerouter


Chronological Thread 
  • From: mc36 <>
  • To: Cristina Klippel Dominicini <>, Cristina Klippel Dominicini <>, "Rafael S. Guimaraes" <>, Rafael S. Guimarães <>
  • Cc: "" <>
  • Subject: Re: [rare-dev] custom crc32 library in freerouter
  • Date: Tue, 19 Oct 2021 21:31:46 +0200

hi,
sorry for the spam...
so i played a bit with my crc32 library and found out that i can calculate
the same values with a single class,
just some parameters need to be passed to it become the "ieee ethernet" or the
"sctp rfc" version of the crc code...
here is what freertr have now at the moment:
http://sources.nop.hu/src/net/freertr/cry/cryHashCrc32.java
(my bad, the url was bad in the previous mail...:) and this is what happened
in the code to reach the single class:
https://github.com/mc36/freeRouter/commit/ca58d4fe39f0cd681d6cd21d3a9a2474e07600a8
if you still need a parameter or anything around the crypto lib, just let me
know...
but hopefully now, it'll be easy for you to come up with the rest, that is:
- a method to encode the polka.routeid from "List<Integer> nodes"...
- a method to calculate the coefficient (polynominal?) from a single node
id...
then we can finally have a pure java forwarder and so on, as we discussed in
the vc...
thanks,
cs



On 10/19/21 17:34, mc36 wrote:
hi

i've found the crc32_custom magic in bmv2:

behavioral-model-main/src/bm_sim/crc_map.cpp
behavioral-model-main/src/bm_sim/calculations.cpp

in the crc_map.cpp for crc32c, they uses the same magic as me at
http://source.nop.hu/src/net/freertr/cry/cryHashCrc32c.java
and the table calculation in calculations.cpp seems similar that i do too,
but mine works with fixed magic...

but they have no parameter called coefficiet, but the magic called
polynomial...

my best guess according to
https://en.wikipedia.org/wiki/Cyclic_redundancy_check is that they're the
same?
(but again, it's my bad but i'm a bit noob in these math things, i'm much
more a networker and coder guy:)

so if that's the case then i'll create a new crc32 class that needs to be
initialized with the poly paramareter...

thanks,

cs



Archive powered by MHonArc 2.6.19.

Top of Page