mirror of
https://github.com/darkrenaissance/darkfi.git
synced 2026-01-09 06:38:12 -05:00
rangeproof pseudo code
This commit is contained in:
15
doc/rangeproof.pseudo
Normal file
15
doc/rangeproof.pseudo
Normal file
@@ -0,0 +1,15 @@
|
||||
param value
|
||||
|
||||
private value_bits[] = unpack(value)
|
||||
|
||||
digit = 1
|
||||
linear_combo = []
|
||||
for bit in value_bits:
|
||||
enforce (bit) * (1 - bit) == 0
|
||||
|
||||
linear_combo.append((digit bit))
|
||||
|
||||
digit = digit.double()
|
||||
|
||||
enforce (linear_combo) * (~one) == value
|
||||
|
||||
Reference in New Issue
Block a user