MCPcopy Create free account
hub / github.com/Tripwire/tripwire-open-source / Gcd

Method Gcd

src/cryptlib/algebra.h:271–283  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

269}
270
271template <class T> T AbstractEuclideanDomain<T>::Gcd(const Element &a, const Element &b) const
272{
273 Element g[3]={b, a};
274 unsigned int i0=0, i1=1, i2=2;
275
276 while (!this->Equal(g[i1], this->Zero()))
277 {
278 g[i2] = Mod(g[i0], g[i1]);
279 unsigned int t = i0; i0 = i1; i1 = i2; i2 = t;
280 }
281
282 return g[i0];
283}
284
285template <class T> typename QuotientRing<T>::Element QuotientRing<T>::MultiplicativeInverse(const typename T::Element &a) const
286{

Callers 1

IsUnitMethod · 0.45

Calls 2

EqualMethod · 0.45
ZeroMethod · 0.45

Tested by

no test coverage detected