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

Typedef Documentation

§ C◼F257◼𝔽—179

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

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

Function Documentation

§ C◼F257◼order—179()

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

Compute the order of element .

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

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

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

5035  {
5036 #line 147 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
5037  if (¬(C◼F257◼𝔽—179◼_Operator—notnot(x ))) return 0;
5038  C◼F257◼𝔽—179 y = x;
5039  for (C◼F257◼𝔽—179 i = 1; i; ((i )=(C◼F257◼𝔽—179◼_Operator—add(i , 1)))) {
5040 #line 150 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
5041  if (C◼F257◼𝔽—179◼_Operator—eq(y , 1 )) return i;
5043  }
5044  // should not be reached
5045  return 0;
5046 }
_Intern◼_I584Rsma◼C◼F257◼Z—179◼type₀ C◼F257◼𝔽—179
Definition: C-F257.c:4956
C◼F257◼𝔽—179 C◼F257◼𝔽—179◼_Operator—notnot(C◼F257◼𝔽—179 a)
Test if non-zero in ℤn.
Definition: C-F257.c:5019
C◼F257◼𝔽—179 C◼F257◼𝔽—179◼_Operator—add(C◼F257◼𝔽—179 a, C◼F257◼𝔽—179 b)
Operation in the ring ℤn.
Definition: C-F257.c:4985
C◼F257◼𝔽—179 C◼F257◼𝔽—179◼_Operator—prod(C◼F257◼𝔽—179 a, C◼F257◼𝔽—179 b)
Operation in the ring ℤn.
Definition: C-F257.c:4997
_Bool C◼F257◼𝔽—179◼_Operator—eq(C◼F257◼𝔽—179 a, C◼F257◼𝔽—179 b)
Equality in the ring ℤn.
Definition: C-F257.c:5014
+ Here is the call graph for this function:

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

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

Operation in the ring ℤn.

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

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

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

4985  {
4986 #line 107 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
4987  C◼F257◼𝔽—179 ret = a + b;
4989 }
_Intern◼_I584Rsma◼C◼F257◼Z—179◼type₀ C◼F257◼𝔽—179
Definition: C-F257.c:4956
C◼F257◼𝔽—179 C◼F257◼𝔽—179◼_Operator—bnotbnot(C◼F257◼𝔽—179 a)
Map a into ℤn.
Definition: C-F257.c:4980
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

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

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

Map a into ℤn.

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

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

4980  {
4981 #line 103 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
4982  return a % _Intern◼_I584Rsma◼C◼F257◼Z—179◼mod₀;
4983 }
+ Here is the caller graph for this function:

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

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

Operation in the ring ℤn.

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

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

5003  {
5004 #line 122 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
5005  C◼F257◼𝔽—179 ret = a * _Intern◼_I584Rsma◼C◼F257◼Z—179◼inverse(b);
5007 }
_Intern◼_I584Rsma◼C◼F257◼Z—179◼type₀ C◼F257◼𝔽—179
Definition: C-F257.c:4956
C◼F257◼𝔽—179 C◼F257◼𝔽—179◼_Operator—bnotbnot(C◼F257◼𝔽—179 a)
Map a into ℤn.
Definition: C-F257.c:4980
+ Here is the caller graph for this function:

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

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

Equality in the ring ℤn.

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

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

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

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

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

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

Operation in the ring ℤn.

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

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

5009  {
5010 #line 127 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
5012 }
C◼F257◼𝔽—179 C◼F257◼𝔽—179◼_Operator—prod(C◼F257◼𝔽—179 a, C◼F257◼𝔽—179 b)
Operation in the ring ℤn.
Definition: C-F257.c:4997
C◼F257◼𝔽—179 C◼F257◼𝔽—179◼_Operator—sub(C◼F257◼𝔽—179 a, C◼F257◼𝔽—179 b)
Operation in the ring ℤn.
Definition: C-F257.c:4991
C◼F257◼𝔽—179 C◼F257◼𝔽—179◼_Operator—div(C◼F257◼𝔽—179 a, C◼F257◼𝔽—179 b)
Operation in the ring ℤn.
Definition: C-F257.c:5003
+ Here is the call graph for this function:

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

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

Test if non-zero in ℤn.

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

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

5019  {
5020 #line 135 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
5021  return ‼C◼F257◼𝔽—179◼_Operator—bnotbnot(a);
5022 }
+ Here is the caller graph for this function:

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

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

Operation in the ring ℤn.

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

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

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

4997  {
4998 #line 117 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
4999  C◼F257◼𝔽—179 ret = a * b;
5001 }
_Intern◼_I584Rsma◼C◼F257◼Z—179◼type₀ C◼F257◼𝔽—179
Definition: C-F257.c:4956
C◼F257◼𝔽—179 C◼F257◼𝔽—179◼_Operator—bnotbnot(C◼F257◼𝔽—179 a)
Map a into ℤn.
Definition: C-F257.c:4980
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

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

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

Operation in the ring ℤn.

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

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

4991  {
4992 #line 112 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
4993  C◼F257◼𝔽—179 ret = a + (_Intern◼_I584Rsma◼C◼F257◼Z—179◼mod₀ - b);
4995 }
_Intern◼_I584Rsma◼C◼F257◼Z—179◼type₀ C◼F257◼𝔽—179
Definition: C-F257.c:4956
C◼F257◼𝔽—179 C◼F257◼𝔽—179◼_Operator—bnotbnot(C◼F257◼𝔽—179 a)
Map a into ℤn.
Definition: C-F257.c:4980
+ Here is the caller graph for this function:

Variable Documentation

§ C◼F257◼generator—179

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