Minor crypto changes

Shorten enctype names.  Define an InvalidChecksum exception class for
checksum mismatch; make it inherit from ValueError since we use that
for malformed inputs.  Check for wrong key type in checksum type
verify methods, but not in checksum methods, so that we can construct
bogus checksums for CVE-2010-4020 tests.  Rewrite tests as
assertion-type tests conditional on __name__ == '__main__' since
they're really convenient for refactoring.