Skip to content Search Apps Documentation Source Content Run Reset Eval Playground File Folder Download Copy Actions State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

Community realm. Read the code first. Community realm, deployed by its author. Read the code before you interact or send coins.

verify.gno

0.44 Kb · 19 lines
 1package poker
 2
 3import (
 4	"crypto/modexp"
 5
 6	"gno.land/p/g1lnkytfqcjwllws63gvf0mv9yt04aswy4y9amhm/poker/cards"
 7)
 8
 9// This file is the only one importing crypto/modexp. For networks without it,
10// replace it with verify_nomodexp.gno.txt (renamed to verify.gno).
11
12const challengesEnabled = true
13
14var primeP = cards.P()
15
16// powModP returns base^exp mod P as 256 bytes.
17func powModP(base, exp []byte) []byte {
18	return modexp.ModExp(base, exp, primeP)
19}