Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.forth > #18019

Re: SHA-512

From mhx@iae.nl (Marcel Hendrix)
Subject Re: SHA-512
Newsgroups comp.lang.forth
Message-ID <93831389918435@frunobulax.edu> (permalink)
Date 2012-12-14 22:52 +0200
References <0bea10e6-ccf1-4ec0-ba3a-fe0183afd4ad@googlegroups.com>
Organization Wanadoo

Show all headers | View raw


jzakiya@gmail.com writes Re: SHA-512

> On Thursday, December 13, 2012 2:33:28 PM UTC-5, Marcel Hendrix wrote:
>> jzakiya@gmail.com writes Re: SHA-512
> [..]
> I thought the problem was bytes>< because 'abc' was too small to show the 
> bytes being reversed incorrectly.

If you thought bytes>< was wrong, why didn't you tell me so? Luckily 
I immediately spotted the problem when I dumped the W buffer at the start 
of SHA512.

> So now use shafile and take the sha512 hash of a really big file (like a 
> linux distro or video file) and see that it works correctly. I haven't found 
> sha512 signatures of distros yet, but FREEBSD has sha256 hashes of their iso 
> which I've checked them against with shafile.

Further checks are only possible when the SHA512 hash of the test file is 
known. SHA256 can't tell me that SHA512 is correct. SHA512 might fail when
size is a multiple of 128 bytes, a multiple + some, or a multiple of 
4 GBytes.

> In fact on Windows 7, SwiftForth ran test3 in 15+ seconds for sha256, which
> VFX took 17+ seconds (haven't done Win32Forth).
> Will try on Gforth when I get a chance.
[..]

On my machine (i7 920 2,66 GHz) I now get 14.4 seconds for SHA512. This is
1000 * 1MB / 14.4s / 2.66 GHz = 26 MB/s/GHz.

For a big file:

FORTH> S" C:\idfwforth\df_snapshot_4.0_2010_08_19.tar.gz" TIMER-RESET @SHAfile .ELAPSED
Bytesize: 385,241,618
SHA-512 :
45800c7d8fe7c13f 6670176b93b82c34 6f6f072ff1f50aee 586ccd6e7b02ef7c e27eb8f5a3cb814a 74e1d18b3107ea9b 8fdf171bf573a420 2a666c67703437bf
3.320 seconds elapsed. ok

FORTH> 385.241618e 3.320e f/ 2.66e f/ f. 43.622794  ok
FORTH> 385.241618e 3.320e f/ f. 116.036632  ok

Strangely enough this is 43.6 MB/s/GHz, or 116MB/s, so diskfile I/O makse it 
twice faster??

The NIST reference implementation for SHA512 quotes 99 MB/s on a 1.8 GHz Core2.

-marcel

Back to comp.lang.forth | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

SHA-512 mhx@iae.nl (Marcel Hendrix) - 2012-12-02 23:48 +0200
  Re: SHA-512 jzakiya@gmail.com - 2012-12-07 14:47 -0800
    Re: SHA-512 Coos Haak <chforth@hccnet.nl> - 2012-12-08 00:49 +0100
      Re: SHA-512 jzakiya@gmail.com - 2012-12-07 16:54 -0800
        Re: SHA-512 Coos Haak <chforth@hccnet.nl> - 2012-12-08 18:21 +0100
      Re: SHA-512 jzakiya@gmail.com - 2012-12-08 18:36 -0800
        Re: SHA-512 mhx@iae.nl (Marcel Hendrix) - 2012-12-09 09:14 +0200
          Re: SHA-512 jzakiya@gmail.com - 2012-12-09 17:23 -0800
            Re: SHA-512 jzakiya@gmail.com - 2012-12-09 17:29 -0800
              Re: SHA-512 jzakiya@gmail.com - 2012-12-09 20:46 -0800
              Re: SHA-512 m.a.m.hendrix@tue.nl - 2012-12-10 03:53 -0800
                Re: SHA-512 jzakiya@gmail.com - 2012-12-10 13:05 -0800
                Re: SHA-512 mhx@iae.nl (Marcel Hendrix) - 2012-12-10 23:17 +0200
                Re: SHA-512 jzakiya@gmail.com - 2012-12-13 06:30 -0800
                Re: SHA-512 mhx@iae.nl (Marcel Hendrix) - 2012-12-13 21:33 +0200
                Re: SHA-512 jzakiya@gmail.com - 2012-12-13 19:38 -0800
                Re: SHA-512 mhx@iae.nl (Marcel Hendrix) - 2012-12-14 22:52 +0200
                Re: SHA-512 jzakiya@gmail.com - 2012-12-14 16:39 -0800
                Re: SHA-512 mhx@iae.nl (Marcel Hendrix) - 2012-12-15 19:11 +0200
                Re: SHA-512 mhx@iae.nl (Marcel Hendrix) - 2012-12-16 16:00 +0200
                Re: SHA-512 jzakiya@gmail.com - 2012-12-16 17:33 -0800
                Re: SHA-512 jzakiya@gmail.com - 2012-12-16 22:35 -0800
                Re: SHA-512 mhx@iae.nl (Marcel Hendrix) - 2012-12-17 10:14 +0200
                Re: SHA-512 mhx@iae.nl (Marcel Hendrix) - 2012-12-17 10:51 +0200
                Re: SHA-512 jzakiya@gmail.com - 2012-12-17 09:13 -0800
                Re: SHA-512 mhx@iae.nl (Marcel Hendrix) - 2012-12-17 22:24 +0200
                Re: SHA-512 jzakiya@gmail.com - 2013-01-15 20:38 -0800
                Re: SHA-512 jzakiya@gmail.com - 2013-01-15 20:54 -0800
                Re: SHA-512 Howerd <howerdo@yahoo.co.uk> - 2012-12-13 13:06 -0800
                Re: SHA-512 Howerd <howerdo@yahoo.co.uk> - 2012-12-13 13:03 -0800
    Re: SHA-512 mhx@iae.nl (Marcel Hendrix) - 2012-12-08 22:08 +0200

csiph-web