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

Typedef Documentation

§ C◼F257◼𝔽—103

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

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

Function Documentation

§ C◼F257◼order—103()

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

Compute the order of element .

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

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

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

8311  {
8312 #line 147 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
8313  if (¬(C◼F257◼𝔽—103◼_Operator—notnot(x ))) return 0;
8314  C◼F257◼𝔽—103 y = x;
8315  for (C◼F257◼𝔽—103 i = 1; i; ((i )=(C◼F257◼𝔽—103◼_Operator—add(i , 1)))) {
8316 #line 150 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
8317  if (C◼F257◼𝔽—103◼_Operator—eq(y , 1 )) return i;
8319  }
8320  // should not be reached
8321  return 0;
8322 }
C◼F257◼𝔽—103 C◼F257◼𝔽—103◼_Operator—add(C◼F257◼𝔽—103 a, C◼F257◼𝔽—103 b)
Operation in the ring ℤn.
Definition: C-F257.c:8261
_Intern◼_I584Rsma◼C◼F257◼Z—103◼type₀ C◼F257◼𝔽—103
Definition: C-F257.c:8232
C◼F257◼𝔽—103 C◼F257◼𝔽—103◼_Operator—notnot(C◼F257◼𝔽—103 a)
Test if non-zero in ℤn.
Definition: C-F257.c:8295
_Bool C◼F257◼𝔽—103◼_Operator—eq(C◼F257◼𝔽—103 a, C◼F257◼𝔽—103 b)
Equality in the ring ℤn.
Definition: C-F257.c:8290
C◼F257◼𝔽—103 C◼F257◼𝔽—103◼_Operator—prod(C◼F257◼𝔽—103 a, C◼F257◼𝔽—103 b)
Operation in the ring ℤn.
Definition: C-F257.c:8273
+ Here is the call graph for this function:

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

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

Operation in the ring ℤn.

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

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

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

8261  {
8262 #line 107 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
8263  C◼F257◼𝔽—103 ret = a + b;
8265 }
_Intern◼_I584Rsma◼C◼F257◼Z—103◼type₀ C◼F257◼𝔽—103
Definition: C-F257.c:8232
C◼F257◼𝔽—103 C◼F257◼𝔽—103◼_Operator—bnotbnot(C◼F257◼𝔽—103 a)
Map a into ℤn.
Definition: C-F257.c:8256
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

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

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

Map a into ℤn.

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

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

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

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

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

Operation in the ring ℤn.

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

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

8279  {
8280 #line 122 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
8281  C◼F257◼𝔽—103 ret = a * _Intern◼_I584Rsma◼C◼F257◼Z—103◼inverse(b);
8283 }
_Intern◼_I584Rsma◼C◼F257◼Z—103◼type₀ C◼F257◼𝔽—103
Definition: C-F257.c:8232
C◼F257◼𝔽—103 C◼F257◼𝔽—103◼_Operator—bnotbnot(C◼F257◼𝔽—103 a)
Map a into ℤn.
Definition: C-F257.c:8256
+ Here is the caller graph for this function:

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

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

Equality in the ring ℤn.

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

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

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

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

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

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

Operation in the ring ℤn.

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

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

8285  {
8286 #line 127 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
8288 }
C◼F257◼𝔽—103 C◼F257◼𝔽—103◼_Operator—sub(C◼F257◼𝔽—103 a, C◼F257◼𝔽—103 b)
Operation in the ring ℤn.
Definition: C-F257.c:8267
C◼F257◼𝔽—103 C◼F257◼𝔽—103◼_Operator—div(C◼F257◼𝔽—103 a, C◼F257◼𝔽—103 b)
Operation in the ring ℤn.
Definition: C-F257.c:8279
C◼F257◼𝔽—103 C◼F257◼𝔽—103◼_Operator—prod(C◼F257◼𝔽—103 a, C◼F257◼𝔽—103 b)
Operation in the ring ℤn.
Definition: C-F257.c:8273
+ Here is the call graph for this function:

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

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

Test if non-zero in ℤn.

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

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

8295  {
8296 #line 135 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
8297  return ‼C◼F257◼𝔽—103◼_Operator—bnotbnot(a);
8298 }
+ Here is the caller graph for this function:

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

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

Operation in the ring ℤn.

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

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

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

8273  {
8274 #line 117 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
8275  C◼F257◼𝔽—103 ret = a * b;
8277 }
_Intern◼_I584Rsma◼C◼F257◼Z—103◼type₀ C◼F257◼𝔽—103
Definition: C-F257.c:8232
C◼F257◼𝔽—103 C◼F257◼𝔽—103◼_Operator—bnotbnot(C◼F257◼𝔽—103 a)
Map a into ℤn.
Definition: C-F257.c:8256
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

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

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

Operation in the ring ℤn.

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

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

8267  {
8268 #line 112 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
8269  C◼F257◼𝔽—103 ret = a + (_Intern◼_I584Rsma◼C◼F257◼Z—103◼mod₀ - b);
8271 }
_Intern◼_I584Rsma◼C◼F257◼Z—103◼type₀ C◼F257◼𝔽—103
Definition: C-F257.c:8232
C◼F257◼𝔽—103 C◼F257◼𝔽—103◼_Operator—bnotbnot(C◼F257◼𝔽—103 a)
Map a into ℤn.
Definition: C-F257.c:8256
+ Here is the caller graph for this function:

Variable Documentation

§ C◼F257◼generator—103

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