CryptoAccumulator (crypto_accumulator v0.1.0)

A cryptographic accumulator implementation based on the RSA accumulator scheme

It allows to add new elements to the accumulator and verify if a given element is part of the accumulator

The size of membership proofs is 800 bytes A unique nonce is generated for each generated proof

Summary

Functions

Add a new element to the accumulator

Export the accumulator's public information

Generate a new secret key

Get a membership proof for a given element

Generate a new accumulator

Verify a membership proof for a given element and its nonce

Functions

Link to this function

add_element(acc, value)

@spec add_element(accumulator :: reference(), value :: binary()) ::
  :ok | {:error, binary()}

Add a new element to the accumulator

@spec export(accumulator :: reference()) :: {:ok, binary()} | {:error, binary()}

Export the accumulator's public information

@spec generate_key() :: {:ok, binary()} | {:error, binary()}

Generate a new secret key

Link to this function

get_membership_proof(acc, value)

@spec get_membership_proof(accumulator :: reference(), value :: binary()) ::
  {:ok, proof :: binary(), nonce :: binary()} | {:error, binary()}

Get a membership proof for a given element

It returns the membership proof and the associated nonce

@spec new(secret_key :: binary()) :: {:ok, reference()} | {:error, binary()}

Generate a new accumulator

Link to this function

verify_membership_proof(acc, proof, nonce)

@spec verify_membership_proof(
  accumulator :: reference(),
  proof :: binary(),
  nonce :: binary()
) ::
  {:ok, boolean()} | {:error, binary()}

Verify a membership proof for a given element and its nonce