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
F103726801: D6061.diff
Thu, Nov 28, 2:17 PM
F103726727: D6061.diff
Thu, Nov 28, 2:15 PM
Unknown Object (File)
Sun, Nov 24, 5:58 PM
Unknown Object (File)
Sat, Nov 23, 6:58 PM
Unknown Object (File)
Fri, Nov 22, 5:52 PM
Unknown Object (File)
Fri, Nov 22, 7:10 AM
Unknown Object (File)
Tue, Nov 19, 8:45 PM
Unknown Object (File)
Fri, Nov 15, 9:03 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 3530
Build 3570: 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
106

[static DIGEST_LEN]

115

[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.