-
Notifications
You must be signed in to change notification settings - Fork 325
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "fix: Revert "feat: ultra keccak honk verifier" (#8391)"
This reverts commit 3228e75.
- Loading branch information
Showing
20 changed files
with
230 additions
and
216 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { RECURSIVE_PROOF_LENGTH, VERIFICATION_KEY_LENGTH_IN_FIELDS } from '@aztec/circuits.js'; | ||
import { type ProtocolArtifact } from '@aztec/noir-protocol-circuits-types'; | ||
|
||
export type UltraHonkFlavor = 'ultra_honk' | 'ultra_keccak_honk'; | ||
|
||
const UltraKeccakHonkCircuits = ['BlockRootRollupArtifact'] as const; | ||
type UltraKeccakHonkCircuits = (typeof UltraKeccakHonkCircuits)[number]; | ||
type UltraHonkCircuits = Exclude<ProtocolArtifact, UltraKeccakHonkCircuits>; | ||
|
||
export function getUltraHonkFlavorForCircuit(artifact: UltraKeccakHonkCircuits): 'ultra_keccak_honk'; | ||
export function getUltraHonkFlavorForCircuit(artifact: UltraHonkCircuits): 'ultra_honk'; | ||
export function getUltraHonkFlavorForCircuit(artifact: ProtocolArtifact): UltraHonkFlavor; | ||
export function getUltraHonkFlavorForCircuit(artifact: ProtocolArtifact): UltraHonkFlavor { | ||
return isUltraKeccakHonkCircuit(artifact) ? 'ultra_keccak_honk' : 'ultra_honk'; | ||
} | ||
|
||
function isUltraKeccakHonkCircuit(artifact: ProtocolArtifact): artifact is UltraKeccakHonkCircuits { | ||
return UltraKeccakHonkCircuits.includes(artifact as UltraKeccakHonkCircuits); | ||
} | ||
|
||
// TODO (alexg) remove these once UltraKeccakHonk proofs are the same size as regular UltraHonk proofs | ||
// see https://github.com/AztecProtocol/aztec-packages/pull/8243 | ||
export function getExpectedVerificationKeyLength(artifact: ProtocolArtifact): number { | ||
return getUltraHonkFlavorForCircuit(artifact) === 'ultra_keccak_honk' ? 120 : VERIFICATION_KEY_LENGTH_IN_FIELDS; | ||
} | ||
|
||
export function getExpectedProofLength(artifact: UltraKeccakHonkCircuits): 393; | ||
export function getExpectedProofLength(artifact: UltraHonkCircuits): typeof RECURSIVE_PROOF_LENGTH; | ||
export function getExpectedProofLength(artifact: ProtocolArtifact): number; | ||
export function getExpectedProofLength(artifact: ProtocolArtifact): number { | ||
return isUltraKeccakHonkCircuit(artifact) ? 393 : RECURSIVE_PROOF_LENGTH; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.