summaryrefslogtreecommitdiffstats
path: root/sys/opencrypto/cryptosoft.c
Commit message (Collapse)AuthorAgeFilesLines
* Don't hang if encrypting/decrypting using struct iovecs where one of thedfr2008-10-301-0/+4
| | | | iovecs ends on a crypto block boundary.
* Retire the MALLOC and FREE macros. They are an abomination unto style(9).des2008-10-231-7/+7
| | | | MFC after: 3 months
* Integrate the Camellia Block Cipher. For more information see RFC 4132gnn2007-05-091-0/+6
| | | | | | | and its bibliography. Submitted by: Tomoyuki Okazaki <okazaki at kick dot gr dot jp> MFC after: 1 month
* Overhaul driver/subsystem api's:sam2007-03-211-45/+89
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | o make all crypto drivers have a device_t; pseudo drivers like the s/w crypto driver synthesize one o change the api between the crypto subsystem and drivers to use kobj; cryptodev_if.m defines this api o use the fact that all crypto drivers now have a device_t to add support for specifying which of several potential devices to use when doing crypto operations o add new ioctls that allow user apps to select a specific crypto device to use (previous ioctls maintained for compatibility) o overhaul crypto subsystem code to eliminate lots of cruft and hide implementation details from drivers o bring in numerous fixes from Michale Richardson/hifn; mostly for 795x parts o add an optional mechanism for mmap'ing the hifn 795x public key h/w to user space for use by openssl (not enabled by default) o update crypto test tools to use new ioctl's and add cmd line options to specify a device to use for tests These changes will also enable much future work on improving the core crypto subsystem; including proper load balancing and interposing code between the core and drivers to dispatch small operations to the s/w driver as appropriate. These changes were instigated by the work of Michael Richardson. Reviewed by: pjd Approved by: re
* Use newly added functions to simplify the code.pjd2006-06-041-82/+54
|
* Move COPYDATA() and COPYBACK() macros to cryptodev.h, they will be usedpjd2006-06-041-27/+0
| | | | in padlock(4) as well.
* Rename HMAC_BLOCK_MAXLEN to HMAC_MAX_BLOCK_LEN to be consistent withpjd2006-06-041-4/+4
| | | | EALG_MAX_BLOCK_LEN.
* Rename AALG_MAX_RESULT_LEN to HASH_MAX_LEN to look more constent withpjd2006-06-041-1/+1
| | | | other defines.
* Kill an unused argument.pjd2006-06-041-5/+5
|
* - Fix a very old bug in HMAC/SHA{384,512}. When HMAC is using SHA384pjd2006-05-171-89/+147
| | | | | | | | | | | | | | | | | | | | | | | | | | | | or SHA512, the blocksize is 128 bytes, not 64 bytes as anywhere else. The bug also exists in NetBSD, OpenBSD and various other independed implementations I look at. - We cannot decide which hash function to use for HMAC based on the key length, because any HMAC function can use any key length. To fix it split CRYPTO_SHA2_HMAC into three algorithm: CRYPTO_SHA2_256_HMAC, CRYPTO_SHA2_384_HMAC and CRYPTO_SHA2_512_HMAC. Those names are consistent with OpenBSD's naming. - Remove authsize field from auth_hash structure. - Allow consumer to define size of hash he wants to receive. This allows to use HMAC not only for IPsec, where 96 bits MAC is requested. The size of requested MAC is defined at newsession time in the cri_mlen field - when 0, entire MAC will be returned. - Add swcr_authprepare() function which prepares authentication key. - Allow to provide key for every authentication operation, not only at newsession time by honoring CRD_F_KEY_EXPLICIT flag. - Make giving key at newsession time optional - don't try to operate on it if its NULL. - Extend COPYBACK()/COPYDATA() macros to handle CRYPTO_BUF_CONTIG buffer type as well. - Accept CRYPTO_BUF_IOV buffer type in swcr_authcompute() as we have cuio_apply() now. - 16 bits for key length (SW_klen) is more than enough. Reviewed by: sam
* - Simplify the code by using arc4rand(9) instead of arc4random(9) in a loop.pjd2006-04-101-22/+3
| | | | | | - Correct a comment. MFC after: 2 weeks
* Fix memory leak which occurs when crypto.ko module is unloaded.pjd2006-03-281-0/+9
| | | | | Discussed with: sam MFC after 3 days
* refer opencrypto/cast.h directly.ume2005-03-111-1/+1
|
* /* -> /*- for license, minor formatting changesimp2005-01-071-1/+1
|
* Add CRD_F_KEY_EXPLICIT which allows the key to be changed perphk2004-02-021-0/+10
| | | | | | | | operation, just like it was possible to change the IV. Currently supported on Hifn and software engines only. Approved by: sam@
* style(9) pass and type fixups.bms2003-12-161-1/+1
| | | | Submitted by: bde
* Push m_apply() and m_getptr() up into the colleciton of standard mbufbms2003-12-151-8/+1
| | | | | | | | routines, and purge them from opencrypto. Reviewed by: sam Obtained from: NetBSD Sponsored by: spc.org
* Add support to eliminate a context switch per crypto op when using thesam2003-06-271-2/+2
| | | | | | | | | | | software crypto device: o record crypto device capabilities in each session id o add a capability that indicates if the crypto driver operates synchronously o tag the software crypto driver as operating synchronously This commit also introduces crypto session id macros that cleanup their construction and querying.
* Use __FBSDID().obrien2003-06-111-1/+3
|
* Change iov_base's type from `char *' to the standard `void *'. Allmike2002-10-111-1/+1
| | | | | uses of iov_base which assume its type is `char *' (in order to do pointer arithmetic) have been updated to cast iov_base to `char *'.
* In-kernel crypto framework derived from openbsd. This facility providessam2002-10-041-0/+1025
a consistent interface to h/w and s/w crypto algorithms for use by the kernel and (for h/w at least) by user-mode apps. Access for user-level code is through a /dev/crypto device that'll eventually be used by openssl to (potentially) accelerate many applications. Coming soon is an IPsec that makes use of this service to accelerate ESP, AH, and IPCOMP protocols. Included here is the "core" crypto support, /dev/crypto driver, various crypto algorithms that are not already present in the KAME crypto area, and support routines used by crypto device drivers. Obtained from: openbsd
OpenPOWER on IntegriCloud