ndn-lite
ndn-lite copied to clipboard
ndn_gen_encrypted_payload used_size differs from ndn_probe_encrypted_payload_length
In ndn_gen_encrypted_payload, the used_size output parameter is calculated as:
https://github.com/named-data-iot/ndn-lite/blob/d60a114a4c4e8422577ab8ae3817f79eed948254/encode/encrypted-payload.c#L38-L42
However, ndn_probe_encrypted_payload_length calculates its result differently:
https://github.com/named-data-iot/ndn-lite/blob/d60a114a4c4e8422577ab8ae3817f79eed948254/encode/encrypted-payload.c#L28-L30
They differ in + NDN_AES_BLOCK_SIZE on the last line.
Please explain why there's this difference.
I don't know the detail of this piece @Zhiyi-Zhang . But I suppose ndn_gen_encrypted_payload doesn't calculate used_size correctly.