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

Method Load

src/cryptlib/nbtheory.cpp:992–1007  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

990}
991
992void ModExpPrecomputation::Load(const Integer &modulus, BufferedTransformation &bt)
993{
994 if (!mr.get() || mr->GetModulus()!=modulus)
995 {
996 mr.reset(new MontgomeryRepresentation(modulus));
997 mg.reset(new MR_MG(*mr));
998 }
999
1000 ep.reset(new ExponentiationPrecomputation<MR_MG>(*mg));
1001 BERSequenceDecoder seq(bt);
1002 ep->storage = (unsigned int)(Integer(seq).ConvertToLong());
1003 ep->exponentBase.BERDecode(seq);
1004 ep->g.resize(ep->storage);
1005 for (unsigned i=0; i<ep->storage; i++)
1006 ep->g[i].BERDecode(seq);
1007}
1008
1009void ModExpPrecomputation::Save(BufferedTransformation &bt) const
1010{

Callers 1

LoadPrecomputationMethod · 0.80

Calls 6

resetMethod · 0.80
ConvertToLongMethod · 0.80
BERDecodeMethod · 0.80
IntegerClass · 0.70
getMethod · 0.45
resizeMethod · 0.45

Tested by

no test coverage detected