qfall_math/integer_mod_q/z_q/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::Zq;
13use crate::macros::unsafe_passthrough::{unsafe_getter_indirect, unsafe_setter_indirect};
14use flint_sys::{fmpz::fmpz, fmpz_mod::fmpz_mod_ctx};
15
16unsafe_getter_indirect!(Zq, value, get_fmpz, fmpz);
17unsafe_getter_indirect!(Zq, modulus, get_fmpz_mod_ctx, fmpz_mod_ctx);
18
19unsafe_setter_indirect!(Zq, value, set_fmpz, fmpz);
20unsafe_setter_indirect!(Zq, modulus, set_fmpz_mod_ctx, fmpz_mod_ctx);