summaryrefslogtreecommitdiffstats
path: root/sys/crypto (follow)
Commit message (Collapse)AuthorAgeFilesLines
* two fairly simple sizes for free()deraadt2015-08-311-3/+4
|
* fairly simple sizes for free(); ok teduderaadt2015-08-281-3/+5
|
* Include <sys/param.h> rather than <sys/types.h> when also includingmiod2015-03-161-2/+2
| | | | | <sys/systm.h>; fixes build on vax due to <machine/macros.h> redeclaring some functions from <lib/libkern/libkern.h> as inlines.
* Remove wrong reference to zlib.logan2015-03-141-2/+2
| | | | OK deraadt@
* Remove some includes include-what-you-use claims don'tjsg2015-03-146-13/+5
| | | | | | | have any direct symbols used. Tested for indirect use by compiling amd64/i386/sparc64 kernels. ok tedu@ deraadt@
* Use standard spelling for types, and rename local variable from "free".tedu2015-02-202-25/+25
| | | | | No actual change, but makes it easier to reuse the code elsewhere. Suggested by Andre Smagin
* we want to defer work traditionally (in openbsd) handled in andlg2015-02-091-2/+2
| | | | | | | | | | | | | | | | | | | | | interrupt context to a taskq running in a thread. however, there is a concern that if we do that then we allow accidental use of sleeping APIs in this work, which will make it harder to move the work back to interrupts in the future. guenther and kettenis came up with the idea of marking a proc with CANTSLEEP which the sleep paths can check and panic on. this builds on that so you create taskqs that run with CANTSLEEP set except when they need to sleep for more tasks to run. the taskq_create api is changed to take a flags argument so users can specify CANTSLEEP. MPSAFE is also passed via this flags field now. this means archs that defined IPL_MPSAFE to 0 can now create mpsafe taskqs too. lots of discussion at s2k15 ok guenther@ miod@ mpi@ tedu@ pelikan@
* keep this in sync a bit with userland by putting static on functionsdlg2015-02-071-5/+5
| | | | | | | | | | | that are only used in this file. tedu argues if something sucks we would fault before we can get to these, and they dont do anything except maths. these symbols dont need to be visible to ddb. originally from Fritjof Bornebusch suggested by and ok tedu@
* remove the second void * argument on tasks.dlg2015-01-271-4/+3
| | | | | | | | | | | | | | | | | | | | | when workqs were introduced, we provided a second argument so you could pass a thing and some context to work on it in. there were very few things that took advantage of the second argument, so when i introduced pools i suggested removing it. since tasks were meant to replace workqs, it was requested that we keep the second argument to make porting from workqs to tasks easier. now that workqs are gone, i had a look at the use of the second argument again and found only one good use of it (vdsp(4) on sparc64 if you're interested) and a tiny handful of questionable uses. the vast majority of tasks only used a single argument. i have since modified all tasks that used two args to only use one, so now we can remove the second argument. so this is a mechanical change. all tasks only passed NULL as their second argument, so we can just remove it. ok krw@
* Less code, more better. No longer need to worry about what mysterioustedu2015-01-161-52/+2
| | | | things will happen when machines have 8 byte longs.
* remove static version stringtedu2015-01-151-3/+1
|
* simplify des headers by stripping out all the unnecessary userland bitstedu2015-01-152-296/+17
| | | | ok deraadt
* Use __buffer__ instead of __string__ as the __bounded type. The former causesmiod2015-01-041-3/+3
| | | | | | extra warnings with gcc 3, due to the way we use siphash in the filesystem code. With dlg@
* recent changes broke alignment requirements on arm.tedu2014-12-311-13/+7
| | | | | | simplify a bit more, swapping only aligned values and then using memcpy to fill the digest. fix confirmed by jsg. ok jsg kettenis millert
* add __bounded as appropriate.dlg2014-12-301-4/+7
| | | | looks good to deraadt@ miod@ and tedu@
* convert bcopy to memcpy in md5 and sha1. also be consistent about clearingtedu2014-12-282-28/+16
| | | | context and making digest required to Final.
* remove KPDK. not really used, and a bad choice anyway. ok naddytedu2014-12-284-82/+4
|
* as in libc, always assume digest is passed to Final. no null allowed.tedu2014-12-231-66/+55
|
* as in libc, there's no need to check for calling Init on null contexttedu2014-12-231-7/+1
|
* use endian.h swap macros instead of home grown versionstedu2014-12-231-31/+7
|
* openbsd rcisdtedu2014-12-201-0/+1
|
* make the code look more like libc by changing Transform to take the statetedu2014-12-191-87/+83
| | | | ok millert
* convert bcopy/zero to memcpy. ok deraadt djmtedu2014-12-191-24/+29
|
* only unroll on i386 and amd64 (where confirmed to be much faster).tedu2014-12-181-2/+3
| | | | | naddy found sparc64 gets a little slower when unrolled. ok deraadt
* unroll loops for sha2. quite a bit faster for amd64.tedu2014-12-171-1/+4
| | | | ok deraadt millert
* Sync our kernel AES code to the one shipped in OpenSSL/LibreSSL.mikeb2014-11-171-198/+99
| | | | | | | | This includes a commit made by Andy Polyakov <appro at openssl ! org> to the OpenSSL source tree on Wed, 28 Jun 2006 with the following message: "Mitigate cache-collision timing attack on last round." OK naddy, miod
* Defining the interface in terms of char * means most callers aretedu2014-11-166-19/+23
| | | | | | | | | | | | required to cast their pointers, which is ugly and possibly error prone. accidentally casting an int to a pointer, for example, instead of the address of the int. implicit void * casting is safer. This updates the kernel hash interfaces to use void *. Similar changes are possible for userland. I think it's safe, but there may be some peculiar source compatbility issues there, so let's just do the kernel first. ok dlg millert
* Improve performance of an internal loop by saving up on branchingmikeb2014-11-121-8/+8
| | | | Pointed out by John-Mark Gurney <jmg at funkthat ! com>, thanks!
* introduce SipHash, designed by Jean-Phillippe Aumasson and Danieldlg2014-11-042-0/+265
| | | | | | | | | | | | | | J. Bernstein, as described at https://131002.net/siphash/, and via Andre Oppermanns implementation in FreeBSD. this is supposed to be a good but cheap hash for use in places where you want to protect against hash bucket flooding attacks. yasuoka@ pointed me at this after i asked about possibilities for protecting the in_pcb hash he was tinkering with. naddy@ mikeb@ claudio@ and djm@ agree it is much better than doing nothing commit deraadt@
* pools lock themselves now, we just have to tell them what IPL theydlg2014-10-231-13/+4
| | | | | | | | | | will be used from. this adds pool_setipl at IPL_VM to the crypto descriptor pools, and removes all the splvm handling around the use of those pools. tested by many via tech@ ok kettenis@ deraadt@
* apply only the bit of r1.69 that should have been committed:dlg2014-10-231-2/+2
| | | | | | | | | | | | | make the crypto taskq protect things at IPL_VM instead of IPL_HIGH. everything else in crypto.c uses splvm/IPL_VM. it seems this IPL_HIGH came about because the hand rolled task list and thread that crypto used to use was converted to workqs, which unconditionally used IPL_HIGH internally. when it was converted from workqs to tasks it blindly ported the protection workqs gave. tested by many via tech@ and snapshots ok kettenis@
* revert previous. it did more than the commit message said it did.dlg2014-10-231-5/+14
|
* make the crypto taskq protect things at IPL_VM instead of IPL_HIGH.dlg2014-10-221-14/+5
| | | | | | | | | | | everything else in crypto.c uses splvm/IPL_VM. it seems this IPL_HIGH came about because the hand rolled task list and thread that crypto used to use was converted to workqs, which unconditionally used IPL_HIGH internally. when it was converted from workqs to tasks it blindly ported the protection workqs gave. tested by many via tech@ and snapshots ok kettenis@
* replace bzeros after allocations with M_ZERO and PR_ZERO as appropriate.dlg2014-10-201-9/+4
| | | | ok deraadt@
* remove uneeded proc.h includesjsg2014-09-142-4/+2
| | | | ok mpi@ kspillner@
* Bye bye /dev/cryptomikeb2014-08-201-0/+0
| | | | | | | The interface has been disabled by default for about 4 years and currently there's not much value in having it around at all. ok deraadt
* Bye bye /dev/cryptomikeb2014-08-203-951/+2
| | | | | | | The interface has been disabled by default for about 4 years and currently there's not much value in having it around at all. ok deraadt
* dont rely on mbuf.h to provide pool.h.dlg2014-08-181-1/+2
| | | | | ok miod@, who has offerred to help with any MD fallout ok guenther@
* use mallocarray()deraadt2014-07-132-6/+6
|
* do not need malloc.hderaadt2014-07-131-2/+1
|
* add a size argument to free. will be used soon, but for now default to 0.tedu2014-07-124-28/+28
| | | | after discussions with beck deraadt kettenis.
* decouple struct uvmexp into a new file, so that uvm_extern.h and sysctl.hderaadt2014-07-081-3/+1
| | | | | don't need to be married. ok guenther miod beck jsing kettenis
* fix IPComp interop with linux: switch Z_PARTIAL_FLUSH to Z_FINISH formarkus2014-02-181-20/+15
| | | | deflate(); this hurts interop with broken old openbsd releases; ok reyk@
* - grow the decompression buffer more aggressively if we havemarkus2014-02-111-16/+15
| | | | | | | a high compression ratio, e.g. for ping -s 10000 -p aa - deal with inflate returning Z_BUF_ERROR if the output buffer is full. this can happen in some edge cases with upgraded libz from 2004 ok mikeb@
* cc_queued is not used for anything atm, remove it; ok jsing, markusmikeb2014-01-211-17/+1
|
* Respect CRYPTO_F_NOQUEUE flag when dispatching a crypto operationmikeb2014-01-211-2/+2
| | | | ok jsing, markus
* ansify some function definitions and tidy up this code style wise. thisbrad2013-11-183-206/+188
| | | | | | ancient code looked pretty crummy. ok deraadt@
* replace rc4 with ChaCha20 here, too; ok djm, tedu, deraadtmarkus2013-11-021-0/+220
|
* convert crypto work queue to the task_add(9) api; ok dlgmikeb2013-10-312-17/+18
|
* Allocate and deallocate memory for encryption contexts within cryptosoft,jsing2013-08-253-172/+79
| | | | | | | | rather than requiring each algorithm to provide their own memory handling. This matches the interface already provided by cryptosoft for authentication algorithms and removes the need for zerokey functions. ok mikeb@