Article View: alt.privacy.anon-server
Article #176569Re: Attn: Richard, Hashcash DLL
From: Thomas J. Boschloo
Date: Sat, 23 Oct 2004 20:48
Date: Sat, 23 Oct 2004 20:48
79 lines
4405 bytes
4405 bytes
-----BEGIN PGP SIGNED MESSAGE----- Adam Back wrote: | 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. I don't think I have to tell you, but be sure that you have no wrap around with 16 bit integers! Like the program below will never finish: for(unsigned char c=0; c<=255; c++); |>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. It makes sense to me now. You could code the routines in C, but I guess they would be a lot slower :-(( | 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 I understand now. It is a bit intimidating to me, but I think I understand better now. Thanks for the explanation, Thomas - -- The Thraddash: "So, what's this? SNORT! An unknown alien species?" "How wonderful! Someone new to fight!" Full Game Win/Mac/Linux: <http://sc2.sourceforge.net> -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.5 (MingW32) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iQB5AwUBQXrDkgEP2l8iXKAJAQEiRAMfetoFWTYjrTIz2aARUt05c0yo2oZAj+Pp LSnIVQAtDiOI/6JE/KIAMJzWZn5713swmSCOMXefI9olZSD2Fbx9oUb69GsB31E0 gzUbXbnt/pp//zoDikk4a7uKaPbRujY7upNc7A== =7YXp -----END PGP SIGNATURE-----
Technical Details
Message-ID:
<417AC392.3000408@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!transit.nntp.hccnet.nl!reader.nntp.hccnet.nl!not-for-mailReferences:
<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> <9c20fb90.0410230541.102142a8@posting.google.com>Show Full Headers
Complete Article Headers
Message-ID: <417AC392.3000408@hccnet.nl.invalid> Subject: Re: Attn: Richard, Hashcash DLL Date: Sat, 23 Oct 2004 22:48:18 +0200 From: "Thomas J. Boschloo" <nospam@hccnet.nl.invalid> 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> <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!transit.nntp.hccnet.nl!reader.nntp.hccnet.nl!not-for-mail User-Agent: Mozilla Thunderbird 0.8 (Windows/20040913) X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: alt.privacy.anon-server In-Reply-To: <9c20fb90.0410230541.102142a8@posting.google.com> X-Enigmail-Version: 0.86.1.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Lines: 79 Organization: HCCnet Nieuwsgebruiker NNTP-Posting-Date: 23 Oct 2004 20:49:25 GMT NNTP-Posting-Host: 62.251.35.26 X-Trace: 1098564565 reader10.nntp.hccnet.nl 771 62.251.35.26:1044 X-Complaints-To: abuse@hccnet.nl