qfall_math/integer_mod_q/ntt_polynomial_ring_zq/
get.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//! Implementations to get information about a [`NTTPolynomialRingZq`] matrix.
10
11use crate::integer_mod_q::{ModulusPolynomialRingZq, NTTPolynomialRingZq};
12
13impl NTTPolynomialRingZq {
14    /// Returns the modulus of the polynomial in NTT representation as a [`ModulusPolynomialRingZq`].
15    ///
16    /// # Examples
17    /// ```
18    /// use qfall_math::integer_mod_q::{NTTPolynomialRingZq, ModulusPolynomialRingZq};
19    /// use std::str::FromStr;
20    ///
21    /// let modulus = ModulusPolynomialRingZq::from_str("5  1 0 0 0 1 mod 17").unwrap();
22    /// let matrix = NTTPolynomialRingZq::sample_uniform(&modulus);
23    ///
24    /// let modulus = matrix.get_mod();
25    /// ```
26    pub fn get_mod(&self) -> ModulusPolynomialRingZq {
27        self.modulus.clone()
28    }
29}