LLZK 3.0.0
An open-source IR for Zero Knowledge (ZK) circuits
Loading...
Searching...
No Matches
Felt.h File Reference
Include dependency graph for Felt.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

 MLIR_DECLARE_CAPI_DIALECT_REGISTRATION (Felt, llzk__felt)
 Get reference to the LLZK felt dialect.
MLIR_CAPI_EXPORTED MlirAttribute llzkFelt_FeltConstAttrGetFromInt64 (MlirContext ctx, int64_t value, MlirType type)
 Creates a llzk::felt::FeltConstAttr from a signed 64-bit integer in the specified field.
MLIR_CAPI_EXPORTED MlirAttribute llzkFelt_FeltConstAttrGetFromInt64InField (MlirContext ctx, int64_t value, MlirStringRef fieldName)
 Creates a llzk::felt::FeltConstAttr from a signed 64-bit integer in the specified field.
MLIR_CAPI_EXPORTED MlirAttribute llzkFelt_FeltConstAttrGetFromInt64Unspecified (MlirContext ctx, int64_t value)
 Creates a llzk::felt::FeltConstAttr from a signed 64-bit integer in an unspecified field.
MLIR_CAPI_EXPORTED MlirAttribute llzkFelt_FeltConstAttrGetFromString (MlirContext ctx, MlirStringRef str, MlirType type)
 Creates a llzk::felt::FeltConstAttr from a base-10 representation of a signed integer in the specified field.
MLIR_CAPI_EXPORTED MlirAttribute llzkFelt_FeltConstAttrGetFromStringInField (MlirContext ctx, MlirStringRef str, MlirStringRef fieldName)
 Creates a llzk::felt::FeltConstAttr from a base-10 representation of a signed integer in the specified field.
MLIR_CAPI_EXPORTED MlirAttribute llzkFelt_FeltConstAttrGetFromStringUnspecified (MlirContext ctx, MlirStringRef str)
 Creates a llzk::felt::FeltConstAttr from a base-10 representation of a signed integer in an unspecified field.
MLIR_CAPI_EXPORTED MlirAttribute llzkFelt_FeltConstAttrGetFromParts (MlirContext ctx, const uint64_t *parts, intptr_t nParts, MlirType type)
 Creates a llzk::felt::FeltConstAttr from 64-bit parts in LSB order.
MLIR_CAPI_EXPORTED MlirAttribute llzkFelt_FeltConstAttrGetFromPartsInField (MlirContext ctx, const uint64_t *parts, intptr_t nParts, MlirStringRef fieldName)
 Creates a llzk::felt::FeltConstAttr from 64-bit parts in LSB order.
MLIR_CAPI_EXPORTED MlirAttribute llzkFelt_FeltConstAttrGetFromPartsUnspecified (MlirContext ctx, const uint64_t *parts, intptr_t nParts)
 Creates a llzk::felt::FeltConstAttr from 64-bit parts in LSB order.
MLIR_CAPI_EXPORTED MlirAttribute llzkFelt_FieldSpecAttrGetFromString (MlirContext ctx, MlirIdentifier fieldName, MlirStringRef primeStr)
 Creates a llzk::felt::FieldSpecAttr from a base-10 representation of the prime.
MLIR_CAPI_EXPORTED MlirAttribute llzkFelt_FieldSpecAttrGetFromParts (MlirContext ctx, MlirIdentifier fieldName, const uint64_t *parts, intptr_t nParts)
 Creates a llzk::felt::FieldSpecAttr from 64-bit parts in LSB order.
MLIR_CAPI_EXPORTED MlirType llzkFelt_FeltTypeGetUnspecified (MlirContext ctx)
 Gets the llzk::felt::FeltType without the field specified.
MLIR_CAPI_EXPORTED MlirType llzkFelt_FeltTypeGetFromRef (MlirContext ctx, MlirStringRef fieldName)
 Gets a llzk::felt::FeltType referring to an already defined field.

Function Documentation

◆ llzkFelt_FeltConstAttrGetFromInt64()

MLIR_CAPI_EXPORTED MlirAttribute llzkFelt_FeltConstAttrGetFromInt64 ( MlirContext ctx,
int64_t value,
MlirType type )

Creates a llzk::felt::FeltConstAttr from a signed 64-bit integer in the specified field.

The provided MlirType must be a llzk::felt::FeltType.

Definition at line 36 of file Felt.cpp.

◆ llzkFelt_FeltConstAttrGetFromInt64InField()

MLIR_CAPI_EXPORTED MlirAttribute llzkFelt_FeltConstAttrGetFromInt64InField ( MlirContext ctx,
int64_t value,
MlirStringRef fieldName )

Creates a llzk::felt::FeltConstAttr from a signed 64-bit integer in the specified field.

An undefined field name emits a diagnostic and returns a null attribute. See llzkFelt_FeltTypeGetFromRef for the requirements on fieldName.

Definition at line 43 of file Felt.cpp.

◆ llzkFelt_FeltConstAttrGetFromInt64Unspecified()

MLIR_CAPI_EXPORTED MlirAttribute llzkFelt_FeltConstAttrGetFromInt64Unspecified ( MlirContext ctx,
int64_t value )

Creates a llzk::felt::FeltConstAttr from a signed 64-bit integer in an unspecified field.

Definition at line 51 of file Felt.cpp.

◆ llzkFelt_FeltConstAttrGetFromParts()

MLIR_CAPI_EXPORTED MlirAttribute llzkFelt_FeltConstAttrGetFromParts ( MlirContext ctx,
const uint64_t * parts,
intptr_t nParts,
MlirType type )

Creates a llzk::felt::FeltConstAttr from 64-bit parts in LSB order.

The most significant bit is treated as the sign bit. The value is 0 when nParts == 0. The constant is created with the specified llzk::felt::FeltType.

Requirements: nParts must be non-negative and parts must be non-null when nParts > 0. The provided MlirType must be a llzk::felt::FeltType.

Definition at line 74 of file Felt.cpp.

◆ llzkFelt_FeltConstAttrGetFromPartsInField()

MLIR_CAPI_EXPORTED MlirAttribute llzkFelt_FeltConstAttrGetFromPartsInField ( MlirContext ctx,
const uint64_t * parts,
intptr_t nParts,
MlirStringRef fieldName )

Creates a llzk::felt::FeltConstAttr from 64-bit parts in LSB order.

The most significant bit is treated as the sign bit. The value is 0 when nParts == 0. The constant is created with the llzk::felt::FeltType for the specified field name. An undefined field name emits a diagnostic and returns a null attribute. See llzkFelt_FeltTypeGetFromRef for the requirements on fieldName.

Requirements: nParts must be non-negative and parts must be non-null when nParts > 0.

Definition at line 84 of file Felt.cpp.

◆ llzkFelt_FeltConstAttrGetFromPartsUnspecified()

MLIR_CAPI_EXPORTED MlirAttribute llzkFelt_FeltConstAttrGetFromPartsUnspecified ( MlirContext ctx,
const uint64_t * parts,
intptr_t nParts )

Creates a llzk::felt::FeltConstAttr from 64-bit parts in LSB order.

The most significant bit is treated as the sign bit. The value is 0 when nParts == 0. The constant is created with the unspecified-field llzk::felt::FeltType.

Requirements: nParts must be non-negative and parts must be non-null when nParts > 0.

Definition at line 94 of file Felt.cpp.

◆ llzkFelt_FeltConstAttrGetFromString()

MLIR_CAPI_EXPORTED MlirAttribute llzkFelt_FeltConstAttrGetFromString ( MlirContext ctx,
MlirStringRef str,
MlirType type )

Creates a llzk::felt::FeltConstAttr from a base-10 representation of a signed integer in the specified field.

Returns a null attribute for malformed decimal input. The provided MlirType must be a llzk::felt::FeltType.

Definition at line 56 of file Felt.cpp.

◆ llzkFelt_FeltConstAttrGetFromStringInField()

MLIR_CAPI_EXPORTED MlirAttribute llzkFelt_FeltConstAttrGetFromStringInField ( MlirContext ctx,
MlirStringRef str,
MlirStringRef fieldName )

Creates a llzk::felt::FeltConstAttr from a base-10 representation of a signed integer in the specified field.

Returns a null attribute for malformed decimal input. An undefined field name emits a diagnostic and returns a null attribute. See llzkFelt_FeltTypeGetFromRef for the requirements on fieldName.

Definition at line 60 of file Felt.cpp.

◆ llzkFelt_FeltConstAttrGetFromStringUnspecified()

MLIR_CAPI_EXPORTED MlirAttribute llzkFelt_FeltConstAttrGetFromStringUnspecified ( MlirContext ctx,
MlirStringRef str )

Creates a llzk::felt::FeltConstAttr from a base-10 representation of a signed integer in an unspecified field.

Returns a null attribute for malformed decimal input.

Definition at line 70 of file Felt.cpp.

◆ llzkFelt_FeltTypeGetFromRef()

MLIR_CAPI_EXPORTED MlirType llzkFelt_FeltTypeGetFromRef ( MlirContext ctx,
MlirStringRef fieldName )

Gets a llzk::felt::FeltType referring to an already defined field.

Requirements: fieldName must exactly match a built-in field name (e.g., "bn254") or a custom field registered with LLZK. Pass the name itself, without quotes or an '@' prefix. The string must contain fieldName.length readable bytes; it need not be null-terminated and is copied into ctx, so its storage need only remain valid for this call.

A fieldName that has not been defined emits a diagnostic and returns a null type. Use llzkFelt_FeltTypeGetUnspecified for an unspecified field, rather than an empty name here.

Definition at line 125 of file Felt.cpp.

◆ llzkFelt_FeltTypeGetUnspecified()

MLIR_CAPI_EXPORTED MlirType llzkFelt_FeltTypeGetUnspecified ( MlirContext ctx)

Gets the llzk::felt::FeltType without the field specified.

Definition at line 121 of file Felt.cpp.

◆ llzkFelt_FieldSpecAttrGetFromParts()

MLIR_CAPI_EXPORTED MlirAttribute llzkFelt_FieldSpecAttrGetFromParts ( MlirContext ctx,
MlirIdentifier fieldName,
const uint64_t * parts,
intptr_t nParts )

Creates a llzk::felt::FieldSpecAttr from 64-bit parts in LSB order.

The most significant bit is treated as the sign bit. The value is 0 when nParts == 0. A modulus below two produces a diagnostic and a null attribute.

Requirements: nParts must be non-negative and parts must be non-null when nParts > 0.

Definition at line 108 of file Felt.cpp.

◆ llzkFelt_FieldSpecAttrGetFromString()

MLIR_CAPI_EXPORTED MlirAttribute llzkFelt_FieldSpecAttrGetFromString ( MlirContext ctx,
MlirIdentifier fieldName,
MlirStringRef primeStr )

Creates a llzk::felt::FieldSpecAttr from a base-10 representation of the prime.

Returns a null attribute for malformed decimal input.

Definition at line 102 of file Felt.cpp.

◆ MLIR_DECLARE_CAPI_DIALECT_REGISTRATION()

MLIR_DECLARE_CAPI_DIALECT_REGISTRATION ( Felt ,
llzk__felt  )

Get reference to the LLZK felt dialect.