Skip to content

Commit

Permalink
fix: Acir gen doesn't panic on unsupported BB function (#3866)
Browse files Browse the repository at this point in the history
# Description

## Problem\*

Resolves #3865

## Summary\*



## Additional Context



## Documentation\*

Check one:
- [ ] No documentation needed.
- [ ] Documentation included in this PR.
- [ ] **[Exceptional Case]** Documentation to be submitted in a separate
PR.

# PR Checklist\*

- [x] I have tested the changes locally.
- [x] I have formatted the changes with [Prettier](https://prettier.io/)
and/or `cargo fmt` on default settings.
  • Loading branch information
sirasistant authored Dec 19, 2023
1 parent 698d5fd commit 34fd978
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions compiler/noirc_evaluator/src/ssa/acir_gen/acir_ir/acir_variable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1605,28 +1605,40 @@ fn execute_brillig(
_signature: &[u8],
_message: &[u8],
) -> Result<bool, BlackBoxResolutionError> {
unimplemented!("SchnorrVerify is not supported")
Err(BlackBoxResolutionError::Failed(
BlackBoxFunc::SchnorrVerify,
"SchnorrVerify is not supported".to_string(),
))
}
fn pedersen_commitment(
&self,
_inputs: &[FieldElement],
_domain_separator: u32,
) -> Result<(FieldElement, FieldElement), BlackBoxResolutionError> {
unimplemented!("PedersenCommitment is not supported")
Err(BlackBoxResolutionError::Failed(
BlackBoxFunc::PedersenCommitment,
"PedersenCommitment is not supported".to_string(),
))
}
fn pedersen_hash(
&self,
_inputs: &[FieldElement],
_domain_separator: u32,
) -> Result<FieldElement, BlackBoxResolutionError> {
unimplemented!("PedersenHash is not supported")
Err(BlackBoxResolutionError::Failed(
BlackBoxFunc::PedersenHash,
"PedersenHash is not supported".to_string(),
))
}
fn fixed_base_scalar_mul(
&self,
_low: &FieldElement,
_high: &FieldElement,
) -> Result<(FieldElement, FieldElement), BlackBoxResolutionError> {
unimplemented!("FixedBaseScalarMul is not supported")
Err(BlackBoxResolutionError::Failed(
BlackBoxFunc::FixedBaseScalarMul,
"FixedBaseScalarMul is not supported".to_string(),
))
}
}

Expand Down

0 comments on commit 34fd978

Please sign in to comment.