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

Typedef Documentation

§ C◼F257◼𝔽—197

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

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

Function Documentation

§ C◼F257◼order—197()

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

Compute the order of element .

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

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

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

4099  {
4100 #line 147 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
4101  if (¬(C◼F257◼𝔽—197◼_Operator—notnot(x ))) return 0;
4102  C◼F257◼𝔽—197 y = x;
4103  for (C◼F257◼𝔽—197 i = 1; i; ((i )=(C◼F257◼𝔽—197◼_Operator—add(i , 1)))) {
4104 #line 150 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
4105  if (C◼F257◼𝔽—197◼_Operator—eq(y , 1 )) return i;
4107  }
4108  // should not be reached
4109  return 0;
4110 }
C◼F257◼𝔽—197 C◼F257◼𝔽—197◼_Operator—notnot(C◼F257◼𝔽—197 a)
Test if non-zero in ℤn.
Definition: C-F257.c:4083
C◼F257◼𝔽—197 C◼F257◼𝔽—197◼_Operator—prod(C◼F257◼𝔽—197 a, C◼F257◼𝔽—197 b)
Operation in the ring ℤn.
Definition: C-F257.c:4061
C◼F257◼𝔽—197 C◼F257◼𝔽—197◼_Operator—add(C◼F257◼𝔽—197 a, C◼F257◼𝔽—197 b)
Operation in the ring ℤn.
Definition: C-F257.c:4049
_Bool C◼F257◼𝔽—197◼_Operator—eq(C◼F257◼𝔽—197 a, C◼F257◼𝔽—197 b)
Equality in the ring ℤn.
Definition: C-F257.c:4078
_Intern◼_I584Rsma◼C◼F257◼Z—197◼type₀ C◼F257◼𝔽—197
Definition: C-F257.c:4020
+ Here is the call graph for this function:

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

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

Operation in the ring ℤn.

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

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

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

4049  {
4050 #line 107 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
4051  C◼F257◼𝔽—197 ret = a + b;
4053 }
C◼F257◼𝔽—197 C◼F257◼𝔽—197◼_Operator—bnotbnot(C◼F257◼𝔽—197 a)
Map a into ℤn.
Definition: C-F257.c:4044
_Intern◼_I584Rsma◼C◼F257◼Z—197◼type₀ C◼F257◼𝔽—197
Definition: C-F257.c:4020
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

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

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

Map a into ℤn.

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

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

4044  {
4045 #line 103 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
4046  return a % _Intern◼_I584Rsma◼C◼F257◼Z—197◼mod₀;
4047 }
+ Here is the caller graph for this function:

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

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

Operation in the ring ℤn.

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

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

4067  {
4068 #line 122 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
4069  C◼F257◼𝔽—197 ret = a * _Intern◼_I584Rsma◼C◼F257◼Z—197◼inverse(b);
4071 }
C◼F257◼𝔽—197 C◼F257◼𝔽—197◼_Operator—bnotbnot(C◼F257◼𝔽—197 a)
Map a into ℤn.
Definition: C-F257.c:4044
_Intern◼_I584Rsma◼C◼F257◼Z—197◼type₀ C◼F257◼𝔽—197
Definition: C-F257.c:4020
+ Here is the caller graph for this function:

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

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

Equality in the ring ℤn.

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

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

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

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

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

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

Operation in the ring ℤn.

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

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

4073  {
4074 #line 127 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
4076 }
C◼F257◼𝔽—197 C◼F257◼𝔽—197◼_Operator—sub(C◼F257◼𝔽—197 a, C◼F257◼𝔽—197 b)
Operation in the ring ℤn.
Definition: C-F257.c:4055
C◼F257◼𝔽—197 C◼F257◼𝔽—197◼_Operator—prod(C◼F257◼𝔽—197 a, C◼F257◼𝔽—197 b)
Operation in the ring ℤn.
Definition: C-F257.c:4061
C◼F257◼𝔽—197 C◼F257◼𝔽—197◼_Operator—div(C◼F257◼𝔽—197 a, C◼F257◼𝔽—197 b)
Operation in the ring ℤn.
Definition: C-F257.c:4067
+ Here is the call graph for this function:

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

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

Test if non-zero in ℤn.

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

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

4083  {
4084 #line 135 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
4085  return ‼C◼F257◼𝔽—197◼_Operator—bnotbnot(a);
4086 }
+ Here is the caller graph for this function:

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

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

Operation in the ring ℤn.

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

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

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

4061  {
4062 #line 117 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
4063  C◼F257◼𝔽—197 ret = a * b;
4065 }
C◼F257◼𝔽—197 C◼F257◼𝔽—197◼_Operator—bnotbnot(C◼F257◼𝔽—197 a)
Map a into ℤn.
Definition: C-F257.c:4044
_Intern◼_I584Rsma◼C◼F257◼Z—197◼type₀ C◼F257◼𝔽—197
Definition: C-F257.c:4020
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

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

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

Operation in the ring ℤn.

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

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

4055  {
4056 #line 112 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
4057  C◼F257◼𝔽—197 ret = a + (_Intern◼_I584Rsma◼C◼F257◼Z—197◼mod₀ - b);
4059 }
C◼F257◼𝔽—197 C◼F257◼𝔽—197◼_Operator—bnotbnot(C◼F257◼𝔽—197 a)
Map a into ℤn.
Definition: C-F257.c:4044
_Intern◼_I584Rsma◼C◼F257◼Z—197◼type₀ C◼F257◼𝔽—197
Definition: C-F257.c:4020
+ Here is the caller graph for this function:

Variable Documentation

§ C◼F257◼generator—197

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