Uh oh!
There was an error while loading. Please reload this page.
crypto-mac v0.9 - #217
Merged
Merged
Conversation
tarcieri
commented
Jul 15, 2020
Member
What's the concrete error? Do you have a full example? |
MemberAuthor
I've tried the following code: impl<T,C>NewMacforTwhereT:From<C>,C:BlockCipher + NewBlockCipher,{typeKeySize = C::KeySize;fnnew(key:&Key<Self>) -> Self{C::new(key).into()}fnnew_varkey(key:&[u8]) -> Result<Self,InvalidKeyLength>{C::new_varkey(key).map_err(|_| InvalidKeyLength)?.into()}}And I get this compilation error: Which in hindsight should've been expected. Right now I have no idea how to properly structure code and if it's even possible in principle. |
tarcieri
commented
Jul 15, 2020
Member
@newpavlov aah yeah, that looks similar to what I was running into with |
newpavlov
commented
Jul 15, 2020
MemberAuthor
So what do you think? Should we go ahead with the current code for the time being? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
FromBlockCiphertrait and respectiveNewMacblanket implementationblobbyto v0.3impl_write!macro, since it's useless for generic typesI couldn't make code generic over
From<BlockCipher>trait due to the "unconstrained type parameter" error, so I had to introduce a new non-polymorphic trait instead. Any ideas how this problem can be worked around?