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

Function RoundupSize

src/cryptlib/integer.cpp:1109–1120  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1107static const unsigned int RoundupSizeTable[] = {2, 2, 2, 4, 4, 8, 8, 8, 8};
1108
1109inline unsigned int RoundupSize(unsigned int n)
1110{
1111 if (n<=8)
1112 return RoundupSizeTable[n];
1113 else if (n<=16)
1114 return 16;
1115 else if (n<=32)
1116 return 32;
1117 else if (n<=64)
1118 return 64;
1119 else return 1U << BitPrecision(n-1);
1120}
1121
1122Integer::Integer()
1123 : reg(2), sign(POSITIVE)

Callers 8

IntegerMethod · 0.85
integer.cppFile · 0.85
SetBitMethod · 0.85
SetByteMethod · 0.85
DecodeMethod · 0.85
PositiveMultiplyFunction · 0.85
PositiveDivideFunction · 0.85
ShortDivideMethod · 0.85

Calls 1

BitPrecisionFunction · 0.85

Tested by

no test coverage detected