ndn-lite icon indicating copy to clipboard operation
ndn-lite copied to clipboard

ndn_gen_encrypted_payload used_size differs from ndn_probe_encrypted_payload_length

Open yoursunny opened this issue 5 years ago • 1 comments

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.

yoursunny avatar Sep 18 '20 15:09 yoursunny

I don't know the detail of this piece @Zhiyi-Zhang . But I suppose ndn_gen_encrypted_payload doesn't calculate used_size correctly.

tianyuan129 avatar Sep 19 '20 01:09 tianyuan129