tlsfuzzer/tlslite-ng

duplicated code in Python_RSAKey

Open

#427 opened on Oct 18, 2020

View on GitHub
 (0 comments) (0 reactions) (0 assignees)Python (95 forks)auto 404
good first issuehelp wanted

Repository metrics

Stars
 (269 stars)
PR merge metrics
 (PR metrics pending)

Description

The code in __init__: https://github.com/tlsfuzzer/tlslite-ng/blob/9951ec1c769617247a80aa1cae661ec0edc68823/tlslite/utils/python_rsakey.py#L16-L54 and the code in generate(): https://github.com/tlsfuzzer/tlslite-ng/blob/9951ec1c769617247a80aa1cae661ec0edc68823/tlslite/utils/python_rsakey.py#L110-L135

perform the same operations. generate() could be reduced to calculating just p, q, n, and selecting e, passing them to Python_RSAKey constructor, so that __init__ calculates the d, dP, dQ, and qInv.

Contributor guide