ggmpc.eddsa

EdDSA threshold signing library.

Module Contents

Classes

Eddsa

Threshold signing over the EdDSA cryptosystem.

class ggmpc.eddsa.Eddsa(curve)

Threshold signing over the EdDSA cryptosystem.

Parameters:

curve (ggmpc.Curve) – The EdDSA curve to use.

secret_generate()

Generate a secret that can be used as a contribution in DKG.

Returns:

A secret.

Return type:

dict

key_share(i, t, n, sk=None)

Generate shares for player at index i of key split (t,n) ways.

Parameters:
  • i (int) – Player index.

  • t – Signing threshold.

  • n (int) – Number of shares.

Type t:

int

Returns:

Dictionary of shares. Share at index i is a private u-share. Other indices are y-shares to be distributed to players at their corresponding index.

Return type:

dict

key_combine(P)

Combine data shared during the key generation protocol.

Parameters:

P (tuple) – Tuple of shares for every player. Must include player’s private p-share and n-shares received from all other players.

Returns:

Dictionary of shares. Share at player’s index is a private p-share. Other indices are j-shares to be used when generating signing shares.

Return type:

dict

sign_share(M, S)

Create signing shares.

Parameters:
  • M (bytes) – Message to sign.

  • S (tuple) – Tuple of shares for each signer. Must include player’s private p-share and j-shares received from all other signers.

Returns:

Dictionary of shares. Share at signer’s index is a private x-share. Other indices are r-shares to be distributed to signers at their corresponding index.

Return type:

dict

sign(M, S)

Sign a message.

Parameters:
  • M (bytes) – Message to sign.

  • S (tuple) – Tuple of shares for each signer. Must include signer’s private x-share and r-shares received from other signers.

Returns:

Signature share to be combined with all other signers’ signature shares.

Return type:

dict

sign_combine(S)

Combine signature shares to produce the final signature.

Parameters:

S (tuple) – Tuple of gamma-shares for each signer.

Returns:

Fully reconstructed signature.

Return type:

dict

verify(M, sig)

Verify a signature.

Parameters:
  • M (bytes) – Signed message.

  • sig (dict) – Signature.

Returns:

True if signature is valid; False otherwise.

Return type:

bool