As I pondered creating an Alice/Eve Secret Bounty demo described in #7 , the following Nice to Have occurred to me:
Support the Ring of Unsigned Integers Modulo $64k$ in both PyTeal and Zokrates
For example, in the case $k=16$ this amounts to
Support $\mathbb{Z} / 1024$
- PyTeal supports
uint1024 with the following 3 operations:
-
modular_add: add two numbers and in the case of overflow, reduce modulo $2^{1024}$
-
modular_subtract: subtract two numbers and in the case of under, reduce modulo $2^{1024}$ (obtaining a number in the range $[0, 2^{1024})$
-
modular_multiply: multiply two numbers and in the case of overflow, reduce modulo $2^{1024}$
- Create a Zokrates library for type
u<1024> with underlying base type u64[16] with similar properties to the PyTeal type just described
Links
- Integers Modulo $n$
- PyTeal ABI Types
- Zokrates Type Aliases
- PyTeal Arithmetic # 181
- PyTeal Fixed Point # 184
As I pondered creating an Alice/Eve Secret Bounty demo described in #7 , the following Nice to Have occurred to me:
Support the Ring of Unsigned Integers Modulo$64k$ in both PyTeal and Zokrates
For example, in the case$k=16$ this amounts to
Support$\mathbb{Z} / 1024$
uint1024with the following 3 operations:u<1024>with underlying base typeu64[16]with similar properties to the PyTeal type just describedLinks