Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make Scalar conversions explicit #335

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

maujim
Copy link

@maujim maujim commented Nov 4, 2024

Please go through the following checklist

Rationale for this change

What changes are included in this PR?

Copied from description of #228

  • Remove Into<[u64; 4]>, From<[u64; 4]>, and RefInto<[u64; 4]> bounds.
  • Replace these with the trait methods fn from_limbs(val: [u64; 4]) -> Self and fn to_limbs(&self) -> [u64; 4]

Are these changes tested?

Not yet, thats why its in draft

Copy link

algora-pbc bot commented Nov 4, 2024

💵 To receive payouts, sign up on Algora, link your Github account and connect with Stripe.

@maujim maujim changed the title Scalar conversions Make Scalar conversions explicit Nov 4, 2024
@maujim
Copy link
Author

maujim commented Nov 4, 2024

Ok so I have it mostly working except for this one compilation issue. At the latest commit, I'm getting multiple errors of the following format in owned_column_operation.rs:

error[E0277]: the trait bound `num_bigint::BigInt: base::scalar::scalar::Scalar` is not satisfied
   --> crates/proof-of-sql/src/base/database/owned_column_operation.rs:595:21
    |
593 |                 Ok(Self::Boolean(ge_decimal_columns(
    |                                  ------------------ required by a bound introduced by this call
594 |                     lhs_values,
595 |                     rhs_values,
    |                     ^^^^^^^^^^ the trait `base::scalar::scalar::Scalar` is not implemented for `num_bigint::BigInt`
    |
    = help: the following other types implement trait `base::scalar::scalar::Scalar`:
              MontScalar<ark_bls12_381::FrConfig>
              MontScalar<ark_curve25519::FrConfig>
note: required by a bound in `ge_decimal_columns`
   --> crates/proof-of-sql/src/base/database/column_operation.rs:686:8
    |
679 | pub(super) fn ge_decimal_columns<S, T>(
    |               ------------------ required by a bound in this function
...
686 |     S: Scalar,
    |        ^^^^^^ required by this bound in `ge_decimal_columns`

I'm not sure how to proceed from here. We could try adding a impl Scalar for BigInt block. I gave it a quick spin and the only thing I could not figure out was how to implement Scalar.MAX_SIGNED using BigInt. @JayWhite2357 please let me know if you any suggestions here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant