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

Function MultiplyByPower2Mod

src/cryptlib/integer.cpp:1096–1103  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1094// M[N] - modulus
1095
1096void MultiplyByPower2Mod(word *R, const word *A, unsigned int k, const word *M, unsigned int N)
1097{
1098 CopyWords(R, A, N);
1099
1100 while (k--)
1101 if (ShiftWordsLeftByBits(R, N, 1) || Compare(R, M, N)>=0)
1102 Subtract(R, R, M, N);
1103}
1104
1105// ******************************************************************
1106

Callers 1

MultiplicativeInverseMethod · 0.85

Calls 4

CopyWordsFunction · 0.85
ShiftWordsLeftByBitsFunction · 0.85
SubtractFunction · 0.85
CompareFunction · 0.70

Tested by

no test coverage detected