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

Method BERDecode

src/cryptlib/integer.cpp:1438–1455  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1436}
1437
1438void Integer::BERDecode(const byte *input)
1439{
1440 if (*input++ != INTEGER)
1441 BERDecodeError();
1442 int bc;
1443 if (!(*input & 0x80))
1444 bc = *input++;
1445 else
1446 {
1447 int lengthBytes = *input++ & 0x7f;
1448 if (lengthBytes > 2)
1449 BERDecodeError();
1450 bc = *input++;
1451 if (lengthBytes > 1)
1452 bc = (bc << 8) | *input++;
1453 }
1454 Decode(input, bc, SIGNED);
1455}
1456
1457void Integer::BERDecode(BufferedTransformation &bt)
1458{

Callers 5

LoadMethod · 0.80
ElGamalSigPublicKeyMethod · 0.80
ElGamalSigPrivateKeyMethod · 0.80

Calls 2

BERLengthDecodeFunction · 0.85
GetMethod · 0.45

Tested by

no test coverage detected