This article is a mirror article of machine translation, please click here to jump to the original article.

View: 14379|Reply: 0

[C] SMS4 algorithm, just understood and written, the next step is to prepare the SM3 hash algorithm

[Copy link]
Posted on 12/22/2015 11:56:48 PM | | |
SM3 Cryptographic Hashing Algorithm[url=]edit[/url]
useThe commercial algorithm compiled by the National Cryptography Administration is used for digital signature and verification in cryptographic applications, the generation and verification of message authentication codes, and the generation of random numbers, which can meet the security requirements of a variety of cryptographic applications.

Algorithm descriptionFor message m with a length of l(l< 2^64) bits, the SM3 hash algorithm is filled and iteratively compressed to generate a hash value with a length of 256 bits.
Suppose the length of message m is l bits. Start by adding the bit "1" to the end of the message, followed by k "0s", where k is the smallest non-negative integer that satisfies l + 1 + k 448mod512. Then add a 64-bit bit string, which is a binary representation of length l.
The bit length of the padded message m′ is a multiple of 512.
For example, for a message 01100001 01100010 01100011, its length l=24, the bit string is populated:
01100001 01100010 01100011 1 00...00 (423 bits) 00...011000 (binary representation of 64 bits l)
Copy it for everyone to see. Casual posts, everyone is free to take a look. After all, this algorithm is not something that can be done in a day or two, let's work together.






Previous:The Internet of Things market reproduces the dark horse of domestic chips - ESP32
Next:C# implements Socket communication client code
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com