You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently the MACs that use block ciphers (CMAC, PMAC) require the BlockCipher in use to be Clone.
It seems to me that it should be possible to not require Clone. Instead, conditionally implement Clone for the Mac if the BlockCipher is Clone?
This would be a breaking change though. Generic code that needs cloning is now requiring just Mac, and it'll now have to require Mac + Clone
My use case is using a custom block cipher that contains &mut's inside, so it can't be cloned. (I know it's weird, it's a cipher that does very expensive calculations that sometimes can be cached so it has a mutable ref to a cache).
The text was updated successfully, but these errors were encountered:
It might be possible to support a blanket impl of BlockCipher for reference types of BlockCipher, which in theory could eliminate the Clone bound by leveraging immutable borrows.
I wonder if we can add impl<T: BlockCipher> BlockCipher for &T, this could make it possible to instantiate a block mode using block cipher reference (although we would have to slightly change BlockCipher definition to accommodate for that).
Currently the MACs that use block ciphers (
CMAC
,PMAC
) require theBlockCipher
in use to beClone
.It seems to me that it should be possible to not require
Clone
. Instead, conditionally implementClone
for theMac
if theBlockCipher
isClone
?This would be a breaking change though. Generic code that needs cloning is now requiring just
Mac
, and it'll now have to requireMac + Clone
My use case is using a custom block cipher that contains
&mut
's inside, so it can't be cloned. (I know it's weird, it's a cipher that does very expensive calculations that sometimes can be cached so it has a mutable ref to a cache).The text was updated successfully, but these errors were encountered: