Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

Two percent of zero is almost nothing.


devel / comp.lang.forth / Re: hmac-md5 hash for 64-bit Forth

SubjectAuthor
* hmac-md5 hash for 64-bit ForthKrishna Myneni
+* Re: hmac-md5 hash for 64-bit ForthKrishna Myneni
|+- Re: hmac-md5 hash for 64-bit ForthMarcel Hendrix
|`* Re: hmac-md5 hash for 64-bit ForthMarcel Hendrix
| `- Re: hmac-md5 hash for 64-bit ForthKrishna Myneni
+* Re: hmac-md5 hash for 64-bit ForthKrishna Myneni
|`* Re: hmac-md5 hash for 64-bit ForthMarcel Hendrix
| `* Re: hmac-md5 hash for 64-bit ForthAnton Ertl
|  +* Re: hmac-md5 hash for 64-bit ForthMarcel Hendrix
|  |`* Re: hmac-md5 hash for 64-bit ForthPaul Rubin
|  | `* Re: hmac-md5 hash for 64-bit ForthAnton Ertl
|  |  +- Re: hmac-md5 hash for 64-bit ForthAnton Ertl
|  |  +* Re: hmac-md5 hash for 64-bit ForthPaul Rubin
|  |  |`* Re: hmac-md5 hash for 64-bit ForthAnton Ertl
|  |  | `* Re: hmac-md5 hash for 64-bit ForthPaul Rubin
|  |  |  `- Re: hmac-md5 hash for 64-bit ForthAnton Ertl
|  |  `* Re: hmac-md5 hash for 64-bit ForthMarcel Hendrix
|  |   `* Re: hmac-md5 hash for 64-bit ForthAnton Ertl
|  |    +* Re: hmac-md5 hash for 64-bit ForthKrishna Myneni
|  |    |`* Re: hmac-md5 hash for 64-bit ForthAnton Ertl
|  |    | `* Re: hmac-md5 hash for 64-bit ForthPaul Rubin
|  |    |  `* Re: hmac-md5 hash for 64-bit ForthKrishna Myneni
|  |    |   `- Re: hmac-md5 hash for 64-bit ForthKrishna Myneni
|  |    `- Re: hmac-md5 hash for 64-bit ForthKrishna Myneni
|  `- Re: hmac-md5 hash for 64-bit Forthminf...@arcor.de
`- Re: hmac-md5 hash for 64-bit ForthKrishna Myneni

Pages:12
Re: hmac-md5 hash for 64-bit Forth

<stjhfi$ed1$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=16624&group=comp.lang.forth#16624

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: krishna....@ccreweb.org (Krishna Myneni)
Newsgroups: comp.lang.forth
Subject: Re: hmac-md5 hash for 64-bit Forth
Date: Fri, 4 Feb 2022 09:41:35 -0600
Organization: A noiseless patient Spider
Lines: 54
Message-ID: <stjhfi$ed1$1@dont-email.me>
References: <sshubo$tit$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Fri, 4 Feb 2022 15:41:38 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="b370b5881ec2e35aa893eb29daf57b5d";
logging-data="14753"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18PMNIVZGjN2uioMIgqJs0h"
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101
Thunderbird/91.4.0
Cancel-Lock: sha1:dYOYlkPeG7tSIOSJijAUnQYvdgA=
In-Reply-To: <sshubo$tit$1@dont-email.me>
Content-Language: en-US
 by: Krishna Myneni - Fri, 4 Feb 2022 15:41 UTC

On 1/22/22 15:52, Krishna Myneni wrote:
> While many of the Forth programs written for 32-bit Forths were easily
> ported to 64-bit kForth, in a way that the programs work on both 32-bit
> and 64-bit systems, one notable exception was Jabari Zakiya's program
> for computing the md5 sum of a buffer or a file, hmac-md5.4th. The
> program's arithmetic and logic depended on a 32-bit cell size.
>
....
> ... The revised program, which
> still needs a fix to run on big-endian systems, may be found in the most
> recent kForth-32 master and kForth-64 master repos on GitHub. Here is a
> link to the revised program:
>
> https://github.com/mynenik/kForth-64/blob/master/forth-src/hmac-md5.4th
>
> It will run the tests, executed by the word HMAC-TESTS properly under
> both 32-bit and 64-bit (little-endian) systems.
....
A subtle problem in the definition of the word STORELEN limited the
maximum file size for which an accurate MD5 hash could be generated on a
64-bit Forth system, to about 256 MB. The tests provided in the program
for small data buffers did not pick this up, but I recently performed
tests of the word MD5FILE on kforth64 and found that it gave the wrong
hash for files above this size. The problem does not occur on 32-bit
Forth systems, for which the hmac-md5.4th program was originally written
-- on 32-bit systems, the file size is limited anyway to about 2 GB.

The problem has been fixed, and the revised hmac-md5.4th now appears to
work properly for file sizes exceeding 256 MB. The revised file may be
found at

https://github.com/mynenik/kForth-64/blob/master/forth-src/hmac-md5.4th

The largest file I tested with the program under kforth64 was about 2.2 GB:

---
md5file StarTrails.mp4

Bytesize: 2245592130
MD5 Hash: 12f30e7bdf4c6a4f9974f1473e79ad56
---
$ md5sum StarTrails.mp4
12f30e7bdf4c6a4f9974f1473e79ad56 StarTrails.mp4
---

The hmac-md5.4th program, under kforth64, is really too slow to be
useful for such large files. Critical parts of the program need to be in
the form of CODE words.

--
Krishna

Pages:12
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor