Skip to content

Support non-cloneable BlockCiphers #47

@Dirbaio

Description

@Dirbaio

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).

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions