Commit Graph

18 Commits

Author SHA1 Message Date
Roland C. Dowdeswell
66f4c441e9 Further improvements to lib/krb5/n-fold.c:
o  implement add1() using 32 bit ints, this makes _krb5_n_fold()
	   about 5% faster on an amd64 platform.  64 bit ints yield a
	   further improvement but we would need to test the platform
	   to see if they are natively supported.  This should yield
	   better performance improvements on big endian machines as
	   we have to byte swap on little endian boxen.

	o  fix two cases where a malloc(3)d pointer may be dereferenced
	   before we test that it is not NULL.
2013-02-14 16:46:40 +08:00
Roland C. Dowdeswell
7f5a628dc9 Optimise _krb5_n_fold() a bit.
All in lib/krb5/n-fold.c:

       1.  eliminate malloc/free from rr13() because it is always a
	   buffer of the same size called in a tight loop.

       2.  eliminate memcpy(3) from rr13() by bouncing back and forth
	   between two buffers buf1, buf2 instead of performing the
	   calculation into a tmp buffer and memcpy(3)ing the result
	   back into buf.

       3.  eliminate code cases from rr13() that I can visually determine
	   will never occur but I'm guessing that the compiler can't, i.e.

	       i.   now that we're no longer using malloc(3), rr13()
		    cannot fail, so make it void and avoid the if in
		    the calling routine checking its error code.  In
		    case you ask, yes, this made the tests run a little
		    faster,

	       ii.  rr13() has code for being passed a number of bits
		    not divisble by 8 but _krb5_n_fold() only passes
		    an int * 8.	 So, we eliminate this conditional and
		    the associated code.

       4.  we make rr13() take 2 destination buffers and copy the results
	   into both of them, we use this to eliminate another memcpy(3)
	   from the calling routine.  This appears to make it a bit faster
	   as well.
2012-12-25 13:49:03 +08:00
Love Hornquist Astrand
0879b9831a remove trailing whitespace 2011-05-21 11:57:31 -07:00
Love Hornquist Astrand
687db64c56 Patch from Secure Endpoints/Asanka Herath for windows support 2009-12-21 08:45:28 +01:00
Love Hörnquist Åstrand
942a821fab remove RCSID
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@25171 ec53bebd-3082-4978-b11e-865c3cabbd6b
2009-05-04 06:17:40 +00:00
Love Hörnquist Åstrand
01720d42b1 free on error cid#68
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@24099 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-12-11 04:59:28 +00:00
Love Hörnquist Åstrand
6937d41a02 remove trailing whitespace
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@23815 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-09-13 09:21:03 +00:00
Love Hörnquist Åstrand
e172367898 switch to utf8 encoding of all files
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@23814 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-09-13 08:53:55 +00:00
Love Hörnquist Åstrand
17e0e936a3 Revert "Use size_t where appropriate."
This reverts commit 5169642e08042c50ab86da9376d78bcb5b7cfce1.


git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@22923 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-04-08 14:51:33 +00:00
Love Hörnquist Åstrand
210ad42de3 Use size_t where appropriate.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@22868 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-04-07 18:50:20 +00:00
Love Hörnquist Åstrand
8dc3e8a874 spelling
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@22190 ec53bebd-3082-4978-b11e-865c3cabbd6b
2007-12-06 16:24:22 +00:00
Love Hörnquist Åstrand
9f15cdccf2 Make _krb5_n_fold return a error code. Prompted by patch of Charles Longeau.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@21736 ec53bebd-3082-4978-b11e-865c3cabbd6b
2007-07-31 15:48:37 +00:00
Love Hörnquist Åstrand
91351971f7 add KRB5_LIB_FUNCTION to all exported functions
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@13863 ec53bebd-3082-4978-b11e-865c3cabbd6b
2004-05-25 21:46:46 +00:00
Johan Danielsson
5196926ac0 (rr13): handle zero length bit strings
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@6880 ec53bebd-3082-4978-b11e-865c3cabbd6b
1999-08-27 09:03:41 +00:00
Assar Westerlund
f1d99aa1e9 (add1): joda-fix
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@6297 ec53bebd-3082-4978-b11e-865c3cabbd6b
1999-06-04 19:56:58 +00:00
Johan Danielsson
0eeee9f3fc n_fold -> _krb5_n_fold
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@5776 ec53bebd-3082-4978-b11e-865c3cabbd6b
1999-03-27 16:48:42 +00:00
Johan Danielsson
a4637a1462 add copyright and rcsid
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@5400 ec53bebd-3082-4978-b11e-865c3cabbd6b
1999-02-20 15:57:17 +00:00
Johan Danielsson
aaae186ab9 merge new-crypto branch
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@5332 ec53bebd-3082-4978-b11e-865c3cabbd6b
1999-02-11 21:03:59 +00:00