Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* chore: Clean up test output print and clean up the whitespace in some of the test files. commit-id:1ca6851c * feature: Introduce the LarkyDigitalSignatureAlgorithm (DSA) implementation. commit-id:d5450258 * feature: Implement coerceToInt as per python's `__index__` and `__int__` (deprecated since 3.8) protocol commit-id:9a0135bc * feature: Respect `__getattr__` when looking up a field on `SimpleStruct` and implement the `__bool__()` protocol for truth. This is two features in one. 1. Enhance field lookup to respect `__getattr__` if it exists (which only was respected if you used `getattr()`, not the `.`. When getting a field, check to see if the class implements `__getattr__` and if the field is not found, then invoke the function. 2. `truth()` should implement the same semantics as python's `__bool__()`. `__bool__()` is used to implement truth value testing and the built-in operation `bool()` and it should return `False` or `True`. If the class does not define `__bool__()`, then check to see if the class defines `__len__()` and it returns non-zero integer (or boolean). If a class defines neither `__len__()` nor `__bool__()`, all its instances are considered true. An unrelated bug fix: the reflective property of `__eq__` is `__eq__`, not `__ne__` (this diff is included for ease of merging). commit-id:f5080216 * chore: With the previous diff, we explicitly check for None-ness to respect the `__bool__()` implementation (for truthy-ness). commit-id:6cdc9e01 * Following on the previous diffs, we use the newly introduced `coerceToInt` for the built-in function `int()` as well as introduce `AttributeError`. This allows us to use `hasattr()` on a "class" that implements `__getattr__`, but throws an exception to signal that the attribute does not exist. We follow it up with an implementation of `hasattr()` that DOES respect `AttributeError`. commit-id:1eb18d65 * chore: dutifully replicate expand_subject_public_key_info from `Crypto/PublicKey/__init__.py` We've made some big strides in Larky and now we can use `operator` to mimic the upstream code commit-id:96317127 * chore: Expose the `jacobi_symbol` as a "classmethod" on the `Integer` "class" FWIW, this `Crypto.Numbers.Integer` class will need to be re-written at some point. commit-id:2dc6794d * chore: Fix the prime searching code but use the Java `miller_rabin_test` implementation *instead*. We probably should also implement the `Lucas Lehmer` primality test at some point in Java, but that's not needed as of now. commit-id:6197a548 * chore: Remove comments commit-id:f01dee2e * chore: Uncomment failing test commit-id:b49393e7 * chore: Comment on a particular test that fails 2 times in 100 runs. This in-determinism is due to `Random.new().read...` and can be fixed by going through a loop commit-id:ba145bb6 * fix: Fix `toStarlark()` to always return an *encoded* version instead of `toString()` This was the reason that Josh needed to do all of these string hacks and repacking of OIDs, etc. commit-id:1f830864 * chore: Revert the commits and changes that were introduced due to the ASN1 encoding issues solved in the previous commit. commit-id:48ed7020 * chore: Add failing tests that were ported from pycryptodome regarding implementation of the DSA algorithm commit-id:8fe69ba4 * fix: Make all the tests pass The key issue was just sloppy porting to Larky. Comparisons can be done via the `operator` module. In this commit, is a fix for a *HUGE* issue in `LarkyDigest` that was checking to see if `LarkyDigest` was of instance `Memoable` *INSTEAD* of the underlying `ExtendedDigest` from bouncycastle. This caused a failure where repeated invocations of `hexdigest()` or `digest()` would produce the wrong digest value. The first attempt to fix this was in 020fde2 for reported issue #179. commit-id:8858cdb3 * fix: Do not copy cryptography but use a similar implementation of the ecdsa one instead. commit-id:b89034bc
- Loading branch information