Skip to content

Conversation

@lonerapier
Copy link
Collaborator

@lonerapier lonerapier commented Nov 4, 2025

Changes required for differential testing with MFKDF

  • Remove x coordinate from Share
  • Move to deterministic rng for tests

Copy link

@Autoparallel Autoparallel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems straightforward to me. I'd happily review this further if you submit any more changes :)

Copy link

@Autoparallel Autoparallel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm okay with merging this, but I would make an issue to go back and do the share_x as a genuine type instead of a feature flag.

Let's go ahead and get this in now though, that's a later problem. Low prio.

Comment on lines +232 to +241
#[cfg(feature = "share_x")]
{
values.push(share.clone());
}
#[cfg(not(feature = "share_x"))]
{
values.push(ShareWithX {
x: GF256(i as u8 + 1),
y: share.y.clone(),
});

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't a good way to do this unfortunately.

The reason why is because features in Rust are not ever meant to be mutually exclusive. Someone could enable both features and this won't work.

Instead, I'd just use generics and impl differently for each.

Share<WithOrder> and Share<WithCoordinate> are reasonable names, for example. Then you just have an impl block for each and some impl'd functions can probably be on Share<T> so you don't have to implement everything twice (especially if you had a trait for CoordinateType or something.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

created an issue #15.

Comment on lines +305 to +312
#[cfg(feature = "share_x")]
{
values.push((share.x.clone(), share.clone()));
}
#[cfg(not(feature = "share_x"))]
{
values.push((GF256(i as u8 + 1), share.clone()));
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

@lonerapier
Copy link
Collaborator Author

merging this. will handle share variant properly with #15

@lonerapier lonerapier merged commit 7cdd4b4 into main Nov 9, 2025
9 checks passed
@lonerapier lonerapier deleted the differential-tests branch November 9, 2025 06:16
@github-actions github-actions bot mentioned this pull request Nov 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants