Trait halo2_backend::helpers::SerdeCurveAffine

source ·
pub trait SerdeCurveAffine: CurveAffine + SerdeObject {
    // Provided methods
    fn read<R: Read>(reader: &mut R, format: SerdeFormat) -> Result<Self> { ... }
    fn write<W: Write>(&self, writer: &mut W, format: SerdeFormat) -> Result<()> { ... }
    fn byte_length(format: SerdeFormat) -> usize { ... }
}

Provided Methods§

source

fn read<R: Read>(reader: &mut R, format: SerdeFormat) -> Result<Self>

Reads an element from the buffer and parses it according to the format:

  • Processed: Reads a compressed curve element and decompress it
  • RawBytes: Reads an uncompressed curve element with coordinates in Montgomery form. Checks that field elements are less than modulus, and then checks that the point is on the curve.
  • RawBytesUnchecked: Reads an uncompressed curve element with coordinates in Montgomery form; does not perform any checks
source

fn write<W: Write>(&self, writer: &mut W, format: SerdeFormat) -> Result<()>

Writes a curve element according to format:

  • Processed: Writes a compressed curve element
  • Otherwise: Writes an uncompressed curve element with coordinates in Montgomery form
source

fn byte_length(format: SerdeFormat) -> usize

Byte length of an affine curve element according to format.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<C: CurveAffine + SerdeObject> SerdeCurveAffine for C