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

Typedef Documentation

§ C◼F257◼𝔽—67

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

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

Function Documentation

§ C◼F257◼order—67()

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

Compute the order of element .

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

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

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

10183  {
10184 #line 147 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
10185  if (¬(C◼F257◼𝔽—67◼_Operator—notnot(x ))) return 0;
10186  C◼F257◼𝔽—67 y = x;
10187  for (C◼F257◼𝔽—67 i = 1; i; ((i )=(C◼F257◼𝔽—67◼_Operator—add(i , 1)))) {
10188 #line 150 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
10189  if (C◼F257◼𝔽—67◼_Operator—eq(y , 1 )) return i;
10190  ((y )=(C◼F257◼𝔽—67◼_Operator—prod(y , x )));
10191  }
10192  // should not be reached
10193  return 0;
10194 }
C◼F257◼𝔽—67 C◼F257◼𝔽—67◼_Operator—notnot(C◼F257◼𝔽—67 a)
Test if non-zero in ℤn.
Definition: C-F257.c:10167
_Bool C◼F257◼𝔽—67◼_Operator—eq(C◼F257◼𝔽—67 a, C◼F257◼𝔽—67 b)
Equality in the ring ℤn.
Definition: C-F257.c:10162
C◼F257◼𝔽—67 C◼F257◼𝔽—67◼_Operator—add(C◼F257◼𝔽—67 a, C◼F257◼𝔽—67 b)
Operation in the ring ℤn.
Definition: C-F257.c:10133
_Intern◼_I584Rsma◼C◼F257◼Z—67◼type₀ C◼F257◼𝔽—67
Definition: C-F257.c:10104
C◼F257◼𝔽—67 C◼F257◼𝔽—67◼_Operator—prod(C◼F257◼𝔽—67 a, C◼F257◼𝔽—67 b)
Operation in the ring ℤn.
Definition: C-F257.c:10145
+ Here is the call graph for this function:

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

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

Operation in the ring ℤn.

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

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

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

10133  {
10134 #line 107 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
10135  C◼F257◼𝔽—67 ret = a + b;
10137 }
C◼F257◼𝔽—67 C◼F257◼𝔽—67◼_Operator—bnotbnot(C◼F257◼𝔽—67 a)
Map a into ℤn.
Definition: C-F257.c:10128
_Intern◼_I584Rsma◼C◼F257◼Z—67◼type₀ C◼F257◼𝔽—67
Definition: C-F257.c:10104
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

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

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

Map a into ℤn.

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

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

10128  {
10129 #line 103 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
10130  return a % _Intern◼_I584Rsma◼C◼F257◼Z—67◼mod₀;
10131 }
+ Here is the caller graph for this function:

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

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

Operation in the ring ℤn.

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

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

10151  {
10152 #line 122 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
10153  C◼F257◼𝔽—67 ret = a * _Intern◼_I584Rsma◼C◼F257◼Z—67◼inverse(b);
10155 }
C◼F257◼𝔽—67 C◼F257◼𝔽—67◼_Operator—bnotbnot(C◼F257◼𝔽—67 a)
Map a into ℤn.
Definition: C-F257.c:10128
_Intern◼_I584Rsma◼C◼F257◼Z—67◼type₀ C◼F257◼𝔽—67
Definition: C-F257.c:10104
+ Here is the caller graph for this function:

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

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

Equality in the ring ℤn.

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

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

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

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

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

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

Operation in the ring ℤn.

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

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

10157  {
10158 #line 127 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
10160 }
C◼F257◼𝔽—67 C◼F257◼𝔽—67◼_Operator—sub(C◼F257◼𝔽—67 a, C◼F257◼𝔽—67 b)
Operation in the ring ℤn.
Definition: C-F257.c:10139
C◼F257◼𝔽—67 C◼F257◼𝔽—67◼_Operator—div(C◼F257◼𝔽—67 a, C◼F257◼𝔽—67 b)
Operation in the ring ℤn.
Definition: C-F257.c:10151
C◼F257◼𝔽—67 C◼F257◼𝔽—67◼_Operator—prod(C◼F257◼𝔽—67 a, C◼F257◼𝔽—67 b)
Operation in the ring ℤn.
Definition: C-F257.c:10145
+ Here is the call graph for this function:

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

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

Test if non-zero in ℤn.

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

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

10167  {
10168 #line 135 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
10169  return ‼C◼F257◼𝔽—67◼_Operator—bnotbnot(a);
10170 }
+ Here is the caller graph for this function:

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

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

Operation in the ring ℤn.

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

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

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

10145  {
10146 #line 117 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
10147  C◼F257◼𝔽—67 ret = a * b;
10149 }
C◼F257◼𝔽—67 C◼F257◼𝔽—67◼_Operator—bnotbnot(C◼F257◼𝔽—67 a)
Map a into ℤn.
Definition: C-F257.c:10128
_Intern◼_I584Rsma◼C◼F257◼Z—67◼type₀ C◼F257◼𝔽—67
Definition: C-F257.c:10104
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

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

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

Operation in the ring ℤn.

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

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

10139  {
10140 #line 112 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
10141  C◼F257◼𝔽—67 ret = a + (_Intern◼_I584Rsma◼C◼F257◼Z—67◼mod₀ - b);
10143 }
C◼F257◼𝔽—67 C◼F257◼𝔽—67◼_Operator—bnotbnot(C◼F257◼𝔽—67 a)
Map a into ℤn.
Definition: C-F257.c:10128
_Intern◼_I584Rsma◼C◼F257◼Z—67◼type₀ C◼F257◼𝔽—67
Definition: C-F257.c:10104
+ Here is the caller graph for this function:

Variable Documentation

§ C◼F257◼generator—67

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