🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: alt.privacy.anon-server
Article #176556

Re: Attn: Richard, Hashcash DLL

#176556
From: Adam Back
Date: Sat, 23 Oct 2004 13:41
42 lines
3545 bytes
Thomas Boschloo wrote:
> Out of curriousity, how does it work?
>
>
> typedef int (*hashcash_callback)(int percent, int largest, int target,
> ~ double count, double expected,
> ~ void* user);
>
> HCEXPORT
> int hashcash_mint( time_t now_time, int time_width, const char* resource,
> ~   unsigned bits, long anon_period, char** stamp,
> ~   long* anon_random, double* tries_taken, char* ext,
> ~   int compress, hashcash_callback cb, void* user_arg );
>
>
> I assume you call hashcash_mint() with your own hashcash_callback
> function specified. This function then gets called from within the
> minter and the calling program can use it to abort the search, right?
                                                                                
Yes if the callback returns false, the minter returns
HASHCASH_USER_ABORT and stops.
                                                                                
In fact I use 65536 iterations, and call at bigger of 1/10th second or
65536 iterations.
                                                                                
> Of course I am biased, but wouldn't it be simpler to simply have
> hashcash_mint return after 100000 tries and return in its exit code how
> many bits of the currently tested (static) token collide?
                                                                                
Indeedly.  I tried to do this but the assembler code from Jonathan is
not assuming it can be interrupted and resumed.  The state to save to
resume on next call I couldn't figure out.  It depends on the minter
and there are lots of them with different numbers of parallel sha1
minters in interleaved MMX assembler, C and PPC altivec vector units.
                                                                                
So eventually I gave up on that idea and went the easy option -- pass
the callback right into the assembler/C mixed functions and have
_them_ call the callback as appropriate.  Ergo no resume and the
current API.  Well actually I did have the callback externally but not
internally to start, but as described couldn't get it to work.
                                                                                
Adam
Technical Details
Message-ID: <9c20fb90.0410230541.102142a8@posting.google.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!mbox2nntp-alt.privacy.anon-server.20141023.mbox.gz!number1.nntp.dca.giganews.com!internal1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!news.glorb.com!postnews1.google.com!not-for-mail
References: <4167D26B.8070508@hccnet.nl.invalid> <200410102136.i9ALaFRg004867@skuz.net> <416AC996.9010409@hccnet.nl.invalid> <3c7e0a57.0410140129.5a9f7ca6@posting.google.com> <416EC00C.30300@hccnet.nl.invalid> <9c20fb90.0410201620.206fb095@posting.google.com> <41796E86.2000805@hccnet.nl.invalid>

Show Full Headers
Complete Article Headers
Message-ID: <9c20fb90.0410230541.102142a8@posting.google.com>
Subject: Re: Attn: Richard, Hashcash DLL
Date: Sat, 23 Oct 2004 13:41:08 +0000
From: adam@cypherspace.org (Adam Back)
References: <4167D26B.8070508@hccnet.nl.invalid> <200410102136.i9ALaFRg004867@skuz.net> <416AC996.9010409@hccnet.nl.invalid> <3c7e0a57.0410140129.5a9f7ca6@posting.google.com> <416EC00C.30300@hccnet.nl.invalid> <9c20fb90.0410201620.206fb095@posting.google.com> <41796E86.2000805@hccnet.nl.invalid>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!mbox2nntp-alt.privacy.anon-server.20141023.mbox.gz!number1.nntp.dca.giganews.com!internal1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!news.glorb.com!postnews1.google.com!not-for-mail
Newsgroups: alt.privacy.anon-server
Organization: http://groups.google.com
Lines: 42
NNTP-Posting-Host: 62.253.64.15
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-Trace: posting.google.com 1098538868 16641 127.0.0.1 (23 Oct 2004 13:41:08
 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Sat, 23 Oct 2004 13:41:08 +0000 (UTC)