9front - general discussion about 9front
 help / color / mirror / Atom feed
From: fulton@fulton.software
To: 9front@9front.org
Subject: Re: [9front] [PATCH] sha3 but fixed the code style
Date: Thu, 03 Jun 2021 08:24:35 -0700	[thread overview]
Message-ID: <CF9CF4656DD54C9192D8E75324D6C3E4@fulton.software> (raw)
In-Reply-To: <CABO6she9USNiYAYZ=6N-0EgEiYvoSG3BK03JTK_UvM5_2iwbAQ@mail.gmail.com>

Quoth kemal <kemalinanc8@gmail.com>:
> hello,
> 
> > - sha3_keccakf() seems more than sub-optimal
> >
> > 64-bit constants need to have ULL prefix.
> >
> > for example, the indexing will be done twice because of the ROTL64() macro
> >
> > loops not unrolled, especially with the mod 5 indexing (divisions can be
> > very slow)
> 
> i stole go's keccakf code, and translated it into c. it just uses
> bitwise operations and loops are unrolled. looks definitely better
> than the current one. can fulton test if this actually works?
> 
> http://okturing.com/src/11179/body
> 
That didn't seem to work. it should look like this:

; echo test | sha1sum -3 256
34a0b893b66e312a8b0f7dc4bc4c7930b67f8823513aff5444fb5c64aa060c5a
; echo test | sha1sum -3 512
1a39794b53431e9abc34368ed4824dbac59d6c6417792279b0ec2c91d6eb58af72f9d4b1e3b613a05891c2c1a17a820bcf829cb323c4299b219e5ab299794581
; sha1sum -3 256 /386/9pc
512b4ee0051cdac52210e1216786aa43625aad842a9d4d2a6f796738692715ef	/386/9pc
; 

Verified by rhash(1) on unix

This isi what thr go patch looks like:
;  echo test | ./sha1sum -3 256
1b39c5c0855bccd2ebf2a8c490f7cfb49c276a9b81fb336c5621e235fa5390fd
;  echo test | ./sha1sum -3 512
dfbef5bc56120523b305cca4254ba61a94393cd7808d5c6434f09664793ecca5ccb2b7ac2b483430d42d6b42654d48d514ad2385699c586f885622e013ce27b0
; ./sha1sum -3 256 /386/9pc
e758b8170222a207a584df37662b9095c71310c1411cfa9b95b63a1dfa30af9d	/386/9pc

I'll look in to it. It may just be a case of not enough rounds (should be 24) or some simple bug like that,

--
Fulton fulton.software!fulton

  parent reply	other threads:[~2021-06-06  5:20 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-31 16:00 fulton
2021-06-01 12:46 ` cinap_lenrek
2021-06-01 15:09   ` fulton
2021-06-02 12:16     ` cinap_lenrek
2021-06-01 19:51   ` fulton
2021-06-02 12:15     ` cinap_lenrek
2021-06-02 13:46       ` kemal
2021-06-02 14:16         ` kemal
2021-06-03  1:30           ` ori
2021-06-03 16:56           ` fulton
2021-06-02 14:45         ` cinap_lenrek
2021-06-03 15:24         ` fulton [this message]
2021-06-02 21:04       ` fulton
2021-06-03 20:28         ` hiro

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CF9CF4656DD54C9192D8E75324D6C3E4@fulton.software \
    --to=fulton@fulton.software \
    --cc=9front@9front.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).