/// Sets the value of the current plaintext to the polynomial represented by the a given hexadecimal string.
/// </summary>
///
/// <remarks>
/// <para>
/// Sets the value of the current plaintext to the polynomial represented by the a given hexadecimal string.
/// </para>
/// <para>
/// The string description of the polynomial must adhere to the format returned by <see cref="ToString()"/>,
/// which is of the form "7FFx^3 + 1x^1 + 3" and summarized by the following rules:
/// <list type="number">
/// <item><description>Terms are listed in order of strictly decreasing exponent</description></item>
/// <item><description>Coefficient values are non-negative and in hexadecimal format (upper and lower case letters are both supported)</description></item>
/// <item><description>Exponents are positive and in decimal format</description></item>
/// <item><description>Zero coefficient terms (including the constant term) may be (but do not have to be) omitted</description></item>
/// <item><description>Term with the exponent value of one is written as x^1</description></item>
/// <item><description>Term with the exponent value of zero (the constant term) is written as just a hexadecimal number without x or exponent</description></item>
/// <item><description>Terms are separated exactly by <space>+<space></description></item>
/// <item><description>Other than the +, no other terms have whitespace</description></item>
/// </list>
/// </para>
/// </remarks>
/// <param name="hexPoly">The formatted polynomial string specifying the plaintext polynomial</param>
/// <exception cref="ArgumentException">if hexPoly does not adhere to the expected format</exception>
/// <exception cref="ArgumentException">if the coefficients of hexPoly are too wide</exception>
/// <exception cref="ArgumentNullException">if hexPoly is null</exception>
publicvoidSet(stringhexPoly)
{
if(null==hexPoly)
thrownewArgumentNullException(nameof(hexPoly));
NativeMethods.Plaintext_Set(NativePtr,hexPoly);
}
/// <summary>
/// Sets the value of the current plaintext to a given constant polynomial.
/// </summary>
///
/// <remarks>
/// Sets the value of the current plaintext to a given constant polynomial. The coefficient count
/// Returns a human-readable string description of the plaintext polynomial.
/// </summary>
/// <remarks>
/// <para>
/// Returns a human-readable string description of the plaintext polynomial.
/// </para>
/// <para>
/// The returned string is of the form "7FFx^3 + 1x^1 + 3" with a format summarized by the following:
/// <list type="number">
/// <item><description>Terms are listed in order of strictly decreasing exponent</description></item>
/// <item><description>Coefficient values are non-negative and in hexadecimal format (hexadecimal letters are in upper-case)</description></item>
/// <item><description>Exponents are positive and in decimal format</description></item>
/// <item><description>Zero coefficient terms (including the constant term) are omitted unless the polynomial is exactly 0 (see rule 9)</description></item>
/// <item><description>Term with the exponent value of one is written as x^1</description></item>
/// <item><description>Term with the exponent value of zero (the constant term) is written as just a hexadecimal number without x or exponent</description></item>
/// <item><description>Terms are separated exactly by <space>+<space></description></item>
/// <item><description>Other than the +, no other terms have whitespace</description></item>
/// <item><description>If the polynomial is exactly 0, the string "0" is returned</description></item>
/// </list>
/// </para>
/// </remarks>
/// <exception cref="InvalidOperationException">if the plaintext is in NTT transformed form</exception>