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

Typedef Documentation

§ C◼F257◼𝔽—173

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

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

Function Documentation

§ C◼F257◼order—173()

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

Compute the order of element .

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

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

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

5269  {
5270 #line 147 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
5271  if (¬(C◼F257◼𝔽—173◼_Operator—notnot(x ))) return 0;
5272  C◼F257◼𝔽—173 y = x;
5273  for (C◼F257◼𝔽—173 i = 1; i; ((i )=(C◼F257◼𝔽—173◼_Operator—add(i , 1)))) {
5274 #line 150 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
5275  if (C◼F257◼𝔽—173◼_Operator—eq(y , 1 )) return i;
5277  }
5278  // should not be reached
5279  return 0;
5280 }
C◼F257◼𝔽—173 C◼F257◼𝔽—173◼_Operator—add(C◼F257◼𝔽—173 a, C◼F257◼𝔽—173 b)
Operation in the ring ℤn.
Definition: C-F257.c:5219
C◼F257◼𝔽—173 C◼F257◼𝔽—173◼_Operator—prod(C◼F257◼𝔽—173 a, C◼F257◼𝔽—173 b)
Operation in the ring ℤn.
Definition: C-F257.c:5231
C◼F257◼𝔽—173 C◼F257◼𝔽—173◼_Operator—notnot(C◼F257◼𝔽—173 a)
Test if non-zero in ℤn.
Definition: C-F257.c:5253
_Bool C◼F257◼𝔽—173◼_Operator—eq(C◼F257◼𝔽—173 a, C◼F257◼𝔽—173 b)
Equality in the ring ℤn.
Definition: C-F257.c:5248
_Intern◼_I584Rsma◼C◼F257◼Z—173◼type₀ C◼F257◼𝔽—173
Definition: C-F257.c:5190
+ Here is the call graph for this function:

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

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

Operation in the ring ℤn.

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

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

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

5219  {
5220 #line 107 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
5221  C◼F257◼𝔽—173 ret = a + b;
5223 }
C◼F257◼𝔽—173 C◼F257◼𝔽—173◼_Operator—bnotbnot(C◼F257◼𝔽—173 a)
Map a into ℤn.
Definition: C-F257.c:5214
_Intern◼_I584Rsma◼C◼F257◼Z—173◼type₀ C◼F257◼𝔽—173
Definition: C-F257.c:5190
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

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

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

Map a into ℤn.

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

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

5214  {
5215 #line 103 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
5216  return a % _Intern◼_I584Rsma◼C◼F257◼Z—173◼mod₀;
5217 }
+ Here is the caller graph for this function:

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

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

Operation in the ring ℤn.

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

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

5237  {
5238 #line 122 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
5239  C◼F257◼𝔽—173 ret = a * _Intern◼_I584Rsma◼C◼F257◼Z—173◼inverse(b);
5241 }
C◼F257◼𝔽—173 C◼F257◼𝔽—173◼_Operator—bnotbnot(C◼F257◼𝔽—173 a)
Map a into ℤn.
Definition: C-F257.c:5214
_Intern◼_I584Rsma◼C◼F257◼Z—173◼type₀ C◼F257◼𝔽—173
Definition: C-F257.c:5190
+ Here is the caller graph for this function:

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

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

Equality in the ring ℤn.

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

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

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

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

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

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

Operation in the ring ℤn.

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

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

5243  {
5244 #line 127 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
5246 }
C◼F257◼𝔽—173 C◼F257◼𝔽—173◼_Operator—div(C◼F257◼𝔽—173 a, C◼F257◼𝔽—173 b)
Operation in the ring ℤn.
Definition: C-F257.c:5237
C◼F257◼𝔽—173 C◼F257◼𝔽—173◼_Operator—prod(C◼F257◼𝔽—173 a, C◼F257◼𝔽—173 b)
Operation in the ring ℤn.
Definition: C-F257.c:5231
C◼F257◼𝔽—173 C◼F257◼𝔽—173◼_Operator—sub(C◼F257◼𝔽—173 a, C◼F257◼𝔽—173 b)
Operation in the ring ℤn.
Definition: C-F257.c:5225
+ Here is the call graph for this function:

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

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

Test if non-zero in ℤn.

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

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

5253  {
5254 #line 135 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
5255  return ‼C◼F257◼𝔽—173◼_Operator—bnotbnot(a);
5256 }
+ Here is the caller graph for this function:

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

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

Operation in the ring ℤn.

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

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

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

5231  {
5232 #line 117 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
5233  C◼F257◼𝔽—173 ret = a * b;
5235 }
C◼F257◼𝔽—173 C◼F257◼𝔽—173◼_Operator—bnotbnot(C◼F257◼𝔽—173 a)
Map a into ℤn.
Definition: C-F257.c:5214
_Intern◼_I584Rsma◼C◼F257◼Z—173◼type₀ C◼F257◼𝔽—173
Definition: C-F257.c:5190
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

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

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

Operation in the ring ℤn.

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

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

5225  {
5226 #line 112 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
5227  C◼F257◼𝔽—173 ret = a + (_Intern◼_I584Rsma◼C◼F257◼Z—173◼mod₀ - b);
5229 }
C◼F257◼𝔽—173 C◼F257◼𝔽—173◼_Operator—bnotbnot(C◼F257◼𝔽—173 a)
Map a into ℤn.
Definition: C-F257.c:5214
_Intern◼_I584Rsma◼C◼F257◼Z—173◼type₀ C◼F257◼𝔽—173
Definition: C-F257.c:5190
+ Here is the caller graph for this function:

Variable Documentation

§ C◼F257◼generator—173

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