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

Method MinEncodedSize

src/cryptlib/integer.cpp:1386–1396  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1384}
1385
1386unsigned int Integer::MinEncodedSize(Signedness signedness) const
1387{
1388 unsigned int outputLen = STDMAX(1U, ByteCount());
1389 if (signedness == UNSIGNED)
1390 return outputLen;
1391 if (NotNegative() && (GetByte(outputLen-1) & 0x80))
1392 outputLen++;
1393 if (IsNegative() && *this < -Power2(outputLen*8-1))
1394 outputLen++;
1395 return outputLen;
1396}
1397
1398unsigned int Integer::Encode(byte *output, unsigned int outputLen, Signedness signedness) const
1399{

Callers 1

GetWriteLenMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected