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

Typedef Documentation

§ C◼F257◼𝔽—7

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

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

Function Documentation

§ C◼F257◼order—7()

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

Compute the order of element .

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

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

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

13693  {
13694 #line 147 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
13695  if (¬(C◼F257◼𝔽—7◼_Operator—notnot(x ))) return 0;
13696  C◼F257◼𝔽—7 y = x;
13697  for (C◼F257◼𝔽—7 i = 1; i; ((i )=(C◼F257◼𝔽—7◼_Operator—add(i , 1)))) {
13698 #line 150 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
13699  if (C◼F257◼𝔽—7◼_Operator—eq(y , 1 )) return i;
13700  ((y )=(C◼F257◼𝔽—7◼_Operator—prod(y , x )));
13701  }
13702  // should not be reached
13703  return 0;
13704 }
C◼F257◼𝔽—7 C◼F257◼𝔽—7◼_Operator—prod(C◼F257◼𝔽—7 a, C◼F257◼𝔽—7 b)
Operation in the ring ℤn.
Definition: C-F257.c:13655
_Intern◼_I584Rsma◼C◼F257◼Z—7◼type₀ C◼F257◼𝔽—7
Definition: C-F257.c:13614
C◼F257◼𝔽—7 C◼F257◼𝔽—7◼_Operator—notnot(C◼F257◼𝔽—7 a)
Test if non-zero in ℤn.
Definition: C-F257.c:13677
C◼F257◼𝔽—7 C◼F257◼𝔽—7◼_Operator—add(C◼F257◼𝔽—7 a, C◼F257◼𝔽—7 b)
Operation in the ring ℤn.
Definition: C-F257.c:13643
_Bool C◼F257◼𝔽—7◼_Operator—eq(C◼F257◼𝔽—7 a, C◼F257◼𝔽—7 b)
Equality in the ring ℤn.
Definition: C-F257.c:13672
+ Here is the call graph for this function:

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

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

Operation in the ring ℤn.

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

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

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

13643  {
13644 #line 107 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
13645  C◼F257◼𝔽—7 ret = a + b;
13647 }
_Intern◼_I584Rsma◼C◼F257◼Z—7◼type₀ C◼F257◼𝔽—7
Definition: C-F257.c:13614
C◼F257◼𝔽—7 C◼F257◼𝔽—7◼_Operator—bnotbnot(C◼F257◼𝔽—7 a)
Map a into ℤn.
Definition: C-F257.c:13638
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

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

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

Map a into ℤn.

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

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

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

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

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

Operation in the ring ℤn.

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

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

13661  {
13662 #line 122 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
13663  C◼F257◼𝔽—7 ret = a * _Intern◼_I584Rsma◼C◼F257◼Z—7◼inverse(b);
13665 }
_Intern◼_I584Rsma◼C◼F257◼Z—7◼type₀ C◼F257◼𝔽—7
Definition: C-F257.c:13614
C◼F257◼𝔽—7 C◼F257◼𝔽—7◼_Operator—bnotbnot(C◼F257◼𝔽—7 a)
Map a into ℤn.
Definition: C-F257.c:13638
+ Here is the caller graph for this function:

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

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

Equality in the ring ℤn.

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

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

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

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

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

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

Operation in the ring ℤn.

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

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

13667  {
13668 #line 127 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
13670 }
C◼F257◼𝔽—7 C◼F257◼𝔽—7◼_Operator—div(C◼F257◼𝔽—7 a, C◼F257◼𝔽—7 b)
Operation in the ring ℤn.
Definition: C-F257.c:13661
C◼F257◼𝔽—7 C◼F257◼𝔽—7◼_Operator—prod(C◼F257◼𝔽—7 a, C◼F257◼𝔽—7 b)
Operation in the ring ℤn.
Definition: C-F257.c:13655
C◼F257◼𝔽—7 C◼F257◼𝔽—7◼_Operator—sub(C◼F257◼𝔽—7 a, C◼F257◼𝔽—7 b)
Operation in the ring ℤn.
Definition: C-F257.c:13649
+ Here is the call graph for this function:

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

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

Test if non-zero in ℤn.

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

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

13677  {
13678 #line 135 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
13679  return ‼C◼F257◼𝔽—7◼_Operator—bnotbnot(a);
13680 }
+ Here is the caller graph for this function:

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

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

Operation in the ring ℤn.

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

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

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

13655  {
13656 #line 117 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
13657  C◼F257◼𝔽—7 ret = a * b;
13659 }
_Intern◼_I584Rsma◼C◼F257◼Z—7◼type₀ C◼F257◼𝔽—7
Definition: C-F257.c:13614
C◼F257◼𝔽—7 C◼F257◼𝔽—7◼_Operator—bnotbnot(C◼F257◼𝔽—7 a)
Map a into ℤn.
Definition: C-F257.c:13638
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

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

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

Operation in the ring ℤn.

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

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

13649  {
13650 #line 112 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
13651  C◼F257◼𝔽—7 ret = a + (_Intern◼_I584Rsma◼C◼F257◼Z—7◼mod₀ - b);
13653 }
_Intern◼_I584Rsma◼C◼F257◼Z—7◼type₀ C◼F257◼𝔽—7
Definition: C-F257.c:13614
C◼F257◼𝔽—7 C◼F257◼𝔽—7◼_Operator—bnotbnot(C◼F257◼𝔽—7 a)
Map a into ℤn.
Definition: C-F257.c:13638
+ Here is the caller graph for this function:

Variable Documentation

§ C◼F257◼generator—7

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