ExpModL function

Warning

This documentation refers to the Classic QDK, which has been replaced by the Modern QDK.

Please see https://aka.ms/qdk.api for the API documentation for the Modern QDK.

Namespace: Microsoft.Quantum.Math

Package: Microsoft.Quantum.Standard

Returns an integer raised to a given power, with respect to a given modulus.

function ExpModL (expBase : BigInt, power : BigInt, modulus : BigInt) : BigInt

Description

Let us denote expBase by $x$, power by $p$ and modulus by $N$. The function returns $x^p \operatorname{mod} N$.

We assume that $N$, $x$ are positive and power is non-negative.

Input

expBase : BigInt

power : BigInt

modulus : BigInt

Output : BigInt

Remarks

Takes time proportional to the number of bits in power, not the power itself.