Modular C
C◼F257◼Z—251: symbols inserted from C◼snippet◼modulo.
+ Collaboration diagram for C◼F257◼Z—251: symbols inserted from C◼snippet◼modulo.:
typedef _Intern◼_I584Rsma◼C◼F257◼Z—251◼type₀ C◼F257◼𝔽—251
 
C◼F257◼𝔽—251 C◼F257◼generator—251 = C◼snippet◼modulo◼generator_default
 A generator of the multiplicative group. More...
 
C◼F257◼𝔽—251 C◼F257◼𝔽—251◼_Operator—bnotbnot (C◼F257◼𝔽—251 a)
 Map a into ℤn. More...
 
C◼F257◼𝔽—251 C◼F257◼𝔽—251◼_Operator—add (C◼F257◼𝔽—251 a, C◼F257◼𝔽—251 b)
 Operation in the ring ℤn. More...
 
C◼F257◼𝔽—251 C◼F257◼𝔽—251◼_Operator—sub (C◼F257◼𝔽—251 a, C◼F257◼𝔽—251 b)
 Operation in the ring ℤn. More...
 
C◼F257◼𝔽—251 C◼F257◼𝔽—251◼_Operator—prod (C◼F257◼𝔽—251 a, C◼F257◼𝔽—251 b)
 Operation in the ring ℤn. More...
 
C◼F257◼𝔽—251 C◼F257◼𝔽—251◼_Operator—div (C◼F257◼𝔽—251 a, C◼F257◼𝔽—251 b)
 Operation in the ring ℤn. More...
 
C◼F257◼𝔽—251 C◼F257◼𝔽—251◼_Operator—mod (C◼F257◼𝔽—251 a, C◼F257◼𝔽—251 b)
 Operation in the ring ℤn. More...
 
_Bool C◼F257◼𝔽—251◼_Operator—eq (C◼F257◼𝔽—251 a, C◼F257◼𝔽—251 b)
 Equality in the ring ℤn. More...
 
C◼F257◼𝔽—251 C◼F257◼𝔽—251◼_Operator—notnot (C◼F257◼𝔽—251 a)
 Test if non-zero in ℤn. More...
 
C◼F257◼𝔽—251 C◼F257◼order—251 (C◼F257◼𝔽—251 x)
 Compute the order of element . More...
 

Detailed Description

See also
C◼snippet◼modulo snippet: identifiers inserted directly to an importer for details
This import uses the following slot(s)
slotreplacement
C◼snippet◼modulo◼modC◼F257◼MOD—251
C◼snippet◼modulo◼contextC◼F257◼𝔽—251
C◼snippet◼modulo◼typeC◼F257◼𝔽—251
C◼snippet◼modulo◼orderC◼F257◼order—251
C◼snippet◼modulo◼generatorC◼F257◼generator—251
C◼snippet◼modulo◼generator_defaultuses default

Typedef Documentation

§ C◼F257◼𝔽—251

typedef _Intern◼_I584Rsma◼C◼F257◼Z—251◼type₀ C◼F257◼𝔽—251

Definition at line 1680 of file C-F257.c.

Function Documentation

§ C◼F257◼order—251()

C◼F257◼𝔽—251 C◼F257◼order—251 ( C◼F257◼𝔽—251  x)

Compute the order of element .

The order is the smallest number r such that $x^{r} \mod n$.

Definition at line 1759 of file C-F257.c.

References C◼F257◼𝔽—251◼_Operator—add(), C◼F257◼𝔽—251◼_Operator—eq(), C◼F257◼𝔽—251◼_Operator—notnot(), and C◼F257◼𝔽—251◼_Operator—prod().

1759  {
1760 #line 147 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
1761  if (¬(C◼F257◼𝔽—251◼_Operator—notnot(x ))) return 0;
1762  C◼F257◼𝔽—251 y = x;
1763  for (C◼F257◼𝔽—251 i = 1; i; ((i )=(C◼F257◼𝔽—251◼_Operator—add(i , 1)))) {
1764 #line 150 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
1765  if (C◼F257◼𝔽—251◼_Operator—eq(y , 1 )) return i;
1767  }
1768  // should not be reached
1769  return 0;
1770 }
C◼F257◼𝔽—251 C◼F257◼𝔽—251◼_Operator—add(C◼F257◼𝔽—251 a, C◼F257◼𝔽—251 b)
Operation in the ring ℤn.
Definition: C-F257.c:1709
C◼F257◼𝔽—251 C◼F257◼𝔽—251◼_Operator—notnot(C◼F257◼𝔽—251 a)
Test if non-zero in ℤn.
Definition: C-F257.c:1743
C◼F257◼𝔽—251 C◼F257◼𝔽—251◼_Operator—prod(C◼F257◼𝔽—251 a, C◼F257◼𝔽—251 b)
Operation in the ring ℤn.
Definition: C-F257.c:1721
_Intern◼_I584Rsma◼C◼F257◼Z—251◼type₀ C◼F257◼𝔽—251
Definition: C-F257.c:1680
_Bool C◼F257◼𝔽—251◼_Operator—eq(C◼F257◼𝔽—251 a, C◼F257◼𝔽—251 b)
Equality in the ring ℤn.
Definition: C-F257.c:1738
+ Here is the call graph for this function:

§ C◼F257◼𝔽—251◼_Operator—add()

C◼F257◼𝔽—251 C◼F257◼𝔽—251◼_Operator—add ( C◼F257◼𝔽—251  a,
C◼F257◼𝔽—251  b 
)
inline

Operation in the ring ℤn.

Definition at line 1709 of file C-F257.c.

References C◼F257◼𝔽—251◼_Operator—bnotbnot().

Referenced by C◼F257◼order—251().

1709  {
1710 #line 107 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
1711  C◼F257◼𝔽—251 ret = a + b;
1713 }
C◼F257◼𝔽—251 C◼F257◼𝔽—251◼_Operator—bnotbnot(C◼F257◼𝔽—251 a)
Map a into ℤn.
Definition: C-F257.c:1704
_Intern◼_I584Rsma◼C◼F257◼Z—251◼type₀ C◼F257◼𝔽—251
Definition: C-F257.c:1680
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ C◼F257◼𝔽—251◼_Operator—bnotbnot()

C◼F257◼𝔽—251 C◼F257◼𝔽—251◼_Operator—bnotbnot ( C◼F257◼𝔽—251  a)
inline

Map a into ℤn.

Definition at line 1704 of file C-F257.c.

Referenced by C◼F257◼𝔽—251◼_Operator—add(), C◼F257◼𝔽—251◼_Operator—eq(), and C◼F257◼𝔽—251◼_Operator—prod().

1704  {
1705 #line 103 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
1706  return a % _Intern◼_I584Rsma◼C◼F257◼Z—251◼mod₀;
1707 }
+ Here is the caller graph for this function:

§ C◼F257◼𝔽—251◼_Operator—div()

C◼F257◼𝔽—251 C◼F257◼𝔽—251◼_Operator—div ( C◼F257◼𝔽—251  a,
C◼F257◼𝔽—251  b 
)
inline

Operation in the ring ℤn.

Definition at line 1727 of file C-F257.c.

Referenced by C◼F257◼𝔽—251◼_Operator—mod().

1727  {
1728 #line 122 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
1729  C◼F257◼𝔽—251 ret = a * _Intern◼_I584Rsma◼C◼F257◼Z—251◼inverse(b);
1731 }
C◼F257◼𝔽—251 C◼F257◼𝔽—251◼_Operator—bnotbnot(C◼F257◼𝔽—251 a)
Map a into ℤn.
Definition: C-F257.c:1704
_Intern◼_I584Rsma◼C◼F257◼Z—251◼type₀ C◼F257◼𝔽—251
Definition: C-F257.c:1680
+ Here is the caller graph for this function:

§ C◼F257◼𝔽—251◼_Operator—eq()

_Bool C◼F257◼𝔽—251◼_Operator—eq ( C◼F257◼𝔽—251  a,
C◼F257◼𝔽—251  b 
)
inline

Equality in the ring ℤn.

Definition at line 1738 of file C-F257.c.

References C◼F257◼𝔽—251◼_Operator—bnotbnot().

Referenced by C◼F257◼order—251().

1738  {
1739 #line 131 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
1741 }
C◼F257◼𝔽—251 C◼F257◼𝔽—251◼_Operator—bnotbnot(C◼F257◼𝔽—251 a)
Map a into ℤn.
Definition: C-F257.c:1704
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ C◼F257◼𝔽—251◼_Operator—mod()

C◼F257◼𝔽—251 C◼F257◼𝔽—251◼_Operator—mod ( C◼F257◼𝔽—251  a,
C◼F257◼𝔽—251  b 
)
inline

Operation in the ring ℤn.

Definition at line 1733 of file C-F257.c.

References C◼F257◼𝔽—251◼_Operator—div(), C◼F257◼𝔽—251◼_Operator—prod(), and C◼F257◼𝔽—251◼_Operator—sub().

1733  {
1734 #line 127 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
1736 }
C◼F257◼𝔽—251 C◼F257◼𝔽—251◼_Operator—prod(C◼F257◼𝔽—251 a, C◼F257◼𝔽—251 b)
Operation in the ring ℤn.
Definition: C-F257.c:1721
C◼F257◼𝔽—251 C◼F257◼𝔽—251◼_Operator—div(C◼F257◼𝔽—251 a, C◼F257◼𝔽—251 b)
Operation in the ring ℤn.
Definition: C-F257.c:1727
C◼F257◼𝔽—251 C◼F257◼𝔽—251◼_Operator—sub(C◼F257◼𝔽—251 a, C◼F257◼𝔽—251 b)
Operation in the ring ℤn.
Definition: C-F257.c:1715
+ Here is the call graph for this function:

§ C◼F257◼𝔽—251◼_Operator—notnot()

C◼F257◼𝔽—251 C◼F257◼𝔽—251◼_Operator—notnot ( C◼F257◼𝔽—251  a)
inline

Test if non-zero in ℤn.

Definition at line 1743 of file C-F257.c.

Referenced by C◼F257◼order—251().

1743  {
1744 #line 135 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
1745  return ‼C◼F257◼𝔽—251◼_Operator—bnotbnot(a);
1746 }
+ Here is the caller graph for this function:

§ C◼F257◼𝔽—251◼_Operator—prod()

C◼F257◼𝔽—251 C◼F257◼𝔽—251◼_Operator—prod ( C◼F257◼𝔽—251  a,
C◼F257◼𝔽—251  b 
)
inline

Operation in the ring ℤn.

Definition at line 1721 of file C-F257.c.

References C◼F257◼𝔽—251◼_Operator—bnotbnot().

Referenced by C◼F257◼order—251(), and C◼F257◼𝔽—251◼_Operator—mod().

1721  {
1722 #line 117 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
1723  C◼F257◼𝔽—251 ret = a * b;
1725 }
C◼F257◼𝔽—251 C◼F257◼𝔽—251◼_Operator—bnotbnot(C◼F257◼𝔽—251 a)
Map a into ℤn.
Definition: C-F257.c:1704
_Intern◼_I584Rsma◼C◼F257◼Z—251◼type₀ C◼F257◼𝔽—251
Definition: C-F257.c:1680
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ C◼F257◼𝔽—251◼_Operator—sub()

C◼F257◼𝔽—251 C◼F257◼𝔽—251◼_Operator—sub ( C◼F257◼𝔽—251  a,
C◼F257◼𝔽—251  b 
)
inline

Operation in the ring ℤn.

Definition at line 1715 of file C-F257.c.

Referenced by C◼F257◼𝔽—251◼_Operator—mod().

1715  {
1716 #line 112 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
1717  C◼F257◼𝔽—251 ret = a + (_Intern◼_I584Rsma◼C◼F257◼Z—251◼mod₀ - b);
1719 }
C◼F257◼𝔽—251 C◼F257◼𝔽—251◼_Operator—bnotbnot(C◼F257◼𝔽—251 a)
Map a into ℤn.
Definition: C-F257.c:1704
_Intern◼_I584Rsma◼C◼F257◼Z—251◼type₀ C◼F257◼𝔽—251
Definition: C-F257.c:1680
+ Here is the caller graph for this function:

Variable Documentation

§ C◼F257◼generator—251

A generator of the multiplicative group.

Remarks
This will only be computed automatically at program startup, if ◼C◼snippet◼modulo◼max_find is set to a high enough value.

Definition at line 1779 of file C-F257.c.