rsa: Fix two errors in the implementation