Esempio n. 1
0
Integer DL_BasePrecomputation_LUC::Exponentiate(const DL_GroupPrecomputation<Element> &group, const Integer &exponent) const
{
	return Lucas(exponent, m_g, static_cast<const DL_GroupPrecomputation_LUC &>(group).GetModulus());
}
Esempio n. 2
0
void DL_GroupParameters_LUC::SimultaneousExponentiate(Element *results, const Element &base, const Integer *exponents, unsigned int exponentsCount) const
{
	for (unsigned int i=0; i<exponentsCount; i++)
		results[i] = Lucas(exponents[i], base, GetModulus());
}
Esempio n. 3
0
ll Lucas(ll N, ll M, ll P)
{
  if(M == 0) return 1;
  return C(N % P, M % P, P) * Lucas(N/P, M/P, P) % P;
}