[hashcash] libfastmint integration attempt (in progress gets stuck in loop)

  • From: Adam Back <adam@xxxxxxxxxxxxxxx>
  • To: hashcash <hashcash@xxxxxxxxxxxxx>
  • Date: Tue, 3 Aug 2004 19:12:10 -0400

Hi

Well I tried calling hashcash_fastmint and hacking a bit of hashcash
code around to support that quickly.

minor issue: hashcash_fastmint does not track how many iterestions it
took, but the existing command line code displays that (in verbose mode)

(I worked around by timing hashcash_fastmint, and calculating from
that and the speed measurement how many tries it would have done:-)

bigger issue: I tried calling hashcash_benchtest(0) in
hashcash_per_sec, but it takes about 5 seconds elapsed which is a bit
slow for a cached-but-calculated on the fly if not set C macro type of
thing.

Could we use a smaller iteration count and much higher resolution
timer?

I had some x86 asm code somewhere to get real ticks.  Of course issue
there is you don't know the CPU rate.

minor issue: hashcash_fastmint is recursive, and I think the stack
gets deeper very 8 mins or so on my machine.  Should be a way to do
this non-recursively.

The slow hashcash mint code stops if it gets to 2^96 bits (ha ha) with
an error code.  But more to the point it will chew away pretty much
indefinitely on forseeable processors for next 20 years, and not
recurse up the stack.

btw the "best bits of collision so far" is kind of interesting
progress measure and might be worth incorporating into output/progress
indicator at some point.

And lastly I've no doubt bodged something as it gets stuck chews CPU
and doesn't output anything.  I made a minor change to libfastmint.c
verbosity (was still outputting something with verbosity 0).  If
anyone feels like fixing that, please be my guest :-)

You need to define CHROMATIX in makefile (I am) to enable the
integration attempt.

        http://www.hashcash.org/source/current/hashcash-1.00/

see compiles but not-yet functional pr5. 

I also added the v0 backwards compatibility.

That leaves on TODO just:

        * get rid of stamp size limits (to allow extensibility)
        * change timing to use clock() instead of wall-clock time

plus fix attempt at:

        * integrate Jonathan's code

Getting closer!

Adam

Other related posts: