#shuffle #zkp #zero-knowledge #public-key #encryption #game

no-std bin+lib zshuffle

Encrypt and shuffle cards, resulting in a randomly ordered deck

3 releases

0.1.2 Jun 3, 2024
0.1.1 May 27, 2024
0.1.0 Feb 26, 2024

#1730 in Cryptography

Download history 2/week @ 2024-08-29 12/week @ 2024-09-19 11/week @ 2024-09-26 3/week @ 2024-10-03

140 downloads per month
Used in zshuffle-wasm

GPL-3.0-only

3MB
13K SLoC

zshuffle

Encrypt and shuffle cards, resulting in a randomly ordered deck

Contents

  • wasm SDK for JavaScript
  • Generate player accounts (BabyJubjub keypairs) & aggregate their public keys to form a joint key.
  • Initialize the deck according to the number of cards
  • Mask & verify the deck with joint key
  • Shuffle & verify the deck with joint key
  • Reveal & unmask cards

Running the example

This is a simple example implementing the mental poker protocol. It shows how to encrypt and shuffle cards, just run:

 cargo test --release --package zshuffle --lib -- tests::test_poker

License

This project is licensed under GPLv3.

Dependencies

~7–17MB
~213K SLoC