`cargo test -p ring` will build and run the tests, but apparently without
installing *ring*'s dev-dependencies. Thus, we need to eliminate the
dev-dependencies to make that work.
This allows for performance comparisons between *ring* and other
implementations. I think the benchmark is too noisy. Unfortunately,
|cargo bench| doesn't work well for measuring this because
|cargo bench| insists on doing a huge number of iterations, which means
that each run takes too long in a edit-compile-measure cycle.
The previous interface suffered from multiple problems that made it
annoying to use in contexts that needed to digest data with a digest
function that wasn't known statically at build time. The old interface
was also hard to avoid uses of the heap when digest algorithm agility
is required. It was also annoying that one had to import the |Digest|
trait even in code that only wanted to use a statically-chosen digest
function, because calling a method declared in a trait requires that.
The updates to examples/checkdigest.rs demonstrate the improved
usability.
This change also moves to a new style where it is assumed that users of
*ring* will |use ring::*| and then access submodules using
partially-qualified syntax. For example, instead of naming the digest
context type |DigestContext|, it is named just |Context| with the
expectation that code will refer to it as |digest::Context|. Future
sub-modules will follow this convention so that, for example, the HMAC
context type will be |ring::hmac::Context|.
The new interface also helps establish the convention that algorithms
exposed as |pub static| values of some type, usually a struct type.
This convention help enable the linker to discard the code for unused
algorithms.
The fact that |SignatureDigestAlgorithm| is no longer needed in this
new design is a good indication that we're on a better track.