LSH (hash function)


LSH is a cryptographic hash function designed in 2014 by South Korea to provide integrity in general-purpose software environments such as PCs and smart devices. LSH is one of the cryptographic algorithms approved by the Korean Cryptographic Module Validation Program.
And it is the national standard of South Korea.

Specification

The overall structure of the hash function LSH is shown in the following figure.
The hash function LSH has the wide-pipe Merkle-Damgård structure with one-zeros padding.
The message hashing process of LSH consists of the following three stages.
  1. Initialization:
  2. * One-zeros padding of a given bit string message.
  3. * Conversion to 32-word array message blocks from the padded bit string message.
  4. * Initialization of a chaining variable with the initialization vector.
  5. Compression:
  6. * Updating of chaining variables by iteration of a compression function with message blocks.
  7. Finalization:
  8. * Generation of an -bit hash value from the final chaining variable.

One-zeros padding of
Generation of message blocks, where from the padded bit string
for 'to do
end for
return'

The specifications of the hash function LSH are as follows.
AlgorithmDigest size in bits Number of step functions Chaining variable size in bitsMessage block size in bitsWord size in bits
LSH-256-22422426512102432
LSH-256-25625626512102432
LSH-512-224224281024204864
LSH-512-256256281024204864
LSH-512-384384281024204864
LSH-512-512512281024204864

Initialization

Let be a given bit string message.
The given is padded by one-zeros, i.e., the bit ‘1’ is appended to the end of, and the bit ‘0’s are appended until a bit length of a padded message is, where and is the smallest integer not less than.
Let be the one-zeros-padded -bit string of.
Then is considered as a -byte array, where for all.
The -byte array converts into a -word array as follows.
From the word array, we define the 32-word array message blocks as follows.
The 16-word array chaining variable is initialized to the initialization vector.
The initialization vector is as follows.
In the following tables, all values are expressed in hexadecimal form.
068608D362D8F7A7D76652AB4C600A43BDC40AA81ECA0B68DA1A89BE3147D354
707EB4F9F65B38626B0B2ABE56B8EC0ACF237286EE0D1727336365958BB8D05F

46A10F1FFDDCE486B41443A8198E6B9D3304388DB0F5A3C7B36061C47ADBD553
105D53782F74DE545C2F2D95F2553FBE8051357A138668C847AA4484E01AFB41

0C401E9FE8813A554A5F446268FD3D35FF13E452334F612AF8227661037E354A
A5F223723C9CA29D95D965A11AED397901E23835B9AB02CC52D49CBAD5B30616
9E5C2027773F4ED366A5C8801925B70122BBC85B4C6779D9C13171A42C559C23
31E2B67D25BE3813D522C4DEED8E4D83A79F5509B43FBAFEE00D2CD88B4B6C6A

6DC57C33DF989423D8EA7F6E8342C19976DF8356F8603AC440F1B44DE838223A
39FFE7CFC31484CD39C4326CC52815488A2FF85A346045D8FF202AA46DBDD61E
CF785B3CD5FCDB8B1F0323B64A8150BFFF75D972F29EA3552E567F30BF1CA9E1
B596875BF8FF6DBAFCCA39B089EF4615ECFF4017D020B4B67E77384C772ED802

53156A66292808F6B2C4F362B204C2BCB84B7213BFA05C4E976CEB7C1B299F73
DF0CC63C0570AE97DA4441BAA486CE3F6559F5D9B5F2ACC222DACF19B4B52A16
BBCDACEFDE80953AC9891A2879725B3E7C9FE6330237E440A30BA550553F7431
BB08043FB34E3E30A0DEC48D54618EAD150317267464BC5732D1501FDE63DC93

ADD50F3C7F07094EE3F3CEE8F9418A4FB527ECDE5B3D0AE92EF6DEC68076F501
8CB994CAE5ACA216FBB9EAE4BBA48CC7650A526174725FEA1F9A61A73F8D8085
B6607378173B539B1BC99853B0C0B9EDDF727FC19B182D47DBEF360CF893A457
4981F5E570147E80D00C4490CA7D3E305D73940C0E4AE1EC894085E2EDB2D819