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

Method SetBit

src/cryptlib/integer.cpp:1230–1242  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1228}
1229
1230void Integer::SetBit(unsigned int n, bool value)
1231{
1232 if (value)
1233 {
1234 reg.CleanGrow(RoundupSize(bitsToWords(n+1)));
1235 reg[n/WORD_BITS] |= (word(1) << (n%WORD_BITS));
1236 }
1237 else
1238 {
1239 if (n/WORD_BITS < reg.size)
1240 reg[n/WORD_BITS] &= ~(word(1) << (n%WORD_BITS));
1241 }
1242}
1243
1244byte Integer::GetByte(unsigned int n) const
1245{

Callers 1

Power2Method · 0.80

Calls 3

RoundupSizeFunction · 0.85
bitsToWordsFunction · 0.85
CleanGrowMethod · 0.80

Tested by

no test coverage detected