Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Need of PRBS Pattern Generating C/C++ API [closed]

I am looking for PRBS Pattern Generating C/C++ API, So that i can insert it in Payload of UDP.

If anybody know the procedure for generating PRBS pattern it would be greatfull.

like image 299
Mahesh Avatar asked Aug 05 '09 12:08

Mahesh


1 Answers

I'm unsure if there's a library which can match your purpose. I can give you some pointers on the implementation though:

The basis of your implementation will be a LFSR. You can implement one in two ways:

  • The Fibonacci implementation consists of a simple shift register in which a modulo-2 sum of the binary-weighted taps is fed back to the input (remember that mod-2 sum is equivalent to addition without carry, which is in turn equivalent with XOR).
  • The Galois implementation consists of a shift register, the content of which is modified at every step by a binary-weighted value of the output stage, again using modulo-2 math. The order of the Galois weights is opposite that of the Fibonacci weights. The Galois form is generally faster due to the reduced amount of logic in the feedback loop.

For more information on how taps are specified and what sequences you can obtain you can start here. Note that your implementation choices above can have the same cycle length and sequence of output bits for an appropriate choice of initial states (seeds).

That's your basic requirement right there. LFSRs have output streams that are very uniformly distributed and sufficiently long periods. I'd suggest not to use it for cryptographic purposes, as it's extremely weak - being a linear system. There are workarounds, but nothing substantial except the shrinking generator (which I find extremely cool).

Links to implementations have already been given, so good luck!

like image 194
Michael Foukarakis Avatar answered Sep 30 '22 19:09

Michael Foukarakis