LLZK 3.0.0
An open-source IR for Zero Knowledge (ZK) circuits
Loading...
Searching...
No Matches
OverflowSemantics.h
Go to the documentation of this file.
1//===-- OverflowSemantics.h - Cast overflow helpers -------------*- C++ -*-===//
2//
3// Part of the LLZK Project, under the Apache License v2.0.
4// See LICENSE.txt for license information.
5// Copyright 2026 Project LLZK
6// SPDX-License-Identifier: Apache-2.0
7//
8//===----------------------------------------------------------------------===//
9
10#pragma once
11
13#include "llzk/Util/Field.h"
14
15#include <llvm/ADT/DynamicAPInt.h>
16
17#include <optional>
18
19namespace llzk::cast {
20
23std::optional<llvm::DynamicAPInt> applyIntToFeltOverflow(
24 const llvm::DynamicAPInt &value, const Field &field, OverflowSemantics overflow
25);
26
30std::optional<llvm::DynamicAPInt> applyFeltToIndexOverflow(
31 const llvm::DynamicAPInt &value, unsigned indexBitWidth, OverflowSemantics overflow
32);
33
34} // namespace llzk::cast
Information about the prime finite field used for the interval analysis.
Definition Field.h:36
std::optional< DynamicAPInt > applyIntToFeltOverflow(const DynamicAPInt &value, const Field &field, OverflowSemantics overflow)
std::optional< DynamicAPInt > applyFeltToIndexOverflow(const DynamicAPInt &value, unsigned indexBitWidth, OverflowSemantics overflow)