| 990 | } |
| 991 | |
| 992 | void 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 | |
| 1009 | void ModExpPrecomputation::Save(BufferedTransformation &bt) const |
| 1010 | { |
no test coverage detected