Skip to content

Binary exponentiation#27

Open
umnikos wants to merge 1 commit into
kokke:masterfrom
umnikos:for-pr-again
Open

Binary exponentiation#27
umnikos wants to merge 1 commit into
kokke:masterfrom
umnikos:for-pr-again

Conversation

@umnikos

@umnikos umnikos commented Jul 13, 2021

Copy link
Copy Markdown

Also called "exponentiation by squaring". It uses O(log b) multiplications instead of the O(b) multiplications the previous algorithm needed. With a slight modification you can also make a bignum_binmod() version which takes a modulo of the result in each intermediate step of the exponentiation and is a key operation in RSA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant