Skip to content

Hashing to nonzero scalars #39

@fjarri

Description

@fjarri

At the moment we have two places where things are hashed to a Scalar: hash_to_polynomial_arg() and hash_to_shared_secret(). In PyUmbral the result of both was a non-zero scalar (implemented by taking order - 1 modulus of the digest and adding 1).

For hash_to_shared_secret() we enforce this externally (see KeyFragFactory::new()): we generate inputs until the result is nonzero. For hash_to_polynomial_arg() we do not currently enforce it.

A way to solve this would be to add from_digest() implementation to RustCrypto's NonZeroScalar.

This is also related to #35

@tuxxy , @cygnusv , how important is it?

Metadata

Metadata

Assignees

No one assigned

    Labels

    ABIChanges the format of serialized objectscryptographyNeeds attention of someone who knows what they're doing

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions