From 08b75363b3af005c0226807c518e0a1c145e0f3e Mon Sep 17 00:00:00 2001 From: Satchmo Date: Tue, 3 Sep 2024 14:21:19 -0400 Subject: [PATCH] update method comments --- primitives/ec/privatekey.go | 15 +++++++-------- primitives/keyshares/keyshares.go | 9 +++------ 2 files changed, 10 insertions(+), 14 deletions(-) diff --git a/primitives/ec/privatekey.go b/primitives/ec/privatekey.go index bf983db..6b61555 100644 --- a/primitives/ec/privatekey.go +++ b/primitives/ec/privatekey.go @@ -230,12 +230,11 @@ func (p *PrivateKey) ToPolynomial(threshold int) (*keyshares.Polynomial, error) * * @param threshold The minimum number of shares required to reconstruct the private key. * @param totalShares The total number of shares to generate. - * @param prime The prime number to be used in Shamir's Secret Sharing Scheme. - * @returns An array of shares. + * @returns A KeyShares object containing the shares, threshold and integrity. * * @example - * const key = NewPrivateKey() - * const shares = key.toKeyShares(2, 5) + * key, _ := NewPrivateKey() + * shares, _ := key.ToKeyShares(2, 5) */ func (p *PrivateKey) ToKeyShares(threshold int, totalShares int) (keyShares *keyshares.KeyShares, error error) { if threshold < 2 { @@ -298,13 +297,13 @@ func PrivateKeyFromKeyShares(keyShares *keyshares.KeyShares) (*PrivateKey, error } /** - * @method toBackupShares + * @method ToBackupShares * * Creates a backup of the private key by splitting it into shares. * * * @param threshold The number of shares which will be required to reconstruct the private key. - * @param totalShares The number of shares to generate for distribution. + * @param shares The total number of shares to generate for distribution. * @returns */ func (p *PrivateKey) ToBackupShares(threshold int, shares int) ([]string, error) { @@ -317,11 +316,11 @@ func (p *PrivateKey) ToBackupShares(threshold int, shares int) ([]string, error) /** * - * @method fromBackupShares + * @method PrivateKeyFromBackupShares * * Creates a private key from backup shares. * - * @param shares + * @param shares in backup format * @returns PrivateKey */ func PrivateKeyFromBackupShares(shares []string) (*PrivateKey, error) { diff --git a/primitives/keyshares/keyshares.go b/primitives/keyshares/keyshares.go index 453fb0b..2b797f9 100644 --- a/primitives/keyshares/keyshares.go +++ b/primitives/keyshares/keyshares.go @@ -65,14 +65,11 @@ func NewKeySharesFromBackupFormat(shares []string) (keyShares *KeyShares, error } /** - * @method toBackupShares + * @method ToBackupFormat * - * Creates a backup of the private key by splitting it into shares. + * Creates a backup of the keyshares * - * - * @param threshold The number of shares which will be required to reconstruct the private key. - * @param totalShares The number of shares to generate for distribution. - * @returns + * @returns shares in backup format */ func (k *KeyShares) ToBackupFormat() ([]string, error) { backupShares := make([]string, 0)