summaryrefslogtreecommitdiffstats
path: root/sys/crypto/sha2
Commit message (Collapse)AuthorAgeFilesLines
* MFC r307521: libmd: introduce functions that operate on fd instead of filenameemaste2016-12-214-0/+40
|
* MFC r307584asomers2016-11-224-5/+10
| | | | | | | | | | | | | | Fix C++ includability of crypto headers with static array sizes C99 allows array function parameters to use the static keyword for their sizes. This tells the compiler that the parameter will have at least the specified size, and calling code will fail to compile if that guarantee is not met. However, this syntax is not legal in C++. This commit reverts r300824, which worked around the problem for sys/sys/md5.h only, and introduces a new macro: min_size(). min_size(x) can be used in headers as a static array size, but will still compile in C++ mode.
* Retune SHA2 code for improved performance on CPUs with more ILP andcperciva2016-05-292-190/+198
| | | | | | | | | | | | | | | a preference for memory load instructions over large code footprints with embedded immediate variables. On amd64 CPUs from 2007-2008 there is not a significant change, but amd64 CPUs from 2009-2010 get roughly 10% more throughput with this code; amd64 CPUs from 2011-2012 get roughly 15% more throughput; and AMD64 CPUs from 2013-2015 get 20-25% more throughput. The Raspberry Pi 2 increases its throughput by 6-8%. Sponsored by: Tarsnap Backup Inc. Performance tested by: allanjude MFC after: 3 weeks
* Implement SHA-512 truncated (224 and 256 bits)allanjude2016-05-282-0/+223
| | | | | | | | | | | | | | | | | | | This implements SHA-512/256, which generates a 256 bit hash by calculating the SHA-512 then truncating the result. A different initial value is used, making the result different from the first 256 bits of the SHA-512 of the same input. SHA-512 is ~50% faster than SHA-256 on 64bit platforms, so the result is a faster 256 bit hash. The main goal of this implementation is to enable support for this faster hashing algorithm in ZFS. The feature was introduced into ZFS in r289422, but is disconnected because SHA-512/256 support was missing. A further commit will enable it in ZFS. This is the follow on to r292782 Reviewed by: cem Sponsored by: ScaleEngine Inc. Differential Revision: https://reviews.freebsd.org/D6061
* crypto routines: Hint minimum buffer sizes to the compilercem2016-05-265-10/+10
| | | | | | | | | | | Use the C99 'static' keyword to hint to the compiler IVs and output digest sizes. The keyword informs the compiler of the minimum valid size for a given array. Obviously not every pointer can be validated (i.e., the compiler can produce false negative but not false positive reports). No functional change. No ABI change. Sponsored by: EMC / Isilon Storage Division
* Replace sys/crypto/sha2/sha2.c with lib/libmd/sha512c.callanjude2015-12-276-800/+581
| | | | | | | | | | | | | | | | | | cperciva's libmd implementation is 5-30% faster The same was done for SHA256 previously in r263218 cperciva's implementation was lacking SHA-384 which I implemented, validated against OpenSSL and the NIST documentation Extend sbin/md5 to create sha384(1) Chase dependancies on sys/crypto/sha2/sha2.{c,h} and replace them with sha512{c.c,.h} Reviewed by: cperciva, des, delphij Approved by: secteam, bapt (mentor) MFC after: 2 weeks Sponsored by: ScaleEngine Inc. Differential Revision: https://reviews.freebsd.org/D3929
* Complete the move that was started w/ r263218.. For some reason Ijmg2015-07-112-0/+47
| | | | | | | didn't delete the files, so that means we need to bring the changes in r282726 to the correct files.. make tinderbox completed with this patch...
* replace the kernel's version w/ cperciva's implementation... In alljmg2014-03-164-404/+15
| | | | | | | | | | | | | | | | | my tests, it is faster ~20%, even on an old IXP425 533MHz it is ~45% faster... This is partly due to loop unrolling, so the code size does significantly increase... I do plan on committing a version that rolls up the loops again for smaller code size for embedded systems where size is more important than absolute performance (it'll save ~6k code)... The kernel implementation is now shared w/ userland's libcrypt and libmd... We drop support for sha256 from sha2.c, so now sha2.c only contains sha384 and sha512... Reviewed by: secteam@
* copy these files from lib/libmd in preperation for moving these filesjmg2014-03-162-0/+347
| | | | into the kernel...
* Sync with KAME.delphij2013-07-092-5/+4
| | | | MFC after: 1 month
* Allow assert() to operate correctly when building userland code.rmh2013-07-091-1/+3
|
* Make private functions static.brucec2011-02-211-8/+8
| | | | | | | PR: kern/43611 Submitted by: Matt Emmerton <matt at gsicomp.on.ca> Reviewed by: kib MFC after: 3 days
* Initialize T1 to silent gcc warning.kevlo2006-10-221-1/+1
| | | | Approved by: cognet
* GCC 3.4.6 gets confused on this file and produces bogus warning.kan2006-08-261-1/+1
| | | | Shut it up.
* Correctly bzero the entire context, not just the first sizeof(void *) bytes.phk2003-09-081-6/+6
| | | | Found by: Juergen Buchmueller <pullmoll@stop1984.com>
* Use __FBSDID().obrien2003-06-101-2/+2
|
* Make this compilable from userland as well.phk2002-11-011-0/+4
|
* Fix some really pedantic GCC warnings.markm2002-07-151-5/+5
|
* Remove __P.alfred2002-03-201-17/+17
|
* off by one error in Aaron Gifford's code. KAME PR 393.ume2002-02-261-3/+3
| | | | | | PR: kern/34242 Submitted by: Aaron D. Gifford <agifford@infowest.com> MFC after: 1 week
* less warningume2001-06-161-2/+2
| | | | warning: cast discards qualifiers from pointer target type
* Sync with recent KAME.ume2001-06-112-0/+1189
This work was based on kame-20010528-freebsd43-snap.tgz and some critical problem after the snap was out were fixed. There are many many changes since last KAME merge. TODO: - The definitions of SADB_* in sys/net/pfkeyv2.h are still different from RFC2407/IANA assignment because of binary compatibility issue. It should be fixed under 5-CURRENT. - ip6po_m member of struct ip6_pktopts is no longer used. But, it is still there because of binary compatibility issue. It should be removed under 5-CURRENT. Reviewed by: itojun Obtained from: KAME MFC after: 3 weeks
OpenPOWER on IntegriCloud