summaryrefslogtreecommitdiff
path: root/sys/dev/pci/ubsec.c
AgeCommit message (Collapse)Author
2004-05-07Replace RSA-derived md5 code with code derived from Colin Plumb's PD version.Todd C. Miller
This moves md5.c out of libkern and into sys/crypto where it belongs (as requested by markus@). Note that md5.c is still mandatory (dev/rnd.c uses it). Verified with IPsec + hmac-md5 and tcp md5sig. OK henning@ and hshoexer@
2004-05-04Remove useless ``elm'' argument from the SIMPLEQ_REMOVE_HEAD macro.Alexander Yurchenko
This matches our SLIST behaviour and NetBSD's SIMPLEQ as well. ok millert krw deraadt
2004-02-03advertise features of our crypto chips better; ok tdevalTheo de Raadt
jason is being a slacker
2004-01-09remove uvm_extern.hBrad Smith
tested on alpha, i386, powerpc, sparc64, m68k. ok miod@
2003-09-03support for bcm5823; based on patch from Jim Lambert, jlamber at futurex dot ↵Jason Wright
com; ok deraadt.
2003-08-14kill unneeded caddr_t casts for *_copybackJason Wright
2003-08-08x is probably just as random as letoh32(x), don't bother byte swapping the ↵Jason Wright
numbers from the RNG.
2003-08-01ansiTheo de Raadt
2003-06-04nuke clause 3 & 4 (ok with patrik)Jason Wright
2003-04-19correct opacket/obytes statistics; from sam@freebsdJason Wright
2003-04-19Make the ubsec_feed* routines void, noone looks at the return value (always ↵Jason Wright
zero anyway); from freebsd.
2003-04-02add support for the other Sun Crypto 1000; from sam at errno dot comJason Wright
2003-02-14Let UBSEC_DEBUG compile; based on diff from sam at errno dot comJason Wright
(also nuke the last vtophys so it'll even work on sparc64)
2002-12-06Don't use the RNG oscillator output directly, use the sha1'd version (theJason Wright
the direct data does not pass 1/2 of the FIPS140-2 tests with any degree of regularity).
2002-12-05Treat RNGSHA1 operations the same as RNGBYPASS for callback purposes (theyJason Wright
produce the same size/format data).
2002-11-21From Angelos:Jason Wright
- simplistic load balancing across multiple cards - simplified registration process - a few style nits.
2002-11-19Add a simplistic table driven lookup routine and use it where appropriate.Jason Wright
2002-10-12Remove more '\n's from panic() statements. Both trailing and leading.Kenneth R Westerback
Diff generated by Chris Kuethe.
2002-10-10Match the Sun Crypto Adapter 1000, it appears to be a broadcom 5821.Jason Wright
2002-10-05match 5822Jason Wright
2002-09-24Don't use constants for the output parameter, use the iparam count as a ↵Jason Wright
pointer to the first result location.
2002-09-19remember: bits is bits and bytes is bytes... use -byte- count for bcopy notJason Wright
bits. Also, the conversion between bits and bytes involves a division by 8 not 2. (The latter pointed out by Francis Cianfrocca <vze32r6m@verizon.net>)
2002-09-12- Split out the hardware and software normalization versions of modexp...Jason Wright
I screwed something up when the function was trying to do both and it's much easier to read this way (and heck, even works). - Enable hardware normalization for chips that support it
2002-09-11- On reset, disable hardware normalization for 582x and make sure the chip ↵Jason Wright
is in little endian mode. - since sw normalization is now the only option, simplify normalization handling - remove some leftover #if 0 code
2002-09-04Treat 5822 the same as 5820Jason Wright
2002-09-045801 has no pk or rng supportJason Wright
2002-09-03add support for 5801 and 5802 which appear to be 5805's as far as sw is ↵Jason Wright
concerned
2002-07-085821 has two additional bits that must be ack'd (note they don't haveJason Wright
corresponding enable bits... they are always on... dain bramage).
2002-07-05Never call crp_callback directly, use crypto_done() insteadJason Wright
2002-07-05KNF (no space after casts)Jason Wright
2002-07-03But when denormalizing we need the normalized length, too as well as the ↵Jason Wright
destination length.
2002-07-03result only needs to be as big as the number of real bits in the modulusJason Wright
2002-06-17remove noisy jason debug printf blatther. bad pTheo de Raadt
2002-05-16Normalize the exponent too. This allows exponents with bit lengths differentJason Wright
from base/modulus to work on 5805.
2002-05-16Re-enable RNG on the 5601 (it needs to be disabled on some 5805 variants,Jason Wright
but I'm not sure which revisions yet).
2002-05-15Rework MODEXP:Jason Wright
5805 (and 5601) require the modulus and base to be normalized to the right of one of several different register lengths. The result is also normalized to the same length. Provide functions for shifting the bits back and forth as appropriate. Note: for consistencies sake the exponent is NOT normalized.
2002-05-13add and use three more flags:Jason Wright
RNG: chip has usable rng (5805/5820/5821) HWNORM: chip will automagically normalize bignums (5820/5821) BIGKEY: chip supports "large keys" (5820/5821)
2002-05-08- Go ahead and register to handle CRK_MOD_EXP_CRT opsJason Wright
- completely (almost) revamp kprocess_rsapriv to match what the chip expects - add and use a function to compute the significant bits of a given number (this will be necessary for normalization) [Still doesn't reproduce the broadcom or provos test data, but it's closer...]
2002-05-06basic infrastructure for handling RSA with CRT parameters. Just need toJason Wright
figure out how p, q, dp, dq, and pinv fit into the context.
2002-05-06- Only copy the significant bits of the result out (and make sure the bufferJason Wright
is long enough to handle it) and bzero the rest. - Increase key buffer sizes to 2048 bits.
2002-05-02the exponent parameter is:Jason Wright
1. byte counted (not word count * 4 counted) 2. not normalized (we don't normalize anything yet, so no biggy) Increase maximum size of exponent to 2048 bits. (Better length checks coming soon)
2002-05-02More of previous (don't refer to parameters by index directly)Jason Wright
Also, add a sanity check that the result bits must be >= modulus bits.
2002-05-02Don't refer to the parameters directly by number, use macro's so it can beJason Wright
changed later if necessary. Also, don't bother bzero'n the mcr, all of the fields are initialized anyway
2002-05-01- make sure 'me' is initializedJason Wright
- compute modulus bits early (if its too big, return E2BIG) - modulus bits must be rounded to 512/768/1024 (and/or 1536/2048 for 5820) - allocate the result based on modulus bits and bzero it - add two diagnostic checks that will hang the chip: unaligned result/length [score so far: 655 out of 1000 test cases work for modexp on 5820]
2002-04-30- Output chain length must be equal to the byte count of the modulus lengthJason Wright
- document parameter order (it may yet change) - don't bother setting mcr_pktlen, it isn't used
2002-04-28make UBSEC_NO_RNG work correctly (ie. it means no RNG, not no MCR2 operations)Jason Wright
2002-04-26debug stuff inside #ifdefTheo de Raadt
2002-04-26missed one; deraadtJason Wright
2002-04-261024 bit maxJason Wright
2002-04-26register as supporting modular exponentiationJason Wright
still contains much debugging code and isn't quite done, but its a start