Skip to content

Commit

Permalink
fix non-randomized FROST for Go
Browse files Browse the repository at this point in the history
  • Loading branch information
pacu committed Jul 2, 2024
1 parent 86f3606 commit e9128d2
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 263 deletions.
2 changes: 1 addition & 1 deletion frost-uniffi-sdk/src/participant.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use uniffi;
use crate::{FrostKeyPackage, ParticipantIdentifier};

#[cfg(not(feature = "redpallas"))]
use crate::{coordinator::FrostSigningPackage, FrostKeyPackage};
use crate::coordinator::FrostSigningPackage;

#[derive(uniffi::Record, Clone)]
pub struct FrostSigningNonces {
Expand Down
47 changes: 0 additions & 47 deletions frost_go_ffi/frost_go_ffi.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,21 +88,10 @@ void uniffi_frost_uniffi_sdk_fn_free_dkground2secretpackage(
RustCallStatus* out_status
);

void uniffi_frost_uniffi_sdk_fn_free_frostrandomizedparams(
void* ptr,
RustCallStatus* out_status
);

RustBuffer uniffi_frost_uniffi_sdk_fn_func_aggregate(
RustBuffer signing_package,
RustBuffer signature_shares,
RustBuffer pubkey_package,
RustBuffer randomizer,
RustCallStatus* out_status
);

RustBuffer uniffi_frost_uniffi_sdk_fn_func_from_hex_string(
RustBuffer hex_string,
RustCallStatus* out_status
);

Expand Down Expand Up @@ -152,22 +141,10 @@ RustBuffer uniffi_frost_uniffi_sdk_fn_func_part_3(
RustCallStatus* out_status
);

void* uniffi_frost_uniffi_sdk_fn_func_randomized_params_from_public_key_and_signing_package(
RustBuffer public_key,
RustBuffer signing_package,
RustCallStatus* out_status
);

RustBuffer uniffi_frost_uniffi_sdk_fn_func_randomizer_from_params(
void* randomized_params,
RustCallStatus* out_status
);

RustBuffer uniffi_frost_uniffi_sdk_fn_func_sign(
RustBuffer signing_package,
RustBuffer nonces,
RustBuffer key_package,
RustBuffer randomizer,
RustCallStatus* out_status
);

Expand All @@ -192,14 +169,6 @@ RustBuffer uniffi_frost_uniffi_sdk_fn_func_verify_and_get_key_package_from(
RustCallStatus* out_status
);

void uniffi_frost_uniffi_sdk_fn_func_verify_randomized_signature(
RustBuffer randomizer,
RustBuffer message,
RustBuffer signature,
RustBuffer pubkey,
RustCallStatus* out_status
);

void uniffi_frost_uniffi_sdk_fn_func_verify_signature(
RustBuffer message,
RustBuffer signature,
Expand Down Expand Up @@ -510,10 +479,6 @@ uint16_t uniffi_frost_uniffi_sdk_checksum_func_aggregate(
RustCallStatus* out_status
);

uint16_t uniffi_frost_uniffi_sdk_checksum_func_from_hex_string(
RustCallStatus* out_status
);

uint16_t uniffi_frost_uniffi_sdk_checksum_func_generate_nonces_and_commitments(
RustCallStatus* out_status
);
Expand Down Expand Up @@ -546,14 +511,6 @@ uint16_t uniffi_frost_uniffi_sdk_checksum_func_part_3(
RustCallStatus* out_status
);

uint16_t uniffi_frost_uniffi_sdk_checksum_func_randomized_params_from_public_key_and_signing_package(
RustCallStatus* out_status
);

uint16_t uniffi_frost_uniffi_sdk_checksum_func_randomizer_from_params(
RustCallStatus* out_status
);

uint16_t uniffi_frost_uniffi_sdk_checksum_func_sign(
RustCallStatus* out_status
);
Expand All @@ -574,10 +531,6 @@ uint16_t uniffi_frost_uniffi_sdk_checksum_func_verify_and_get_key_package_from(
RustCallStatus* out_status
);

uint16_t uniffi_frost_uniffi_sdk_checksum_func_verify_randomized_signature(
RustCallStatus* out_status
);

uint16_t uniffi_frost_uniffi_sdk_checksum_func_verify_signature(
RustCallStatus* out_status
);
Expand Down
4 changes: 3 additions & 1 deletion frost_go_ffi/frost_go_ffi_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,10 @@ func TestTrustedDealerFromConfigWithSecret(t *testing.T) {
var commitments []FrostSigningCommitments

for participant, secretShare := range shares {
keyPackage, err := VerifyAndGetKeyPackageFrom(secretShare)
// generates a nonce and a commitment to be used (round 1)
firstRoundCommitment, err := GenerateNoncesAndCommitments(secretShare)
firstRoundCommitment, err := GenerateNoncesAndCommitments(keyPackage)

if err != nil {
t.Fatalf("Failed to generate nonces and commitments: %v", err)
}
Expand Down
Loading

0 comments on commit e9128d2

Please sign in to comment.