Openwall GNU/*/Linux - a small security-enhanced Linux distro for servers
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date: Tue, 8 Sep 2015 21:08:34 +0300
From: Aleksey Cherepanov <lyosha@...nwall.com>
To: john-dev@...ts.openwall.com
Subject: simple wrapper around RNRT SAPHIR functions (sph_*) to generate
 selftests

I investigated some new *coin miners: some of them heavily rely onto
sph_* functions from RNRT SAPHIR project. The project contains scalar
implementations of various sha3 hashes with unified interface.

I wrote a simple program to call these functions easily. To add a new
hash, you need to add 2 lines: #include respective header and write:
al(hash_name);  in middle of program.

The program reads file specified as first argument and hashes each
line with each algo in code (al() calls both 256 and 512 bit
versions). On output, you get:
hash_name:hash:password

So self tests could be easily prepared with some post processing.

The program auto detects length of output hashs (hm, the lengths have
to be 256 and 512 as names suggest...).

I build it on top of cpuminer-multi, so it may be a bit dirty in sense
of paths of includes.
https://github.com/lucasjones/cpuminer-multi

But it should work well on top of original project. A link the
project?

To build
$ gcc cpuminer/sha3/minerd-sph_*.o -I cpuminer sph.c

Then, to run with empty password and \xff :
$ printf "\n\xff\n" > micro_words
$ ./a.out micro_words
blake256:5aca53d736759ea025a31d76c31bc18933f480416e200a935a89fc31d3964998:
blake512:a8cfbbd73726062df0c6864dda65defe58ef0cc52a5625090fa17601e1eecd1b628e94f396ae402a00acc9eab77b4d4c2e852aaaa25a636d80af3fc7913ef5b8:
bmw256:82cac4bf6f4c2b41fbcc0e0984e9d8b76d7662f8e1789cdfbd85682acc55577a:
bmw512:6a725655c42bc8a2a20549dd5a233a6a2beb01616975851fd122504e604b46af7d96697
[...]

The program needs final \n otherwise it does not hash last line.

At the moment, I am going to leave it here as is.

Thanks!

-- 
Regards,
Aleksey Cherepanov

View attachment "sph.c" of type "text/x-csrc" (2741 bytes)

Powered by blists - more mailing lists

Your e-mail address:

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.