Add paper-notes backup

This commit is contained in:
2022-06-11 22:07:19 +02:00
parent 17a83ba1f3
commit 7978531260
6 changed files with 239 additions and 8 deletions

View File

@@ -2,6 +2,8 @@ from hashlib import sha256
# Ring Signatures
# bLSAG: Backs Linkable Spontaneous Anonymous Group signatures
# A Rust implementation of this scheme can be found at:
# https://github.com/arnaucube/ring-signatures-rs
def hashToPoint(a):
# TODO use a proper hash-to-point
@@ -54,12 +56,11 @@ class Prover(object):
c = [None] * len(R)
# c_{pi+1}
pi1 = mod(pi + 1, len(R))
c[pi1] = hash(R, m, a * self.g, a * hashToPoint(R[pi]), self.q)
c[pi1] = hash(R, m, a * self.g, hashToPoint(R[pi]) * a, self.q)
key_image = self.w * hashToPoint(self.K)
# do c_{i+1} from i=pi+1 to pi-1:
# for j in range(0, len(R)-1):
for j in range(0, len(R)-1):
i = mod(pi1+j, len(R))
i1 = mod(pi1+j +1, len(R))