Modular C
C◼F257◼Z—163: symbols inserted from C◼snippet◼modulo.
+ Collaboration diagram for C◼F257◼Z—163: symbols inserted from C◼snippet◼modulo.:
typedef _Intern◼_I584Rsma◼C◼F257◼Z—163◼type₀ C◼F257◼𝔽—163
 
C◼F257◼𝔽—163 C◼F257◼generator—163 = C◼snippet◼modulo◼generator_default
 A generator of the multiplicative group. More...
 
C◼F257◼𝔽—163 C◼F257◼𝔽—163◼_Operator—bnotbnot (C◼F257◼𝔽—163 a)
 Map a into ℤn. More...
 
C◼F257◼𝔽—163 C◼F257◼𝔽—163◼_Operator—add (C◼F257◼𝔽—163 a, C◼F257◼𝔽—163 b)
 Operation in the ring ℤn. More...
 
C◼F257◼𝔽—163 C◼F257◼𝔽—163◼_Operator—sub (C◼F257◼𝔽—163 a, C◼F257◼𝔽—163 b)
 Operation in the ring ℤn. More...
 
C◼F257◼𝔽—163 C◼F257◼𝔽—163◼_Operator—prod (C◼F257◼𝔽—163 a, C◼F257◼𝔽—163 b)
 Operation in the ring ℤn. More...
 
C◼F257◼𝔽—163 C◼F257◼𝔽—163◼_Operator—div (C◼F257◼𝔽—163 a, C◼F257◼𝔽—163 b)
 Operation in the ring ℤn. More...
 
C◼F257◼𝔽—163 C◼F257◼𝔽—163◼_Operator—mod (C◼F257◼𝔽—163 a, C◼F257◼𝔽—163 b)
 Operation in the ring ℤn. More...
 
_Bool C◼F257◼𝔽—163◼_Operator—eq (C◼F257◼𝔽—163 a, C◼F257◼𝔽—163 b)
 Equality in the ring ℤn. More...
 
C◼F257◼𝔽—163 C◼F257◼𝔽—163◼_Operator—notnot (C◼F257◼𝔽—163 a)
 Test if non-zero in ℤn. More...
 
C◼F257◼𝔽—163 C◼F257◼order—163 (C◼F257◼𝔽—163 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—163
C◼snippet◼modulo◼contextC◼F257◼𝔽—163
C◼snippet◼modulo◼typeC◼F257◼𝔽—163
C◼snippet◼modulo◼orderC◼F257◼order—163
C◼snippet◼modulo◼generatorC◼F257◼generator—163
C◼snippet◼modulo◼generator_defaultuses default

Typedef Documentation

§ C◼F257◼𝔽—163

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

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

Function Documentation

§ C◼F257◼order—163()

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

Compute the order of element .

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

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

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

5737  {
5738 #line 147 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
5739  if (¬(C◼F257◼𝔽—163◼_Operator—notnot(x ))) return 0;
5740  C◼F257◼𝔽—163 y = x;
5741  for (C◼F257◼𝔽—163 i = 1; i; ((i )=(C◼F257◼𝔽—163◼_Operator—add(i , 1)))) {
5742 #line 150 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
5743  if (C◼F257◼𝔽—163◼_Operator—eq(y , 1 )) return i;
5745  }
5746  // should not be reached
5747  return 0;
5748 }
C◼F257◼𝔽—163 C◼F257◼𝔽—163◼_Operator—add(C◼F257◼𝔽—163 a, C◼F257◼𝔽—163 b)
Operation in the ring ℤn.
Definition: C-F257.c:5687
_Intern◼_I584Rsma◼C◼F257◼Z—163◼type₀ C◼F257◼𝔽—163
Definition: C-F257.c:5658
_Bool C◼F257◼𝔽—163◼_Operator—eq(C◼F257◼𝔽—163 a, C◼F257◼𝔽—163 b)
Equality in the ring ℤn.
Definition: C-F257.c:5716
C◼F257◼𝔽—163 C◼F257◼𝔽—163◼_Operator—prod(C◼F257◼𝔽—163 a, C◼F257◼𝔽—163 b)
Operation in the ring ℤn.
Definition: C-F257.c:5699
C◼F257◼𝔽—163 C◼F257◼𝔽—163◼_Operator—notnot(C◼F257◼𝔽—163 a)
Test if non-zero in ℤn.
Definition: C-F257.c:5721
+ Here is the call graph for this function:

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

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

Operation in the ring ℤn.

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

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

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

5687  {
5688 #line 107 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
5689  C◼F257◼𝔽—163 ret = a + b;
5691 }
_Intern◼_I584Rsma◼C◼F257◼Z—163◼type₀ C◼F257◼𝔽—163
Definition: C-F257.c:5658
C◼F257◼𝔽—163 C◼F257◼𝔽—163◼_Operator—bnotbnot(C◼F257◼𝔽—163 a)
Map a into ℤn.
Definition: C-F257.c:5682
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

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

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

Map a into ℤn.

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

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

5682  {
5683 #line 103 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
5684  return a % _Intern◼_I584Rsma◼C◼F257◼Z—163◼mod₀;
5685 }
+ Here is the caller graph for this function:

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

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

Operation in the ring ℤn.

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

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

5705  {
5706 #line 122 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
5707  C◼F257◼𝔽—163 ret = a * _Intern◼_I584Rsma◼C◼F257◼Z—163◼inverse(b);
5709 }
_Intern◼_I584Rsma◼C◼F257◼Z—163◼type₀ C◼F257◼𝔽—163
Definition: C-F257.c:5658
C◼F257◼𝔽—163 C◼F257◼𝔽—163◼_Operator—bnotbnot(C◼F257◼𝔽—163 a)
Map a into ℤn.
Definition: C-F257.c:5682
+ Here is the caller graph for this function:

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

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

Equality in the ring ℤn.

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

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

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

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

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

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

Operation in the ring ℤn.

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

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

5711  {
5712 #line 127 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
5714 }
C◼F257◼𝔽—163 C◼F257◼𝔽—163◼_Operator—prod(C◼F257◼𝔽—163 a, C◼F257◼𝔽—163 b)
Operation in the ring ℤn.
Definition: C-F257.c:5699
C◼F257◼𝔽—163 C◼F257◼𝔽—163◼_Operator—div(C◼F257◼𝔽—163 a, C◼F257◼𝔽—163 b)
Operation in the ring ℤn.
Definition: C-F257.c:5705
C◼F257◼𝔽—163 C◼F257◼𝔽—163◼_Operator—sub(C◼F257◼𝔽—163 a, C◼F257◼𝔽—163 b)
Operation in the ring ℤn.
Definition: C-F257.c:5693
+ Here is the call graph for this function:

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

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

Test if non-zero in ℤn.

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

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

5721  {
5722 #line 135 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
5723  return ‼C◼F257◼𝔽—163◼_Operator—bnotbnot(a);
5724 }
+ Here is the caller graph for this function:

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

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

Operation in the ring ℤn.

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

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

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

5699  {
5700 #line 117 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
5701  C◼F257◼𝔽—163 ret = a * b;
5703 }
_Intern◼_I584Rsma◼C◼F257◼Z—163◼type₀ C◼F257◼𝔽—163
Definition: C-F257.c:5658
C◼F257◼𝔽—163 C◼F257◼𝔽—163◼_Operator—bnotbnot(C◼F257◼𝔽—163 a)
Map a into ℤn.
Definition: C-F257.c:5682
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

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

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

Operation in the ring ℤn.

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

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

5693  {
5694 #line 112 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
5695  C◼F257◼𝔽—163 ret = a + (_Intern◼_I584Rsma◼C◼F257◼Z—163◼mod₀ - b);
5697 }
_Intern◼_I584Rsma◼C◼F257◼Z—163◼type₀ C◼F257◼𝔽—163
Definition: C-F257.c:5658
C◼F257◼𝔽—163 C◼F257◼𝔽—163◼_Operator—bnotbnot(C◼F257◼𝔽—163 a)
Map a into ℤn.
Definition: C-F257.c:5682
+ Here is the caller graph for this function:

Variable Documentation

§ C◼F257◼generator—163

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 5757 of file C-F257.c.