forge
forge copied to clipboard
Remove redundant MGF1 implementation + allow MGF injection
The PKCS#1 module currently has its own rsa_mgf1 implementation, even so we have a seperate MGF1 module. This patch primarily aims add removing the former.
Being at it and as the OAEP code currently hard codes MGF1 (opposed to RFC 3447 which generally considers different MGFs) I changed the API in such a way, that the MGF can be injected. For backwards compatibility the old call schemes are still supported and lead to on-the-fly creation of MGF1 module instances as needed.
Besides I've added further tests on PKCS#1 module to especially cover the exception branches as well as all possible (legacy) call/argument schemes.