Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ soroban-sdk = "25.1.0"
wee_alloc = "0.4.5"

[dev-dependencies]
cougr-core = { path = ".", features = ["testutils"] }
soroban-sdk = { version = "25.1.0", features = ["testutils"] }

[[bench]]
Expand Down
2 changes: 0 additions & 2 deletions examples/hidden_hand/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions examples/hidden_hand/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ crate-type = ["cdylib", "rlib"]

[dependencies]
soroban-sdk = "25.1.0"
cougr-core = "1.1.0"
cougr-core = { path = "../../" }

[dev-dependencies]
soroban-sdk = { version = "25.1.0", features = ["testutils"] }
cougr-core = { version = "1.1.0", features = ["testutils"] }
cougr-core = { path = "../../", features = ["testutils"] }

[profile.release]
opt-level = "z"
Expand Down
61 changes: 12 additions & 49 deletions internal/cougr-core-circuits/circom/lib/deck.circom
Original file line number Diff line number Diff line change
Expand Up @@ -68,53 +68,16 @@ template CardRange(maxCard) {
template HandUnique(handSize) {
signal input hand[handSize];

component eq0 = IsEqual();
eq0.in[0] <== hand[0];
eq0.in[1] <== hand[1];
eq0.out === 0;

component eq1 = IsEqual();
eq1.in[0] <== hand[0];
eq1.in[1] <== hand[2];
eq1.out === 0;

component eq2 = IsEqual();
eq2.in[0] <== hand[0];
eq2.in[1] <== hand[3];
eq2.out === 0;

component eq3 = IsEqual();
eq3.in[0] <== hand[0];
eq3.in[1] <== hand[4];
eq3.out === 0;

component eq4 = IsEqual();
eq4.in[0] <== hand[1];
eq4.in[1] <== hand[2];
eq4.out === 0;

component eq5 = IsEqual();
eq5.in[0] <== hand[1];
eq5.in[1] <== hand[3];
eq5.out === 0;

component eq6 = IsEqual();
eq6.in[0] <== hand[1];
eq6.in[1] <== hand[4];
eq6.out === 0;

component eq7 = IsEqual();
eq7.in[0] <== hand[2];
eq7.in[1] <== hand[3];
eq7.out === 0;

component eq8 = IsEqual();
eq8.in[0] <== hand[2];
eq8.in[1] <== hand[4];
eq8.out === 0;

component eq9 = IsEqual();
eq9.in[0] <== hand[3];
eq9.in[1] <== hand[4];
eq9.out === 0;
var pairs = handSize * (handSize - 1) / 2;
component eq[pairs];
var idx = 0;
for (var i = 0; i < handSize; i++) {
for (var j = i + 1; j < handSize; j++) {
eq[idx] = IsEqual();
eq[idx].in[0] <== hand[i];
eq[idx].in[1] <== hand[j];
eq[idx].out === 0;
idx++;
}
}
}
Loading
Loading