Open yoursunny opened 4 years ago
In ndn_gen_encrypted_payload, the used_size output parameter is calculated as:
ndn_gen_encrypted_payload
used_size
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:
ndn_probe_encrypted_payload_length
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.
+ NDN_AES_BLOCK_SIZE
I don't know the detail of this piece @Zhiyi-Zhang . But I suppose ndn_gen_encrypted_payload doesn't calculate used_size correctly.
In
ndn_gen_encrypted_payload
, theused_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.