Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add conversion Praos to PraosBatchCompat #344

Merged
merged 10 commits into from Feb 8, 2023

Conversation

iquerejeta
Copy link
Collaborator

@iquerejeta iquerejeta commented Nov 21, 2022

Some of the new BatchCompat VRF types are compatible with the existing Praos types. In this PR we create conversion functions, to allow for a smooth transition between the compatible types.

In particular, we create the following conversion functions:

  • skToBatchCompat :: SignKeyVRF PraosVRF -> SignKeyVRF BC.PraosBatchCompatVRF
  • vkToBatchCompat :: VerKeyVRF PraosVRF -> VerKeyVRF BC.PraosBatchCompatVRF
  • outputToBatchCompat :: OutputVRF PraosVRF -> OutputVRF BC.PraosBatchCompatVRF

We include tests to guarantee the compatibility of these converted types.

This closes #345

@iquerejeta iquerejeta marked this pull request as ready for review November 28, 2022 09:15
cardano-crypto-praos/src/Cardano/Crypto/VRF/Praos.hs Outdated Show resolved Hide resolved
cardano-crypto-tests/src/Test/Crypto/VRF.hs Outdated Show resolved Hide resolved
cardano-crypto-tests/src/Test/Crypto/VRF.hs Outdated Show resolved Hide resolved
cardano-crypto-tests/src/Test/Crypto/VRF.hs Outdated Show resolved Hide resolved
Copy link
Collaborator

@lehins lehins left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. A couple of minor suggestions

cardano-crypto-tests/src/Test/Crypto/VRF.hs Outdated Show resolved Hide resolved
cardano-crypto-praos/src/Cardano/Crypto/VRF/Praos.hs Outdated Show resolved Hide resolved
cardano-crypto-praos/src/Cardano/Crypto/VRF/Praos.hs Outdated Show resolved Hide resolved
cardano-crypto-tests/src/Test/Crypto/VRF.hs Outdated Show resolved Hide resolved
Copy link
Contributor

@tdammers tdammers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fine by me, none of the remarks are blockers.

cardano-crypto-tests/src/Test/Crypto/VRF.hs Outdated Show resolved Hide resolved
cardano-crypto-tests/src/Test/Crypto/VRF.hs Outdated Show resolved Hide resolved
cardano-crypto-tests/src/Test/Crypto/VRF.hs Show resolved Hide resolved
Copy link
Contributor

@tdammers tdammers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, except for those parentheses.

cardano-crypto-tests/src/Test/Crypto/VRF.hs Outdated Show resolved Hide resolved
Copy link
Collaborator

@lehins lehins left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@iquerejeta iquerejeta merged commit b05fbc7 into master Feb 8, 2023
@iquerejeta iquerejeta deleted the iquerejeta/type-conversions branch February 8, 2023 09:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create a conversion function from Praos to PraosBatchCompat types
3 participants