Page MenuHomeFreeBSD

Implement SHA-512 truncated (224 and 256 bits)
ClosedPublic

Authored by allanjude on Apr 22 2016, 1:43 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Apr 11, 1:27 PM
Unknown Object (File)
Wed, Apr 3, 9:01 AM
Unknown Object (File)
Wed, Apr 3, 8:28 AM
Unknown Object (File)
Mar 8 2024, 8:24 PM
Unknown Object (File)
Mar 8 2024, 8:24 PM
Unknown Object (File)
Mar 8 2024, 8:04 PM
Unknown Object (File)
Mar 8 2024, 8:01 PM
Unknown Object (File)
Mar 8 2024, 8:01 PM
Subscribers

Details

Summary

This implements SHA-512/256, which generates a 256 bit hash, but using SHA-512 so is faster than SHA-256 on 64bit platforms.

The main goal of this implementation is to enable support for this faster hashing algorithm in ZFS

This is the follow on to r292782

Test Plan

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 4000
Build 4043: arc lint + arc unit

Event Timeline

allanjude retitled this revision from to Implement SHA-512 truncated (224 and 256 bits).
allanjude updated this object.
allanjude edited the test plan for this revision. (Show Details)
allanjude added reviewers: cperciva, jmg, delphij.

Found a typo.

sbin/md5/md5.1
87

I this think should be "a version".

allanjude edited edge metadata.

Fix typo spotted by bcr@

cem added inline comments.
sys/crypto/sha2/sha512c.c
331

what's "so are skipped" mean?

352–356

It seems like these aren't really necessary. I'd suggest removing them and adding a comment where they were in the header to use the SHA512_Update() routine.

359

Use digest[static ...] here :).

369

don't need to cast here.

391–395

Same quibble here.

398

Use digest[static DIGEST_LEN] :)

408

same as above

sys/crypto/sha2/sha512t.h
107

[static DIGEST_LEN]

116

[static DIGEST_LEN]

allanjude added inline comments.
sys/crypto/sha2/sha512c.c
331

I didn't define the _transform function because it just uses the regular SHA512 one. I'll reword this

352–356

Userland applications that implement this algo expect this symbol to exist in libmd.

359

ok

369

right

allanjude marked 3 inline comments as done.
allanjude edited edge metadata.

Update with feedback from cem@

sys/crypto/sha2/sha512c.c
331

still needs rewording

352–356

It seems like userland-only routines and declarations should live in userland, like the _File/_Data routines. But whatever.

369

cast still present

408

This extra cast got missed :)

allanjude edited edge metadata.

Parts of the previous update did not get submitted

cem edited edge metadata.
This revision is now accepted and ready to land.May 28 2016, 2:00 PM
This revision was automatically updated to reflect the committed changes.