qfall_math/integer_mod_q/mat_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::MatPolynomialRingZq;
13use crate::macros::unsafe_passthrough::{unsafe_getter_indirect, unsafe_setter_indirect};
14use flint_sys::{fmpz_poly_mat::fmpz_poly_mat_struct, fq::fq_ctx_struct};
15
16unsafe_getter_indirect!(
17    MatPolynomialRingZq,
18    matrix,
19    get_fmpz_poly_mat_struct,
20    fmpz_poly_mat_struct
21);
22unsafe_getter_indirect!(
23    MatPolynomialRingZq,
24    modulus,
25    get_fq_ctx_struct,
26    fq_ctx_struct
27);
28
29unsafe_setter_indirect!(
30    MatPolynomialRingZq,
31    matrix,
32    set_fmpz_poly_mat_struct,
33    fmpz_poly_mat_struct
34);
35unsafe_setter_indirect!(
36    MatPolynomialRingZq,
37    modulus,
38    set_fq_ctx_struct,
39    fq_ctx_struct
40);