RustCrypto / traits

Collection of cryptography-related traits
594 stars 194 forks source link

cipher: Suspected typo in decrypt_padded documentation #1586

Closed tannaurus closed 5 months ago

tannaurus commented 5 months ago

BlockCipherDecrypt's decrypt_padded method's documentation reads:

Decrypt input and unpad it in-place. Returns resulting ciphertext slice.

But it is actually returning a slice of plaintext bytes. I suppose it would be fair to say "it's a slice of decrypted bytes that were written into the provided ciphertext buffer" but in it's current state, the documentation feels misleading/inaccurate (depending on how you look at it 😄 )

newpavlov commented 5 months ago

Yes, it should be "resulting plaintext slice".

newpavlov commented 5 months ago

Thank you for reporting this! Unfortunately, the fix will probably land only in the next breaking release (i.e. cipher v0.5), it will be somewhat inconvenient to to a backport for cipher v0.4.

tannaurus commented 5 months ago

No worries! Just confirming this is expected behavior is good enough for us 😃 thanks for the quick reply and fix @newpavlov !