qfall_math/integer_mod_q/polynomial_ring_zq/
unsafe_functions.rs

1// Copyright © 2025 Niklas Siemer
2//
3// This file is part of qFALL-math.
4//
5// qFALL-math is free software: you can redistribute it and/or modify it under
6// the terms of the Mozilla Public License Version 2.0 as published by the
7// Mozilla Foundation. See <https://mozilla.org/en-US/MPL/2.0/>.
8
9//! This module contains public functions that enable access to underlying
10//! [FLINT](https://flintlib.org/) structs. Therefore, they require to be unsafe.
11
12use super::PolynomialRingZq;
13use crate::macros::unsafe_passthrough::{unsafe_getter_indirect, unsafe_setter_indirect};
14use flint_sys::{fmpz_poly::fmpz_poly_struct, fq::fq_ctx_struct};
15
16unsafe_getter_indirect!(
17    PolynomialRingZq,
18    poly,
19    get_fmpz_poly_struct,
20    fmpz_poly_struct
21);
22unsafe_getter_indirect!(PolynomialRingZq, modulus, get_fq_ctx_struct, fq_ctx_struct);
23
24unsafe_setter_indirect!(
25    PolynomialRingZq,
26    poly,
27    set_fmpz_poly_struct,
28    fmpz_poly_struct
29);
30unsafe_setter_indirect!(PolynomialRingZq, modulus, set_fq_ctx_struct, fq_ctx_struct);