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

Typedef Documentation

§ C◼F257◼𝔽—59

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

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

Function Documentation

§ C◼F257◼order—59()

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

Compute the order of element .

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

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

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

10651  {
10652 #line 147 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
10653  if (¬(C◼F257◼𝔽—59◼_Operator—notnot(x ))) return 0;
10654  C◼F257◼𝔽—59 y = x;
10655  for (C◼F257◼𝔽—59 i = 1; i; ((i )=(C◼F257◼𝔽—59◼_Operator—add(i , 1)))) {
10656 #line 150 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
10657  if (C◼F257◼𝔽—59◼_Operator—eq(y , 1 )) return i;
10658  ((y )=(C◼F257◼𝔽—59◼_Operator—prod(y , x )));
10659  }
10660  // should not be reached
10661  return 0;
10662 }
_Intern◼_I584Rsma◼C◼F257◼Z—59◼type₀ C◼F257◼𝔽—59
Definition: C-F257.c:10572
_Bool C◼F257◼𝔽—59◼_Operator—eq(C◼F257◼𝔽—59 a, C◼F257◼𝔽—59 b)
Equality in the ring ℤn.
Definition: C-F257.c:10630
C◼F257◼𝔽—59 C◼F257◼𝔽—59◼_Operator—notnot(C◼F257◼𝔽—59 a)
Test if non-zero in ℤn.
Definition: C-F257.c:10635
C◼F257◼𝔽—59 C◼F257◼𝔽—59◼_Operator—prod(C◼F257◼𝔽—59 a, C◼F257◼𝔽—59 b)
Operation in the ring ℤn.
Definition: C-F257.c:10613
C◼F257◼𝔽—59 C◼F257◼𝔽—59◼_Operator—add(C◼F257◼𝔽—59 a, C◼F257◼𝔽—59 b)
Operation in the ring ℤn.
Definition: C-F257.c:10601
+ Here is the call graph for this function:

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

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

Operation in the ring ℤn.

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

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

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

10601  {
10602 #line 107 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
10603  C◼F257◼𝔽—59 ret = a + b;
10605 }
_Intern◼_I584Rsma◼C◼F257◼Z—59◼type₀ C◼F257◼𝔽—59
Definition: C-F257.c:10572
C◼F257◼𝔽—59 C◼F257◼𝔽—59◼_Operator—bnotbnot(C◼F257◼𝔽—59 a)
Map a into ℤn.
Definition: C-F257.c:10596
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

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

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

Map a into ℤn.

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

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

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

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

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

Operation in the ring ℤn.

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

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

10619  {
10620 #line 122 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
10621  C◼F257◼𝔽—59 ret = a * _Intern◼_I584Rsma◼C◼F257◼Z—59◼inverse(b);
10623 }
_Intern◼_I584Rsma◼C◼F257◼Z—59◼type₀ C◼F257◼𝔽—59
Definition: C-F257.c:10572
C◼F257◼𝔽—59 C◼F257◼𝔽—59◼_Operator—bnotbnot(C◼F257◼𝔽—59 a)
Map a into ℤn.
Definition: C-F257.c:10596
+ Here is the caller graph for this function:

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

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

Equality in the ring ℤn.

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

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

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

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

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

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

Operation in the ring ℤn.

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

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

10625  {
10626 #line 127 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
10628 }
C◼F257◼𝔽—59 C◼F257◼𝔽—59◼_Operator—div(C◼F257◼𝔽—59 a, C◼F257◼𝔽—59 b)
Operation in the ring ℤn.
Definition: C-F257.c:10619
C◼F257◼𝔽—59 C◼F257◼𝔽—59◼_Operator—prod(C◼F257◼𝔽—59 a, C◼F257◼𝔽—59 b)
Operation in the ring ℤn.
Definition: C-F257.c:10613
C◼F257◼𝔽—59 C◼F257◼𝔽—59◼_Operator—sub(C◼F257◼𝔽—59 a, C◼F257◼𝔽—59 b)
Operation in the ring ℤn.
Definition: C-F257.c:10607
+ Here is the call graph for this function:

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

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

Test if non-zero in ℤn.

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

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

10635  {
10636 #line 135 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
10637  return ‼C◼F257◼𝔽—59◼_Operator—bnotbnot(a);
10638 }
+ Here is the caller graph for this function:

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

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

Operation in the ring ℤn.

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

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

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

10613  {
10614 #line 117 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
10615  C◼F257◼𝔽—59 ret = a * b;
10617 }
_Intern◼_I584Rsma◼C◼F257◼Z—59◼type₀ C◼F257◼𝔽—59
Definition: C-F257.c:10572
C◼F257◼𝔽—59 C◼F257◼𝔽—59◼_Operator—bnotbnot(C◼F257◼𝔽—59 a)
Map a into ℤn.
Definition: C-F257.c:10596
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

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

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

Operation in the ring ℤn.

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

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

10607  {
10608 #line 112 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
10609  C◼F257◼𝔽—59 ret = a + (_Intern◼_I584Rsma◼C◼F257◼Z—59◼mod₀ - b);
10611 }
_Intern◼_I584Rsma◼C◼F257◼Z—59◼type₀ C◼F257◼𝔽—59
Definition: C-F257.c:10572
C◼F257◼𝔽—59 C◼F257◼𝔽—59◼_Operator—bnotbnot(C◼F257◼𝔽—59 a)
Map a into ℤn.
Definition: C-F257.c:10596
+ Here is the caller graph for this function:

Variable Documentation

§ C◼F257◼generator—59

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