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

Typedef Documentation

§ C◼F257◼𝔽—37

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

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

Function Documentation

§ C◼F257◼order—37()

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

Compute the order of element .

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

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

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

11821  {
11822 #line 147 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
11823  if (¬(C◼F257◼𝔽—37◼_Operator—notnot(x ))) return 0;
11824  C◼F257◼𝔽—37 y = x;
11825  for (C◼F257◼𝔽—37 i = 1; i; ((i )=(C◼F257◼𝔽—37◼_Operator—add(i , 1)))) {
11826 #line 150 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
11827  if (C◼F257◼𝔽—37◼_Operator—eq(y , 1 )) return i;
11828  ((y )=(C◼F257◼𝔽—37◼_Operator—prod(y , x )));
11829  }
11830  // should not be reached
11831  return 0;
11832 }
C◼F257◼𝔽—37 C◼F257◼𝔽—37◼_Operator—add(C◼F257◼𝔽—37 a, C◼F257◼𝔽—37 b)
Operation in the ring ℤn.
Definition: C-F257.c:11771
C◼F257◼𝔽—37 C◼F257◼𝔽—37◼_Operator—prod(C◼F257◼𝔽—37 a, C◼F257◼𝔽—37 b)
Operation in the ring ℤn.
Definition: C-F257.c:11783
_Intern◼_I584Rsma◼C◼F257◼Z—37◼type₀ C◼F257◼𝔽—37
Definition: C-F257.c:11742
_Bool C◼F257◼𝔽—37◼_Operator—eq(C◼F257◼𝔽—37 a, C◼F257◼𝔽—37 b)
Equality in the ring ℤn.
Definition: C-F257.c:11800
C◼F257◼𝔽—37 C◼F257◼𝔽—37◼_Operator—notnot(C◼F257◼𝔽—37 a)
Test if non-zero in ℤn.
Definition: C-F257.c:11805
+ Here is the call graph for this function:

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

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

Operation in the ring ℤn.

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

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

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

11771  {
11772 #line 107 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
11773  C◼F257◼𝔽—37 ret = a + b;
11775 }
C◼F257◼𝔽—37 C◼F257◼𝔽—37◼_Operator—bnotbnot(C◼F257◼𝔽—37 a)
Map a into ℤn.
Definition: C-F257.c:11766
_Intern◼_I584Rsma◼C◼F257◼Z—37◼type₀ C◼F257◼𝔽—37
Definition: C-F257.c:11742
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

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

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

Map a into ℤn.

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

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

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

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

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

Operation in the ring ℤn.

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

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

11789  {
11790 #line 122 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
11791  C◼F257◼𝔽—37 ret = a * _Intern◼_I584Rsma◼C◼F257◼Z—37◼inverse(b);
11793 }
C◼F257◼𝔽—37 C◼F257◼𝔽—37◼_Operator—bnotbnot(C◼F257◼𝔽—37 a)
Map a into ℤn.
Definition: C-F257.c:11766
_Intern◼_I584Rsma◼C◼F257◼Z—37◼type₀ C◼F257◼𝔽—37
Definition: C-F257.c:11742
+ Here is the caller graph for this function:

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

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

Equality in the ring ℤn.

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

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

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

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

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

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

Operation in the ring ℤn.

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

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

11795  {
11796 #line 127 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
11798 }
C◼F257◼𝔽—37 C◼F257◼𝔽—37◼_Operator—div(C◼F257◼𝔽—37 a, C◼F257◼𝔽—37 b)
Operation in the ring ℤn.
Definition: C-F257.c:11789
C◼F257◼𝔽—37 C◼F257◼𝔽—37◼_Operator—prod(C◼F257◼𝔽—37 a, C◼F257◼𝔽—37 b)
Operation in the ring ℤn.
Definition: C-F257.c:11783
C◼F257◼𝔽—37 C◼F257◼𝔽—37◼_Operator—sub(C◼F257◼𝔽—37 a, C◼F257◼𝔽—37 b)
Operation in the ring ℤn.
Definition: C-F257.c:11777
+ Here is the call graph for this function:

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

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

Test if non-zero in ℤn.

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

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

11805  {
11806 #line 135 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
11807  return ‼C◼F257◼𝔽—37◼_Operator—bnotbnot(a);
11808 }
+ Here is the caller graph for this function:

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

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

Operation in the ring ℤn.

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

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

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

11783  {
11784 #line 117 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
11785  C◼F257◼𝔽—37 ret = a * b;
11787 }
C◼F257◼𝔽—37 C◼F257◼𝔽—37◼_Operator—bnotbnot(C◼F257◼𝔽—37 a)
Map a into ℤn.
Definition: C-F257.c:11766
_Intern◼_I584Rsma◼C◼F257◼Z—37◼type₀ C◼F257◼𝔽—37
Definition: C-F257.c:11742
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

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

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

Operation in the ring ℤn.

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

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

11777  {
11778 #line 112 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
11779  C◼F257◼𝔽—37 ret = a + (_Intern◼_I584Rsma◼C◼F257◼Z—37◼mod₀ - b);
11781 }
C◼F257◼𝔽—37 C◼F257◼𝔽—37◼_Operator—bnotbnot(C◼F257◼𝔽—37 a)
Map a into ℤn.
Definition: C-F257.c:11766
_Intern◼_I584Rsma◼C◼F257◼Z—37◼type₀ C◼F257◼𝔽—37
Definition: C-F257.c:11742
+ Here is the caller graph for this function:

Variable Documentation

§ C◼F257◼generator—37

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