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

Typedef Documentation

§ C◼F257◼𝔽—19

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

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

Function Documentation

§ C◼F257◼order—19()

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

Compute the order of element .

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

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

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

12757  {
12758 #line 147 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
12759  if (¬(C◼F257◼𝔽—19◼_Operator—notnot(x ))) return 0;
12760  C◼F257◼𝔽—19 y = x;
12761  for (C◼F257◼𝔽—19 i = 1; i; ((i )=(C◼F257◼𝔽—19◼_Operator—add(i , 1)))) {
12762 #line 150 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
12763  if (C◼F257◼𝔽—19◼_Operator—eq(y , 1 )) return i;
12764  ((y )=(C◼F257◼𝔽—19◼_Operator—prod(y , x )));
12765  }
12766  // should not be reached
12767  return 0;
12768 }
C◼F257◼𝔽—19 C◼F257◼𝔽—19◼_Operator—prod(C◼F257◼𝔽—19 a, C◼F257◼𝔽—19 b)
Operation in the ring ℤn.
Definition: C-F257.c:12719
C◼F257◼𝔽—19 C◼F257◼𝔽—19◼_Operator—notnot(C◼F257◼𝔽—19 a)
Test if non-zero in ℤn.
Definition: C-F257.c:12741
_Bool C◼F257◼𝔽—19◼_Operator—eq(C◼F257◼𝔽—19 a, C◼F257◼𝔽—19 b)
Equality in the ring ℤn.
Definition: C-F257.c:12736
C◼F257◼𝔽—19 C◼F257◼𝔽—19◼_Operator—add(C◼F257◼𝔽—19 a, C◼F257◼𝔽—19 b)
Operation in the ring ℤn.
Definition: C-F257.c:12707
_Intern◼_I584Rsma◼C◼F257◼Z—19◼type₀ C◼F257◼𝔽—19
Definition: C-F257.c:12678
+ Here is the call graph for this function:

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

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

Operation in the ring ℤn.

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

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

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

12707  {
12708 #line 107 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
12709  C◼F257◼𝔽—19 ret = a + b;
12711 }
C◼F257◼𝔽—19 C◼F257◼𝔽—19◼_Operator—bnotbnot(C◼F257◼𝔽—19 a)
Map a into ℤn.
Definition: C-F257.c:12702
_Intern◼_I584Rsma◼C◼F257◼Z—19◼type₀ C◼F257◼𝔽—19
Definition: C-F257.c:12678
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

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

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

Map a into ℤn.

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

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

12702  {
12703 #line 103 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
12704  return a % _Intern◼_I584Rsma◼C◼F257◼Z—19◼mod₀;
12705 }
+ Here is the caller graph for this function:

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

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

Operation in the ring ℤn.

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

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

12725  {
12726 #line 122 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
12727  C◼F257◼𝔽—19 ret = a * _Intern◼_I584Rsma◼C◼F257◼Z—19◼inverse(b);
12729 }
C◼F257◼𝔽—19 C◼F257◼𝔽—19◼_Operator—bnotbnot(C◼F257◼𝔽—19 a)
Map a into ℤn.
Definition: C-F257.c:12702
_Intern◼_I584Rsma◼C◼F257◼Z—19◼type₀ C◼F257◼𝔽—19
Definition: C-F257.c:12678
+ Here is the caller graph for this function:

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

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

Equality in the ring ℤn.

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

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

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

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

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

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

Operation in the ring ℤn.

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

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

12731  {
12732 #line 127 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
12734 }
C◼F257◼𝔽—19 C◼F257◼𝔽—19◼_Operator—div(C◼F257◼𝔽—19 a, C◼F257◼𝔽—19 b)
Operation in the ring ℤn.
Definition: C-F257.c:12725
C◼F257◼𝔽—19 C◼F257◼𝔽—19◼_Operator—sub(C◼F257◼𝔽—19 a, C◼F257◼𝔽—19 b)
Operation in the ring ℤn.
Definition: C-F257.c:12713
C◼F257◼𝔽—19 C◼F257◼𝔽—19◼_Operator—prod(C◼F257◼𝔽—19 a, C◼F257◼𝔽—19 b)
Operation in the ring ℤn.
Definition: C-F257.c:12719
+ Here is the call graph for this function:

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

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

Test if non-zero in ℤn.

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

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

12741  {
12742 #line 135 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
12743  return ‼C◼F257◼𝔽—19◼_Operator—bnotbnot(a);
12744 }
+ Here is the caller graph for this function:

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

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

Operation in the ring ℤn.

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

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

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

12719  {
12720 #line 117 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
12721  C◼F257◼𝔽—19 ret = a * b;
12723 }
C◼F257◼𝔽—19 C◼F257◼𝔽—19◼_Operator—bnotbnot(C◼F257◼𝔽—19 a)
Map a into ℤn.
Definition: C-F257.c:12702
_Intern◼_I584Rsma◼C◼F257◼Z—19◼type₀ C◼F257◼𝔽—19
Definition: C-F257.c:12678
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

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

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

Operation in the ring ℤn.

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

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

12713  {
12714 #line 112 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
12715  C◼F257◼𝔽—19 ret = a + (_Intern◼_I584Rsma◼C◼F257◼Z—19◼mod₀ - b);
12717 }
C◼F257◼𝔽—19 C◼F257◼𝔽—19◼_Operator—bnotbnot(C◼F257◼𝔽—19 a)
Map a into ℤn.
Definition: C-F257.c:12702
_Intern◼_I584Rsma◼C◼F257◼Z—19◼type₀ C◼F257◼𝔽—19
Definition: C-F257.c:12678
+ Here is the caller graph for this function:

Variable Documentation

§ C◼F257◼generator—19

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