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

Typedef Documentation

§ C◼F257◼𝔽—79

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

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

Function Documentation

§ C◼F257◼order—79()

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

Compute the order of element .

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

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

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

9481  {
9482 #line 147 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
9483  if (¬(C◼F257◼𝔽—79◼_Operator—notnot(x ))) return 0;
9484  C◼F257◼𝔽—79 y = x;
9485  for (C◼F257◼𝔽—79 i = 1; i; ((i )=(C◼F257◼𝔽—79◼_Operator—add(i , 1)))) {
9486 #line 150 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
9487  if (C◼F257◼𝔽—79◼_Operator—eq(y , 1 )) return i;
9488  ((y )=(C◼F257◼𝔽—79◼_Operator—prod(y , x )));
9489  }
9490  // should not be reached
9491  return 0;
9492 }
C◼F257◼𝔽—79 C◼F257◼𝔽—79◼_Operator—prod(C◼F257◼𝔽—79 a, C◼F257◼𝔽—79 b)
Operation in the ring ℤn.
Definition: C-F257.c:9443
_Bool C◼F257◼𝔽—79◼_Operator—eq(C◼F257◼𝔽—79 a, C◼F257◼𝔽—79 b)
Equality in the ring ℤn.
Definition: C-F257.c:9460
C◼F257◼𝔽—79 C◼F257◼𝔽—79◼_Operator—add(C◼F257◼𝔽—79 a, C◼F257◼𝔽—79 b)
Operation in the ring ℤn.
Definition: C-F257.c:9431
C◼F257◼𝔽—79 C◼F257◼𝔽—79◼_Operator—notnot(C◼F257◼𝔽—79 a)
Test if non-zero in ℤn.
Definition: C-F257.c:9465
_Intern◼_I584Rsma◼C◼F257◼Z—79◼type₀ C◼F257◼𝔽—79
Definition: C-F257.c:9402
+ Here is the call graph for this function:

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

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

Operation in the ring ℤn.

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

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

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

9431  {
9432 #line 107 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
9433  C◼F257◼𝔽—79 ret = a + b;
9435 }
C◼F257◼𝔽—79 C◼F257◼𝔽—79◼_Operator—bnotbnot(C◼F257◼𝔽—79 a)
Map a into ℤn.
Definition: C-F257.c:9426
_Intern◼_I584Rsma◼C◼F257◼Z—79◼type₀ C◼F257◼𝔽—79
Definition: C-F257.c:9402
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

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

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

Map a into ℤn.

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

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

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

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

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

Operation in the ring ℤn.

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

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

9449  {
9450 #line 122 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
9451  C◼F257◼𝔽—79 ret = a * _Intern◼_I584Rsma◼C◼F257◼Z—79◼inverse(b);
9453 }
C◼F257◼𝔽—79 C◼F257◼𝔽—79◼_Operator—bnotbnot(C◼F257◼𝔽—79 a)
Map a into ℤn.
Definition: C-F257.c:9426
_Intern◼_I584Rsma◼C◼F257◼Z—79◼type₀ C◼F257◼𝔽—79
Definition: C-F257.c:9402
+ Here is the caller graph for this function:

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

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

Equality in the ring ℤn.

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

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

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

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

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

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

Operation in the ring ℤn.

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

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

9455  {
9456 #line 127 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
9458 }
C◼F257◼𝔽—79 C◼F257◼𝔽—79◼_Operator—sub(C◼F257◼𝔽—79 a, C◼F257◼𝔽—79 b)
Operation in the ring ℤn.
Definition: C-F257.c:9437
C◼F257◼𝔽—79 C◼F257◼𝔽—79◼_Operator—prod(C◼F257◼𝔽—79 a, C◼F257◼𝔽—79 b)
Operation in the ring ℤn.
Definition: C-F257.c:9443
C◼F257◼𝔽—79 C◼F257◼𝔽—79◼_Operator—div(C◼F257◼𝔽—79 a, C◼F257◼𝔽—79 b)
Operation in the ring ℤn.
Definition: C-F257.c:9449
+ Here is the call graph for this function:

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

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

Test if non-zero in ℤn.

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

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

9465  {
9466 #line 135 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
9467  return ‼C◼F257◼𝔽—79◼_Operator—bnotbnot(a);
9468 }
+ Here is the caller graph for this function:

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

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

Operation in the ring ℤn.

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

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

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

9443  {
9444 #line 117 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
9445  C◼F257◼𝔽—79 ret = a * b;
9447 }
C◼F257◼𝔽—79 C◼F257◼𝔽—79◼_Operator—bnotbnot(C◼F257◼𝔽—79 a)
Map a into ℤn.
Definition: C-F257.c:9426
_Intern◼_I584Rsma◼C◼F257◼Z—79◼type₀ C◼F257◼𝔽—79
Definition: C-F257.c:9402
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

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

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

Operation in the ring ℤn.

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

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

9437  {
9438 #line 112 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
9439  C◼F257◼𝔽—79 ret = a + (_Intern◼_I584Rsma◼C◼F257◼Z—79◼mod₀ - b);
9441 }
C◼F257◼𝔽—79 C◼F257◼𝔽—79◼_Operator—bnotbnot(C◼F257◼𝔽—79 a)
Map a into ℤn.
Definition: C-F257.c:9426
_Intern◼_I584Rsma◼C◼F257◼Z—79◼type₀ C◼F257◼𝔽—79
Definition: C-F257.c:9402
+ Here is the caller graph for this function:

Variable Documentation

§ C◼F257◼generator—79

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