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

Typedef Documentation

§ C◼F257◼𝔽—127

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

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

Function Documentation

§ C◼F257◼order—127()

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

Compute the order of element .

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

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

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

7375  {
7376 #line 147 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
7377  if (¬(C◼F257◼𝔽—127◼_Operator—notnot(x ))) return 0;
7378  C◼F257◼𝔽—127 y = x;
7379  for (C◼F257◼𝔽—127 i = 1; i; ((i )=(C◼F257◼𝔽—127◼_Operator—add(i , 1)))) {
7380 #line 150 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
7381  if (C◼F257◼𝔽—127◼_Operator—eq(y , 1 )) return i;
7383  }
7384  // should not be reached
7385  return 0;
7386 }
C◼F257◼𝔽—127 C◼F257◼𝔽—127◼_Operator—add(C◼F257◼𝔽—127 a, C◼F257◼𝔽—127 b)
Operation in the ring ℤn.
Definition: C-F257.c:7325
C◼F257◼𝔽—127 C◼F257◼𝔽—127◼_Operator—prod(C◼F257◼𝔽—127 a, C◼F257◼𝔽—127 b)
Operation in the ring ℤn.
Definition: C-F257.c:7337
_Bool C◼F257◼𝔽—127◼_Operator—eq(C◼F257◼𝔽—127 a, C◼F257◼𝔽—127 b)
Equality in the ring ℤn.
Definition: C-F257.c:7354
C◼F257◼𝔽—127 C◼F257◼𝔽—127◼_Operator—notnot(C◼F257◼𝔽—127 a)
Test if non-zero in ℤn.
Definition: C-F257.c:7359
_Intern◼_I584Rsma◼C◼F257◼Z—127◼type₀ C◼F257◼𝔽—127
Definition: C-F257.c:7296
+ Here is the call graph for this function:

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

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

Operation in the ring ℤn.

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

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

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

7325  {
7326 #line 107 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
7327  C◼F257◼𝔽—127 ret = a + b;
7329 }
C◼F257◼𝔽—127 C◼F257◼𝔽—127◼_Operator—bnotbnot(C◼F257◼𝔽—127 a)
Map a into ℤn.
Definition: C-F257.c:7320
_Intern◼_I584Rsma◼C◼F257◼Z—127◼type₀ C◼F257◼𝔽—127
Definition: C-F257.c:7296
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

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

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

Map a into ℤn.

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

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

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

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

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

Operation in the ring ℤn.

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

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

7343  {
7344 #line 122 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
7345  C◼F257◼𝔽—127 ret = a * _Intern◼_I584Rsma◼C◼F257◼Z—127◼inverse(b);
7347 }
C◼F257◼𝔽—127 C◼F257◼𝔽—127◼_Operator—bnotbnot(C◼F257◼𝔽—127 a)
Map a into ℤn.
Definition: C-F257.c:7320
_Intern◼_I584Rsma◼C◼F257◼Z—127◼type₀ C◼F257◼𝔽—127
Definition: C-F257.c:7296
+ Here is the caller graph for this function:

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

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

Equality in the ring ℤn.

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

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

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

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

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

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

Operation in the ring ℤn.

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

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

7349  {
7350 #line 127 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
7352 }
C◼F257◼𝔽—127 C◼F257◼𝔽—127◼_Operator—sub(C◼F257◼𝔽—127 a, C◼F257◼𝔽—127 b)
Operation in the ring ℤn.
Definition: C-F257.c:7331
C◼F257◼𝔽—127 C◼F257◼𝔽—127◼_Operator—div(C◼F257◼𝔽—127 a, C◼F257◼𝔽—127 b)
Operation in the ring ℤn.
Definition: C-F257.c:7343
C◼F257◼𝔽—127 C◼F257◼𝔽—127◼_Operator—prod(C◼F257◼𝔽—127 a, C◼F257◼𝔽—127 b)
Operation in the ring ℤn.
Definition: C-F257.c:7337
+ Here is the call graph for this function:

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

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

Test if non-zero in ℤn.

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

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

7359  {
7360 #line 135 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
7361  return ‼C◼F257◼𝔽—127◼_Operator—bnotbnot(a);
7362 }
+ Here is the caller graph for this function:

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

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

Operation in the ring ℤn.

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

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

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

7337  {
7338 #line 117 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
7339  C◼F257◼𝔽—127 ret = a * b;
7341 }
C◼F257◼𝔽—127 C◼F257◼𝔽—127◼_Operator—bnotbnot(C◼F257◼𝔽—127 a)
Map a into ℤn.
Definition: C-F257.c:7320
_Intern◼_I584Rsma◼C◼F257◼Z—127◼type₀ C◼F257◼𝔽—127
Definition: C-F257.c:7296
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

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

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

Operation in the ring ℤn.

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

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

7331  {
7332 #line 112 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
7333  C◼F257◼𝔽—127 ret = a + (_Intern◼_I584Rsma◼C◼F257◼Z—127◼mod₀ - b);
7335 }
C◼F257◼𝔽—127 C◼F257◼𝔽—127◼_Operator—bnotbnot(C◼F257◼𝔽—127 a)
Map a into ℤn.
Definition: C-F257.c:7320
_Intern◼_I584Rsma◼C◼F257◼Z—127◼type₀ C◼F257◼𝔽—127
Definition: C-F257.c:7296
+ Here is the caller graph for this function:

Variable Documentation

§ C◼F257◼generator—127

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