Giter Site home page Giter Site logo

Proper SHA3 implementation? about sha3 HOT 8 CLOSED

johanns avatar johanns commented on September 27, 2024
Proper SHA3 implementation?

from sha3.

Comments (8)

iagox86 avatar iagox86 commented on September 27, 2024

It appears to be a padding issue.. NIST changed the padding to be:

SHA3-256(M) = K ECCAK [512] (M || 01, 256);

But this implementation doesn't account for the 01 bits in the padding. After padding the empty string, the first byte should be '06', not '01', to account for the extra 01 at the start (6 = 00000110, reversing endian = 01100000, the current padding is 10000......, but the proper padding is that one, 01 then 10000.......

from sha3.

johanns avatar johanns commented on September 27, 2024

@iagox86 This version of the gem is based on the original (optimized) C reference implementation released by Keccak team. I know that they have updated their implementation, and provide FIPS 202 support, but the gem's backing code MAY require a good amount of rewrite. Nonetheless, this is something I've been wanting to do, and I suppose it should be done sooner rather than later.

I'll look into this, but considering my schedule, I'm doubtful that I'll be able to complete a new release quickly (2 - 3 weeks would be optimistic). Of course, pull requests are welcome. :)

from sha3.

johanns avatar johanns commented on September 27, 2024

@iagox86 Quick update: I've managed to get SHA3-256 (FIPS 202) tests to pass. There is still quite a bit of work that needs to be done, but I should have it completed sooner than 2-weeks.

from sha3.

iagox86 avatar iagox86 commented on September 27, 2024

Sweet, thanks!

On Wed, Oct 21, 2015 at 11:34 AM, Johanns Gregorian <
[email protected]> wrote:

@iagox86 https://github.com/iagox86 Quick update: I've managed to get
SHA3-256 (FIPS 202) tests to pass. There is still quite a bit of work that
needs to be done, but I should have it completed sooner than 2-weeks.


Reply to this email directly or view it on GitHub
#6 (comment).

from sha3.

johanns avatar johanns commented on September 27, 2024

@iagox86 I think it's done. I haven't cut a new gem yet, but you can grab a pre-release here:

https://github.com/johanns/sha3/releases/tag/v1.0.1

A few notes:

  • There is no Keccak (non-FIPS) mode -- in other words, it's not backwards compatible (but fully SHA3 compliant). I didn't think this was necessary/required, and it was simpler to replace, rather than augment.
  • I haven't implemented SHAKE128/256 functions, yet.

Let me know if this meets your expectations, and/or if you find any bugs.

from sha3.

iagox86 avatar iagox86 commented on September 27, 2024

Awesome, I'll check it out! Thanks for the update!

On Thu, Oct 22, 2015 at 12:11 AM, Johanns Gregorian <
[email protected]> wrote:

@iagox86 https://github.com/iagox86 I think it's done. I haven't cut a
new gem yet, but you can grab a pre-release here:

https://github.com/johanns/sha3/releases/tag/v1.0.1

A few notes:

  • There is no Keccak (non-FIPS) mode -- in other words, it's not
    backwards compatible (but fully SHA3 compliant). I didn't think this was
    necessary/required, and it was simpler to replace, rather than augment.
  • I haven't implemented SHAKE128/256 functions, yet.

Let me know if this meets your expectations, and/or if you find any bugs.


Reply to this email directly or view it on GitHub
#6 (comment).

from sha3.

iagox86 avatar iagox86 commented on September 27, 2024

Just letting you know that (at least for what I'm doing), it's working perfectly!

from sha3.

mmoghadas avatar mmoghadas commented on September 27, 2024

@iagox86 - Thanks for the feedback!

from sha3.

Related Issues (13)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.