:py:mod:`ggmpc.eddsa` ===================== .. py:module:: ggmpc.eddsa .. autoapi-nested-parse:: EdDSA threshold signing library. Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: ggmpc.eddsa.Eddsa .. py:class:: Eddsa(curve) Threshold signing over the EdDSA cryptosystem. :param curve: The EdDSA curve to use. :type curve: ggmpc.Curve .. py:method:: secret_generate() Generate a secret that can be used as a contribution in DKG. :return: A secret. :rtype: dict .. py:method:: key_share(i, t, n, sk=None) Generate shares for player at index `i` of key split `(t,n)` ways. :param i: Player index. :type i: int :param t: Signing threshold. :Type t: int :param n: Number of shares. :type n: int :return: 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. :rtype: dict .. py:method:: key_combine(P) Combine data shared during the key generation protocol. :param P: Tuple of shares for every player. Must include player's private p-share and n-shares received from all other players. :type P: tuple :return: 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. :rtype: dict .. py:method:: sign_share(M, S) Create signing shares. :param M: Message to sign. :type M: bytes :param S: Tuple of shares for each signer. Must include player's private p-share and j-shares received from all other signers. :type S: tuple :return: 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. :rtype: dict .. py:method:: sign(M, S) Sign a message. :param M: Message to sign. :type M: bytes :param S: Tuple of shares for each signer. Must include signer's private x-share and r-shares received from other signers. :type S: tuple :return: Signature share to be combined with all other signers' signature shares. :rtype: dict .. py:method:: sign_combine(S) Combine signature shares to produce the final signature. :param S: Tuple of gamma-shares for each signer. :type S: tuple :return: Fully reconstructed signature. :rtype: dict .. py:method:: verify(M, sig) Verify a signature. :param M: Signed message. :type M: bytes :param sig: Signature. :type sig: dict :return: True if signature is valid; False otherwise. :rtype: bool