Skip to content

Commit 9b4b06e

Browse files
authored
Merge pull request #528 from IntersectMBO/lehins/fix-praos-version
Fix praos version
2 parents 0c59f0d + 9dd0219 commit 9b4b06e

File tree

6 files changed

+15
-11
lines changed

6 files changed

+15
-11
lines changed

.github/ISSUE_TEMPLATE/release-packages.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ Once all the pending issues/pull-requests are integrated:
1313
./scripts/add-from-github.sh "https://github.com/intersectmbo/cardano-base" <COMMIT_HASH> \
1414
base-deriving-via \
1515
cardano-binary \
16-
test/cardano-binary-test \
1716
cardano-crypto-class \
1817
cardano-crypto-praos \
1918
cardano-crypto-tests \
@@ -33,6 +32,6 @@ Once all the pending issues/pull-requests are integrated:
3332

3433
### CHaP PRs
3534

36-
To know the exact versions and packages released, check these pull-requests on [CHaP](https://github.com/IntersectMBO/cardano-haskell-packages).
35+
To know the exact versions and packages released, check these pull-requests on [CHaP](https://github.com/IntersectMBO/cardano-haskell-packages).
3736

3837
- [Link](#)

cardano-crypto-praos/CHANGELOG.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
# Changelog for `cardano-crypto-praos`
22

3-
## 2.2.0.1
3+
## 2.2.1.0
44

5-
* Add and expose `outputFromBytes` for both `Praos` and `PraosBatchCompat` modules
5+
* Add `outputFromBytes` to `Cardano.Crypto.VRF.Praos` module
6+
* Expose `outputFromProof` from `Cardano.Crypto.VRF.Praos` module
7+
* Add `outputFromBytes` to `Cardano.Crypto.VRF.PraosBatchCompat` module
8+
* Expose `Proof`, `Output`, `proofFromBytes`, `skFromBytes`, `vkFromBytes` and `outputFromProof` from `Cardano.Crypto.VRF.PraosBatchCompat` module
69

710
## 2.2.0.0
811

cardano-crypto-praos/cardano-crypto-praos.cabal

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
cabal-version: 2.2
22
name: cardano-crypto-praos
3-
version: 2.2.0.0
3+
version: 2.2.1.0
44
synopsis: Crypto primitives from libsodium
55
description: VRF (and KES, tba) primitives from libsodium.
66
license: Apache-2.0

cardano-crypto-praos/src/Cardano/Crypto/VRF/Praos.hs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,9 @@ copyFromByteString ptr bs lenExpected =
239239
<> show lenActual
240240

241241
seedFromBytes :: ByteString -> Seed
242+
seedFromBytes bs
243+
| BS.length bs /= fromIntegral crypto_vrf_seedbytes =
244+
error $ "Expected " ++ show crypto_vrf_seedbytes ++ " bytes"
242245
seedFromBytes bs = unsafePerformIO $ do
243246
seed <- mkSeed
244247
withForeignPtr (unSeed seed) $ \ptr ->

cardano-crypto-praos/src/Cardano/Crypto/VRF/PraosBatchCompat.hs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ module Cardano.Crypto.VRF.PraosBatchCompat (
4040
Seed,
4141
genSeed,
4242
keypairFromSeed,
43-
seedFromBytes,
4443

4544
-- * Conversions
4645
unsafeRawSeed,
@@ -62,8 +61,8 @@ module Cardano.Crypto.VRF.PraosBatchCompat (
6261
SignKeyVRF (..),
6362
VerKeyVRF (..),
6463
CertVRF (..),
65-
Proof (..),
66-
Output (..),
64+
Proof,
65+
Output,
6766
)
6867
where
6968

@@ -256,8 +255,8 @@ copyFromByteString ptr bs lenExpected =
256255

257256
seedFromBytes :: ByteString -> Seed
258257
seedFromBytes bs
259-
| BS.length bs < fromIntegral crypto_vrf_ietfdraft13_seedbytes =
260-
error "Not enough bytes for seed"
258+
| BS.length bs /= fromIntegral crypto_vrf_ietfdraft13_seedbytes =
259+
error $ "Expected " ++ show crypto_vrf_ietfdraft13_seedbytes ++ " bytes"
261260
seedFromBytes bs = unsafePerformIO $ do
262261
seed <- mkSeed
263262
withForeignPtr (unSeed seed) $ \ptr ->

cardano-crypto-tests/cardano-crypto-tests.cabal

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ library
9090
bytestring >=0.10.12.0,
9191
cardano-binary,
9292
cardano-crypto-class ^>=2.2.2,
93-
cardano-crypto-praos,
93+
cardano-crypto-praos >=2.2.1,
9494
cborg,
9595
containers,
9696
contra-tracer ==0.1.0.1,

0 commit comments

Comments
 (0)