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

crates.io release checklist #50

Closed
14 of 18 tasks
Pratyush opened this issue Jan 7, 2020 · 6 comments
Closed
14 of 18 tasks

crates.io release checklist #50

Pratyush opened this issue Jan 7, 2020 · 6 comments
Labels
D-easy Difficulty: easy T-feature Type: new features
Milestone

Comments

@Pratyush
Copy link
Member

Pratyush commented Jan 7, 2020

algebra:

bench-utils:

  • Check whether it can be replaced/integrated with tracing.
  • Move into algebra behind a trace feature?

r1cs-core:

  • Refactor ConstraintSystem, ConstraintVar, LinearCombination, and Variable APIs as per Refactor ConstraintSystem API #34 and Improve Gadget naming and infrastructure. #43
  • Rename ConstraintSystem to R1CS.
  • Prefer ConstraintSystem::enter_ns and ConstraintSystem::leave_ns to ConstraintSystem::ns. Additionally, refactor Namespace struct to be just a guard struct which automatically decrements the scope when dropped.

r1cs-std:

  • Make FieldVar, GroupVar, and other variable structs generic over CS: ConstraintSystem<F> as well. This enables getting rid of cs: CS arguments to various functions like add, mul, etc. In turn, this allows impl Add<Self> for FieldVar<...> impls.
  • impl new impl {Add, Mul}<Self::Constant> for FieldVar<...>, impls with the constants. (This might not be possible due to coherence rules, might have to use enum-based approach)
  • standardize UInt{8, 16, 32, 64}.
  • Make derive macros so that traits like EqGadget, ToBytesGadget are less of a pain to implement.
  • Add support for non-native FpGadgets.

groth16 + gm17:

crypto-primitives:

  • Make gadget APIs consistent with above conventions.
@Pratyush Pratyush added T-feature Type: new features D-easy Difficulty: easy help wanted labels Jan 7, 2020
@Pratyush Pratyush added this to the 1.0 milestone Jan 7, 2020
huitseeker added a commit to huitseeker/zexe that referenced this issue Jan 13, 2020
huitseeker added a commit to huitseeker/zexe that referenced this issue Jan 14, 2020
…ine}Curve traits with One/Zero traits from num_traits.

- contributes to arkworks-rs#50,
- depends on arkworks-rs#53 and builds on it,
- due to coherence & requirements of `num_traits::{Zero, One}` to implement `std::ops::Add<Self, ..>` and (resp.) `std::ops::Mul<Self, ..>`, I've had to replace the afferent `impl<'a, P: ..> (Add|Mul)<&'a Self> for Group(Affine|Projective)<P>` by direct implementations on `Self`,
- I did not have to fight the borrow checker for this conversion => I think this hints arithmetic operations are called in contexts where the operand is owned,
- hence should this end up on a merge track, we may want to open an issue to convert the `impl<'a, P:..> (Neg|Sub|..)<&'a Self> for ..<P>` trait usage to direct `impl<P:..> (Neg|Sub|..)<Self> for ..<P>`
- the `impl AddAssign for GroupAffine<P>` in curves/models/short_weierstrass_jacobian.rs is provided to fit trait bounds, and without any guarantee of suitability for any particular purpose
- and that, even though I don't think it's used.
huitseeker added a commit to huitseeker/zexe that referenced this issue Jan 15, 2020
…ine}Curve traits with One/Zero traits from num_traits.

- contributes to arkworks-rs#50,
- depends on arkworks-rs#53 and builds on it,
- due to coherence & requirements of `num_traits::{Zero, One}` to implement `std::ops::Add<Self, ..>` and (resp.) `std::ops::Mul<Self, ..>`, I've had to replace the afferent `impl<'a, P: ..> (Add|Mul)<&'a Self> for Group(Affine|Projective)<P>` by direct implementations on `Self`,
- I did not have to fight the borrow checker for this conversion => I think this hints arithmetic operations are called in contexts where the operand is owned,
- hence should this end up on a merge track, we may want to open an issue to convert the `impl<'a, P:..> (Neg|Sub|..)<&'a Self> for ..<P>` trait usage to direct `impl<P:..> (Neg|Sub|..)<Self> for ..<P>`
- the `impl AddAssign for GroupAffine<P>` in curves/models/short_weierstrass_jacobian.rs is provided to fit trait bounds, and without any guarantee of suitability for any particular purpose
- and that, even though I don't think it's used.
huitseeker added a commit to huitseeker/zexe that referenced this issue Jan 15, 2020
…ine}Curve traits with One/Zero traits from num_traits.

- contributes to arkworks-rs#50,
- depends on arkworks-rs#53 and builds on it,
- due to coherence & requirements of `num_traits::{Zero, One}` to implement `std::ops::Add<Self, ..>` and (resp.) `std::ops::Mul<Self, ..>`, I've had to replace the afferent `impl<'a, P: ..> (Add|Mul)<&'a Self> for Group(Affine|Projective)<P>` by direct implementations on `Self`,
- I did not have to fight the borrow checker for this conversion => I think this hints arithmetic operations are called in contexts where the operand is owned,
- hence should this end up on a merge track, we may want to open an issue to convert the `impl<'a, P:..> (Neg|Sub|..)<&'a Self> for ..<P>` trait usage to direct `impl<P:..> (Neg|Sub|..)<Self> for ..<P>`
- the `impl AddAssign for GroupAffine<P>` in curves/models/short_weierstrass_jacobian.rs is provided to fit trait bounds, and without any guarantee of suitability for any particular purpose
- and that, even though I don't think it's used.
huitseeker added a commit to huitseeker/zexe that referenced this issue Jan 15, 2020
huitseeker added a commit to huitseeker/zexe that referenced this issue Jan 15, 2020
…ine}Curve traits with One/Zero traits from num_traits.

- contributes to arkworks-rs#50,
- depends on arkworks-rs#53 and builds on it,
- due to coherence & requirements of `num_traits::{Zero, One}` to implement `std::ops::Add<Self, ..>` and (resp.) `std::ops::Mul<Self, ..>`, I've had to replace the afferent `impl<'a, P: ..> (Add|Mul)<&'a Self> for Group(Affine|Projective)<P>` by direct implementations on `Self`,
- I did not have to fight the borrow checker for this conversion => I think this hints arithmetic operations are called in contexts where the operand is owned,
- hence should this end up on a merge track, we may want to open an issue to convert the `impl<'a, P:..> (Neg|Sub|..)<&'a Self> for ..<P>` trait usage to direct `impl<P:..> (Neg|Sub|..)<Self> for ..<P>`
- the `impl AddAssign for GroupAffine<P>` in curves/models/short_weierstrass_jacobian.rs is provided to fit trait bounds, and without any guarantee of suitability for any particular purpose
- and that, even though I don't think it's used.
huitseeker added a commit to huitseeker/zexe that referenced this issue Jan 15, 2020
…ine}Curve traits with One/Zero traits from num_traits.

- contributes to arkworks-rs#50,
- depends on arkworks-rs#53 and builds on it,
- due to coherence & requirements of `num_traits::{Zero, One}` to implement `std::ops::Add<Self, ..>` and (resp.) `std::ops::Mul<Self, ..>`, I've had to replace the afferent `impl<'a, P: ..> (Add|Mul)<&'a Self> for Group(Affine|Projective)<P>` by direct implementations on `Self`,
- I did not have to fight the borrow checker for this conversion => I think this hints arithmetic operations are called in contexts where the operand is owned,
- hence should this end up on a merge track, we may want to open an issue to convert the `impl<'a, P:..> (Neg|Sub|..)<&'a Self> for ..<P>` trait usage to direct `impl<P:..> (Neg|Sub|..)<Self> for ..<P>`
- the `impl AddAssign for GroupAffine<P>` in curves/models/short_weierstrass_jacobian.rs is provided to fit trait bounds, and without any guarantee of suitability for any particular purpose
- and that, even though I don't think it's used.
huitseeker added a commit to huitseeker/zexe that referenced this issue Jan 16, 2020
…ine}Curve traits with One/Zero traits from num_traits.

- contributes to arkworks-rs#50,
- depends on arkworks-rs#53 and builds on it,
- due to coherence & requirements of `num_traits::{Zero, One}` to implement `std::ops::Add<Self, ..>` and (resp.) `std::ops::Mul<Self, ..>`, I've had to replace the afferent `impl<'a, P: ..> (Add|Mul)<&'a Self> for Group(Affine|Projective)<P>` by direct implementations on `Self`,
- I did not have to fight the borrow checker for this conversion => I think this hints arithmetic operations are called in contexts where the operand is owned,
- hence should this end up on a merge track, we may want to open an issue to convert the `impl<'a, P:..> (Neg|Sub|..)<&'a Self> for ..<P>` trait usage to direct `impl<P:..> (Neg|Sub|..)<Self> for ..<P>`
- the `impl AddAssign for GroupAffine<P>` in curves/models/short_weierstrass_jacobian.rs is provided to fit trait bounds, and without any guarantee of suitability for any particular purpose
- and that, even though I don't think it's used.
huitseeker added a commit to huitseeker/zexe that referenced this issue Jan 16, 2020
…ine}Curve traits with One/Zero traits from num_traits.

- contributes to arkworks-rs#50,
- depends on arkworks-rs#53 and builds on it,
- due to coherence & requirements of `num_traits::{Zero, One}` to implement `std::ops::Add<Self, ..>` and (resp.) `std::ops::Mul<Self, ..>`, I've had to replace the afferent `impl<'a, P: ..> (Add|Mul)<&'a Self> for Group(Affine|Projective)<P>` by direct implementations on `Self`,
- I did not have to fight the borrow checker for this conversion => I think this hints arithmetic operations are called in contexts where the operand is owned,
- hence should this end up on a merge track, we may want to open an issue to convert the `impl<'a, P:..> (Neg|Sub|..)<&'a Self> for ..<P>` trait usage to direct `impl<P:..> (Neg|Sub|..)<Self> for ..<P>`
- the `impl AddAssign for GroupAffine<P>` in curves/models/short_weierstrass_jacobian.rs is provided to fit trait bounds, and without any guarantee of suitability for any particular purpose
- and that, even though I don't think it's used.
Pratyush pushed a commit that referenced this issue Jan 16, 2020
huitseeker added a commit to huitseeker/zexe that referenced this issue Jan 16, 2020
…ine}Curve traits with One/Zero traits from num_traits.

- contributes to arkworks-rs#50,
- depends on arkworks-rs#53 and builds on it,
- due to coherence & requirements of `num_traits::{Zero, One}` to implement `std::ops::Add<Self, ..>` and (resp.) `std::ops::Mul<Self, ..>`, I've had to replace the afferent `impl<'a, P: ..> (Add|Mul)<&'a Self> for Group(Affine|Projective)<P>` by direct implementations on `Self`,
- I did not have to fight the borrow checker for this conversion => I think this hints arithmetic operations are called in contexts where the operand is owned,
- hence should this end up on a merge track, we may want to open an issue to convert the `impl<'a, P:..> (Neg|Sub|..)<&'a Self> for ..<P>` trait usage to direct `impl<P:..> (Neg|Sub|..)<Self> for ..<P>`
- the `impl AddAssign for GroupAffine<P>` in curves/models/short_weierstrass_jacobian.rs is provided to fit trait bounds, and without any guarantee of suitability for any particular purpose
- and that, even though I don't think it's used.
Pratyush pushed a commit that referenced this issue Jan 17, 2020
…ine}Curve traits with One/Zero traits from num_traits.

- contributes to #50,
- depends on #53 and builds on it,
- due to coherence & requirements of `num_traits::{Zero, One}` to implement `std::ops::Add<Self, ..>` and (resp.) `std::ops::Mul<Self, ..>`, I've had to replace the afferent `impl<'a, P: ..> (Add|Mul)<&'a Self> for Group(Affine|Projective)<P>` by direct implementations on `Self`,
- I did not have to fight the borrow checker for this conversion => I think this hints arithmetic operations are called in contexts where the operand is owned,
- hence should this end up on a merge track, we may want to open an issue to convert the `impl<'a, P:..> (Neg|Sub|..)<&'a Self> for ..<P>` trait usage to direct `impl<P:..> (Neg|Sub|..)<Self> for ..<P>`
- the `impl AddAssign for GroupAffine<P>` in curves/models/short_weierstrass_jacobian.rs is provided to fit trait bounds, and without any guarantee of suitability for any particular purpose
- and that, even though I don't think it's used.
@kobigurk
Copy link
Contributor

We should probably add serialization for proving/verification keys and proofs :)

@Pratyush
Copy link
Member Author

Yes, though that's gated on serialization for field and group elements =)

@burdges
Copy link

burdges commented Jan 22, 2020

About ToBytes and FromBytes without std

There is discussion on making all the std::io traits work without std or even alloc at rust-lang/rust#48331 so if you think crypto crates just need Read and Write like traits then one could pursue that approach.

I think const generics have progressed far enough for this to work on nightly, but when they land nobody knows.

#![feature(const_generics)]

#[cfg(feature = "std")]
use std::io;

pub trait ToFromBytes: Sized {
    const LENGTH : usize;
    fn to_bytes(&self) -> [u8; Self::LENGTH];
    fn from_bytes(bytes: [u8; Self::LENGTH]) -> Self;

    /// Reads `Self` from `reader`.
    #[cfg(feature = "std")]
    fn read<R: io::Read>(reader: R) -> io::Result<Self> {
        let buf = [0u8; Self::LENGTH];
        reader.read_exact(Self::LENGTH,&mut buf) ?;
        Ok(Self::from_bytes(buf))
    }

    /// Serializes `self` into `writer`.
    #[cfg(feature = "std")]
    fn write<W: io::Write>(&self, writer: W) -> io::Result<()> {
        let buf = self.to_bytes();
        writer.write_all(&buf)
    }
}

Also serde works without std or even alloc it appears: https://serde.rs/no-std.html

@Pratyush
Copy link
Member Author

Pratyush commented Jan 22, 2020

I think a simpler method might be to just add our own Read and Write traits algebra::bytes::Error enum and in algebra::bytes, and use those in no_std mode. In std mode we would just make these be re-exports for the std types.

If in the future std is decomposed into smaller sub-crates, then we can just do re-exports unconditionally.

@burdges
Copy link

burdges commented Jan 22, 2020

Cool. I'd suspect some crate supplying no_std Read and Write traits would appear outside libcore once std::*::Error gets a no_std version outside libcore. I'd think libcore would be cautious about such techniques, both for breakage and because so many error reforms failed. You could plan to be an early adopter of such an effort, even if you need your own Read and Write traits in the short term.

@Pratyush
Copy link
Member Author

Most of the things on this list are done; I'll try to put things online on crates.io soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
D-easy Difficulty: easy T-feature Type: new features
Projects
None yet
Development

No branches or pull requests

3 participants