(abstract) new ZKPoK()
Labeled non-interactive zero-knowledge proof of
knowledge in the random oracle model.
- Source:
Methods
completeProof(precomputed, label, instance, witness, hashfunction, randomSource, statDist)
Completes a proof using pre-computed values.
Parameters:
Name | Type | Description |
---|---|---|
precomputed |
Pre-computed values. | |
label |
Label as an array of bytes or byte tree. | |
instance |
Instance. | |
witness |
Witness of instance belonging to the right language. | |
hashfunction |
Hash function used to implement the random oracle. | |
randomSource |
Source of randomness. | |
statDist |
Statistical distance from the uniform distribution assuming a perfect random source. |
- Source:
Returns:
Proof in the form of a byte array.
precompute(randomSource, statDist)
Performs pre-computation.
Parameters:
Name | Type | Description |
---|---|---|
randomSource |
Source of randomness. | |
statDist |
Statistical distance from the uniform distribution assuming a perfect random source. |
- Source:
Returns:
Pre-computed values.
precomputeRequiresInstance()
Indicates if pre-computation requires the
instance. This allows choosing the right pre-computation function.
- Source:
Returns:
True or false depending on if pre-computation requires the
instance or not.
precomputeWithInstance(instance, randomSource, statDist)
Performs pre-computation when the instance is needed.
Parameters:
Name | Type | Description |
---|---|---|
instance |
Instance. | |
randomSource |
Source of randomness. | |
statDist |
Statistical distance from the uniform distribution assuming a perfect random source. |
- Source:
Returns:
Pre-computed values.
prove(label, instance, witness, hashfunction, randomSource, statDist)
Computes a proof.
Parameters:
Name | Type | Description |
---|---|---|
label |
Label as an array of bytes or byte tree. | |
instance |
Instance. | |
witness |
Witness of instance belonging to the right language. | |
hashfunction |
Hash function used to implement the random oracle. | |
randomSource |
Source of randomness. | |
statDist |
Statistical distance from the uniform distribution assuming a perfect random source. |
- Source:
Returns:
Proof in the form of a byte array.
randomnessByteLength(statDist)
Number of bytes or randomness needed to compute a proof.
Parameters:
Name | Type | Description |
---|---|---|
statDist |
Statistical distance from the uniform distribution assuming a perfect random source. |
- Source:
Returns:
Number of bytes needed to compute a proof.
verify(label, instance, hashfunction, proof)
Verifies a proof. This is meant to be used for
debugging, so the granularity in error handling is rudimentary.
Parameters:
Name | Type | Description |
---|---|---|
label |
Label as an array of bytes or byte tree. | |
instance |
Instance. | |
hashfunction |
Hash function used to implement the random oracle. | |
proof |
Candidate proof in the form of a byte array. |
- Source:
Returns:
True or false depending on if the candidate proof is valid
or not.