Skip to content

Commit

Permalink
Merge pull request #38 from privacybydesign/add-method-for-legacy-key…
Browse files Browse the repository at this point in the history
…share-protocol

feat: add method to remove keyshare's P from ProofU for old keyshare protocol
  • Loading branch information
synaptic-cleft authored Dec 12, 2022
2 parents 8e9ce1f + a3226e8 commit 68a0869
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions legacy.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,11 @@ func KeyshareResponseLegacy(secret, commit, challenge *big.Int, key *gabikeys.Pu
SResponse: new(big.Int).Add(commit, new(big.Int).Mul(challenge, secret)),
}
}

func (p *ProofU) RemoveKeyshareP(b *CredentialBuilder) {
if b.keyshareP == nil {
return
}
p.U.Mul(p.U, new(big.Int).ModInverse(b.keyshareP, b.pk.N))
p.U.Mod(p.U, b.pk.N)
}

0 comments on commit 68a0869

Please sign in to comment.