| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
updated dates on files that have actually changed this year. This makes
the diff across versions readable again.
|
|
|
|
|
| |
expansion. While I would prefer to have the compiler to this, using GCC 4.1.2
it is 4% faster on a Core2 Q6600 with the loops partially unrolled.
|
| |
|
|
|
|
|
|
|
| |
with the last one being both one of the input values and the output carry
register, since almost always they were in fact the same variable.
Also update the x86 and x86-64 modules.
|
|
|
|
| |
writing of it in assembly.
|
|
|
|
|
|
|
| |
for 64-bit to not use 64-bit constants - that way GCC won't complain everwhere.
Plan is for a module to replace all of these with asm (bswap, xchg on x86),
at least for x86-64
|
|
|
|
|
|
|
| |
but might as well keep it up to date. And it's easier to do it once with
a 'perl -pi' command than to update each file over time.
Apologies to anyone looking at diffs.
|
| |
|
|
|
|
|
|
|
|
|
| |
/dev/urandom /dev/random
to
/dev/random /dev/srandom /dev/urandom
because the es_dev module can handle reads from devices that may block
without ever blocking for an unbounded amount of time.
|
| |
|
| |
|
|
|
|
| |
after assignment.
|
|
|
|
|
|
| |
by Joel Low on the mailing list, the STL container types have only a
single version of push_back(), along with variations of insert() for
handling range-based appending.
|
|
|
|
| |
Change all callers in the library and self-test code.
|
|
|
|
|
|
|
|
|
|
|
| |
needing this functionality probably already have a preexisting configuration
system that they would rather use.
Also remove the documentation about this feature, and the example
configuration (which was pretty out of date, anyway).
RFC on this change sent to the mailing list on 11-13-2007, no responses
after 24 hours. It seems quite likely this code is not in use anywhere.
|
|\
| |
| |
| | |
and '9f004fd94273d5449388f933f767d6d5c24068d8'
|
| | |
|
| |
| |
| |
| | |
had no reason/need to be a class method.
|
| |
| |
| |
| | |
the code more readable/explicit either.
|
|/
|
|
|
|
| |
Split up some lines for readability. Benchmarks somewhat slower than the
previous version (34.3 vs 32.0 on my Core2, gcc 4.1.2), will need to
investigate.
|
|
|
|
|
|
|
|
|
| |
using the infrastructure in Pooling_Allocator.
Using malloc directly is slightly faster than using Botan's memory pools
(using the glibc implementation). It may also reduce internal fragmentation,
since the current Pooling_Allocator design is rather suboptimal in that
regard.
|
| |
|
|
|
|
| |
when I was testing on x86 and x86-64 machines.
|
|
|
|
|
|
|
|
|
| |
Where loadstor.h was needed but only implicitly included via bit_ops.h,
include it directly
Add endian reversal functions to bit_ops.h
Remove some unneeded includes in big_ops2.cpp and a few other files.
|
|
|
|
|
| |
occur inside the key schedule instead. This should lead to (slightly) better
scheduling in the compiled code by reducing the length of a critical path.
|
|
|
|
|
|
|
| |
All are now specified through the config. The new default is just /bin,
/sbin, /usr/bin, and /usr/sbin. Formerly /usr/ucb, /usr/etc, and /etc were
also searched. If you want this behavior again you have to explicitly set
the rng/unix_path configuration setting.
|
|\
| |
| |
| | |
and 'dda7bbd71591790326178cc71409a956cf121d6b'
|
| |
| |
| |
| |
| |
| | |
a fast poll request, and not if a slow poll was specifically requested.
So a sequence of slow and then fast polls would trigger a second slow
poll, which was not desired.
|
| |
| |
| |
| | |
Original patch from Yves Jerschow.
|
| |
| |
| |
| | |
decimal-dotted string notation.
|
| | |
|
| | |
|
| | |
|
|/
|
|
|
| |
Library_State::initialize: now the LibraryInitializer is just a simple
wrapper to create/destroy the state with no other operations.
|
|
|
|
|
|
|
|
| |
that called global_state(), which cased an infinite recursion.
Make creating a Library_State a two-phase operation, first an empty constructor
(just sets all pointers to NULL), then an initializer that sets up everything
needed to start up the library.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
LibraryInitializer::initialize(), which will set it for us (or fail by
throwing an exception, which will be propogated to the caller). So any
instances of creating a LibraryInitializer where no option arguments
are passed can be removed; instead that initialization will run when
or if you execute an operation where Botan requires the services
provided in the state. Because no options are passed, the library will
be using the default (debug and not thread safe) mutex type: so
hopefully you'll quickly get an exception when the debug mutex
realizes it is being used in a threaded application, but there is risk
of operations silently failing before that happens.
You can call LibraryInitializer::deinitialize() at the end of your
main function (or whenever you think you won't need Botan anymore), to
free the global state; if not a number of cleanup destructors will not
run (including the final scrub of memory).
You can even shut down Botan speculatively; if it turns out you need
it again, it just means you'll have to take the cost of another
initialization. However in applications that use Botan only in small
bursts, or in rarely taken codepaths, you can remove the state
entirely and suffer zero memory overhead. This probably only makes
sense in memory constrained systems, but it's reasonable to do now.
Speculatively deallocating the state is probably not thread safe
without extra work. One thread calling deinitialize() would invalidate
pointers that would have been visible to other threads. One (untested)
idea: have an atomic integer with the number of current threads using
Botan. If any thread decrements and hits zero, it could deinitialize
Botan safely. This might cause too many repeated startup/shutdowns,
which would depend on the app use pattern.
In addition, since you can't pass arguments to the new Library_State,
you can't specify the use of real mutexes (or anything else): so for
right now, this only works in applications that are fine with the
standard options. I want to find a way to get that working, though,
since it's very inelegant. Currently a Default_Mutex (not at all
thread safe but somewhat error checking) will be used. And self test
will always be run (more on that below).
I wrote a program that just initializes and shuts down in a tight
loop. Running on my Gentoo box (Core2 E6400, gcc 4.1.2):
thread_safe? selftest? time (ms)
------------ --------- ---------
no yes 6.1
no no 3.8
yes yes 6.7
yes no 3.8
If you're actually worried that the library might start up OK but then
start failing basic self tests, what you actually want to do is have a
thread that runs diagnostics on your entire process state (including
calling Botan's self test code) every N seconds.
The question is how to get arguments from the outside world to the
constructor of the Library_State that is created inside of
global_state(): avoiding many self tests to save a bit of time (many
applications won't care about the extra cost but sometimes 2 or 3 ms
is important), and thread safety (beacuse you can't specify to use a
real mutex).
|
|
|
|
| |
SHA-256 (from draft-ietf-pkix-sha2-dsa-ecdsa-01)
|
|
|
|
| |
exception instead of one for a PEM decode error which is not very helpful.
|
|
|
|
| |
is 64 bits.
|
|
|
|
|
|
|
| |
The test vectors were generated by Crypto++ 5.5 on a Linux/x86-64 machine.
Test vectors for CBC-MAC(DES) all pass, for inputs up to 63 bytes. For
CBC-MAC(AES-128), all test vectors with inputs over 10 bytes fail to verify
against what Crypto++ produces. Unknown at this time where the bug lies.
|
|
|
|
| |
from Christophe Meessen on the development list.
|
|
|
|
|
| |
limits the output to just a bit under 2^32 bytes, which is the maximum
you can request anyway.
|
|
|
|
| |
static_cast or reinterpret_cast, as needed.
|
|
|
|
|
| |
just want access to the underlying data representation but don't care if
the return value is NULL terminated or not.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
under the name that the algorithm was originally requested by. This enables
proper caching for algorithm names which deref_alias fails to fully dereference
such as "HMAC(SHA-1)". The previous code had two major problems with names of
that type, firstly that the cache was effectively bypassed due to all prototype
objects in Algorithm_Cache_Impl being indexed by their canonical names rather
than the alias that they were requested under, and that there existed a race
condition where a prototype object might be deleted while in use in multithreaded
code.
The downside of this change is that using multiple names to refer to a single
algorithm causes multiple prototype objects to be created, one for each name
that is in use. However the memory overhead of this should be fairly minimal
and given the severity of the race condition this seems like a worthwhile tradeoff.
A more complete fix would be to fix deref_alias to properly derference all alias
names. That fix would be complimentary with this change in that if deref_alias
handled all names properly there would be a single prototype object and there
would then be no additional memory overhead to the cache.
|
| |
|
|
|
|
| |
of the line rather than the start.
|
|\
| |
| |
| |
| |
| | |
e92fe807f749c526669303bd1530dd76a4d10a86)
to branch 'net.randombit.botan' (head 04a56f961f413296df6637b77ec45aa444513cfc)
|