hs-v3: Simplify decrypt_desc_layer interface
Here is how decrypt_desc_layer
is called:
superencrypted_len = decrypt_desc_layer(desc,
desc->plaintext_data.superencrypted_blob,
desc->plaintext_data.superencrypted_blob_size,
NULL, 1, &superencrypted_plaintext);
encrypted_len = decrypt_desc_layer(desc,
desc->superencrypted_data.encrypted_blob,
desc->superencrypted_data.encrypted_blob_size,
descriptor_cookie, 0, &encrypted_plaintext);
There is no point in passing desc->superencrypted_data.encrypted_blob
and desc->superencrypted_data.encrypted_blob_size
since we are already passing the whole desc
and is_superencrypted_layer
which should be enough to figure out which fields to use.
We could either of the following two things:
- Ditch
desc
as an argument and passdesc->plaintext_data.blinded_pubkey
explicitly. - Ditch
encrypted_blob
andencrypted_blob_size
as arguments and get them off desc.
I prefer the first, but I'm fine with either, since it will make the interface cleaner.