Skip to main content

midnight_circuits/instructions/
native.rs

1// This file is part of MIDNIGHT-ZK.
2// Copyright (C) Midnight Foundation
3// SPDX-License-Identifier: Apache-2.0
4// Licensed under the Apache License, Version 2.0 (the "License");
5// You may not use this file except in compliance with the License.
6// You may obtain a copy of the License at
7// http://www.apache.org/licenses/LICENSE-2.0
8// Unless required by applicable law or agreed to in writing, software
9// distributed under the License is distributed on an "AS IS" BASIS,
10// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11// See the License for the specific language governing permissions and
12// limitations under the License.
13
14//! Native instructions interface.
15
16use super::{DivisionInstructions, RangeCheckInstructions};
17use crate::{
18    instructions::{
19        AssertionInstructions, BinaryInstructions, ComparisonInstructions, ControlFlowInstructions,
20        DecompositionInstructions, EqualityInstructions, FieldInstructions,
21        UnsafeConversionInstructions,
22    },
23    types::{AssignedBit, AssignedByte, AssignedNative},
24    CircuitField,
25};
26
27/// The set of circuit all native instructions.
28pub trait NativeInstructions<F>:
29    FieldInstructions<F, AssignedNative<F>>
30    + BinaryInstructions<F>
31    + AssertionInstructions<F, AssignedBit<F>>
32    + AssertionInstructions<F, AssignedByte<F>>
33    + EqualityInstructions<F, AssignedBit<F>>
34    + ControlFlowInstructions<F, AssignedBit<F>>
35    + DecompositionInstructions<F, AssignedNative<F>>
36    + ComparisonInstructions<F, AssignedNative<F>>
37    + RangeCheckInstructions<F, AssignedNative<F>>
38    + UnsafeConversionInstructions<F, AssignedNative<F>, AssignedByte<F>>
39    + DivisionInstructions<F, AssignedNative<F>>
40where
41    F: CircuitField,
42{
43}