Giter VIP home page Giter VIP logo

sm3-and-sm4's People

Contributors

xiangsong-guan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

sm3-and-sm4's Issues

SM3 hash is incorrect for inputs of a certain size

Example

Input:
ff27186ddc9b5f29a9c928583472f113c860b4781b24ea63852f211e48829fb7f93c8540e79aa3487f9789ddb0348e1a9090838f44d77fe7
Output:
F46E545D5B0D71AA45AC1790DFAD39DECE6AF7C22F966A361A35FEFAB5371E74

Info

I have tested 3 other implementations and, given the above input, they produce:
D649A9CF8544E0B7FD8DB124C1E85CBD934D66D6660F8EC6F45D571B5146597A

It seems that all inputs of lengths between 56-63 bytes consistently produce a hash that does not match up with other implementations, so I suspect this implementation has a bug.

The other implementations I tested were:

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.