-
Notifications
You must be signed in to change notification settings - Fork 545
Open
Description
Similar to #526, I think there are more places where types should use int|Integer or maybe int|IntegerBase in place of only int or Integer.
I think this is the case at least for:
randomandrandom_rangein https://github.com/Legrandin/pycryptodome/blob/master/lib/Crypto/Math/_IntegerBase.pyi__iadd__,__rmul__and__add__in https://github.com/Legrandin/pycryptodome/blob/master/lib/Crypto/PublicKey/_point.pyi; also, thexandyproperties returnIntegerbut are typed as-> inthttps://github.com/Legrandin/pycryptodome/blob/master/lib/Crypto/PublicKey/_point.py#L272.
There are probably other cases where int vs Integer is inconsistent but these are the ones that I ran into.
There also appears to be an issue with the order of operands for scalar multiplication. For variables
h: ECCPoint = ...
x: Integer = ...
x * h # causes mypy to produce: `error: Unsupported operand types for * ("IntegerBase" and "EccPoint")`
h * x # mypy OK
assert x * h == h * x # passesHappy to make a PR for the ones above if that's OK.
Metadata
Metadata
Assignees
Labels
No labels