Post
Topic
Board Off-topic
Re: [ARCHIVE] Bitcoin challenge discusion
by
itod
on 05/08/2019, 19:17:46 UTC
They say this fastest pseudo-random generator that is any good: Xorshift

You need few lines of code to vary the mask, why not do this instead?

I read about and was intrigued by the two xoshiro256 algorithms and i think a great idea would be to create a xoshiro512 version that would be perfect for this application.

1) Expand the PRNG state from 256 bits to 512 bits
2) Seed the PRNG with all 512 bits of the point X that have been modified in a yet TBD way in order to create the various kangaroos
3) have the PRNG output a 256 bit pseudo random number based on the 512 bit state.

This might give better pseudo random coverage of the search space than my ultra simple (but faster) masking system.

Nice idea, but you can simplify it by ignoring Y coordinate, since X is much more important and effectively defining the point on the curve. Then you can stay in 256 bit range instead of venturing to 512 bits, and use this version I've written for you:

Code:
struct xorshift256_state {
  uint64_t a, b, c, d;
};

/* The state array should be initialized to X coordinate */
uint64_t xorshift256(struct xorshift256_state *state)
{
uint64_t t = state->d;

uint64_t const s = state->a;
state->d = state->c;
state->c = state->b;
state->b = s;

t ^= t << 11;
t ^= t >> 8;
return state->a = t ^ s ^ (s >> 19);
}