Pedersen_hash_function 0.1.0

This library computes the pedersen hash of given inputs and modular arithmetic.
Documentation
  • Coverage
  • 66.67%
    2 out of 3 items documented2 out of 2 items with examples
  • Size
  • Source code size: 8.15 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.13 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 10s Average build duration of successful builds.
  • all releases: 10s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Repository
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • BiliqisO

Pedersen's hash function

This project provides a Rust implementation of Pedersen's Hash Function, a cryptographic hash function that maps fixed-size tuples of elements from modular arithmetic into elements of finite cyclic groups. Pedersen's hash function is widely used in zero-knowledge proofs, cryptographic protocols, and blockchain applications due to its properties of hiding inputs while maintaining commitments.

The implementation focuses on efficiency and security, allowing users to easily compute hash values for various inputs while ensuring the integrity and non-repudiation of the hashed data.

Table of Contents

Installation

To use this implementation, add the following dependency to your Cargo.toml

[dependencies] pedersen-hash = "0.1.0" # Replace with the latest version

Usage

TTo include this Pedersen hash function in your Rust project, add the following to your Cargo.toml:

[dependencies]
pedersen-hash = "0.1.0"  # Replace with the latest version

        ```
        use Pedersen_hash_function::pedersen_hash_function;
        let x = 1;
        let y = 2;
        let cyclic_group = 5;
        let pedersen_hash = pedersen_hash_function(x ,y, 0, cyclic_group);

        assert_eq!(pedersen_hash,3);


        ```

## Contributing

1. Fork the repository.

2. Navigate to the project directory:
   ```bash
   cd moon-math
  1. Checkout to this branch:

    git checkout -b pedersens-hash-function
    
  2. Run the following command:

cargo run

License

This project is licensed under the MIT License.