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

Typedef Documentation

§ C◼F257◼𝔽—193

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

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

Function Documentation

§ C◼F257◼order—193()

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

Compute the order of element .

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

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

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

4333  {
4334 #line 147 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
4335  if (¬(C◼F257◼𝔽—193◼_Operator—notnot(x ))) return 0;
4336  C◼F257◼𝔽—193 y = x;
4337  for (C◼F257◼𝔽—193 i = 1; i; ((i )=(C◼F257◼𝔽—193◼_Operator—add(i , 1)))) {
4338 #line 150 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
4339  if (C◼F257◼𝔽—193◼_Operator—eq(y , 1 )) return i;
4341  }
4342  // should not be reached
4343  return 0;
4344 }
_Intern◼_I584Rsma◼C◼F257◼Z—193◼type₀ C◼F257◼𝔽—193
Definition: C-F257.c:4254
C◼F257◼𝔽—193 C◼F257◼𝔽—193◼_Operator—add(C◼F257◼𝔽—193 a, C◼F257◼𝔽—193 b)
Operation in the ring ℤn.
Definition: C-F257.c:4283
C◼F257◼𝔽—193 C◼F257◼𝔽—193◼_Operator—notnot(C◼F257◼𝔽—193 a)
Test if non-zero in ℤn.
Definition: C-F257.c:4317
C◼F257◼𝔽—193 C◼F257◼𝔽—193◼_Operator—prod(C◼F257◼𝔽—193 a, C◼F257◼𝔽—193 b)
Operation in the ring ℤn.
Definition: C-F257.c:4295
_Bool C◼F257◼𝔽—193◼_Operator—eq(C◼F257◼𝔽—193 a, C◼F257◼𝔽—193 b)
Equality in the ring ℤn.
Definition: C-F257.c:4312
+ Here is the call graph for this function:

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

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

Operation in the ring ℤn.

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

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

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

4283  {
4284 #line 107 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
4285  C◼F257◼𝔽—193 ret = a + b;
4287 }
_Intern◼_I584Rsma◼C◼F257◼Z—193◼type₀ C◼F257◼𝔽—193
Definition: C-F257.c:4254
C◼F257◼𝔽—193 C◼F257◼𝔽—193◼_Operator—bnotbnot(C◼F257◼𝔽—193 a)
Map a into ℤn.
Definition: C-F257.c:4278
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

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

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

Map a into ℤn.

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

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

4278  {
4279 #line 103 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
4280  return a % _Intern◼_I584Rsma◼C◼F257◼Z—193◼mod₀;
4281 }
+ Here is the caller graph for this function:

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

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

Operation in the ring ℤn.

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

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

4301  {
4302 #line 122 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
4303  C◼F257◼𝔽—193 ret = a * _Intern◼_I584Rsma◼C◼F257◼Z—193◼inverse(b);
4305 }
_Intern◼_I584Rsma◼C◼F257◼Z—193◼type₀ C◼F257◼𝔽—193
Definition: C-F257.c:4254
C◼F257◼𝔽—193 C◼F257◼𝔽—193◼_Operator—bnotbnot(C◼F257◼𝔽—193 a)
Map a into ℤn.
Definition: C-F257.c:4278
+ Here is the caller graph for this function:

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

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

Equality in the ring ℤn.

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

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

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

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

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

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

Operation in the ring ℤn.

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

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

4307  {
4308 #line 127 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
4310 }
C◼F257◼𝔽—193 C◼F257◼𝔽—193◼_Operator—sub(C◼F257◼𝔽—193 a, C◼F257◼𝔽—193 b)
Operation in the ring ℤn.
Definition: C-F257.c:4289
C◼F257◼𝔽—193 C◼F257◼𝔽—193◼_Operator—div(C◼F257◼𝔽—193 a, C◼F257◼𝔽—193 b)
Operation in the ring ℤn.
Definition: C-F257.c:4301
C◼F257◼𝔽—193 C◼F257◼𝔽—193◼_Operator—prod(C◼F257◼𝔽—193 a, C◼F257◼𝔽—193 b)
Operation in the ring ℤn.
Definition: C-F257.c:4295
+ Here is the call graph for this function:

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

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

Test if non-zero in ℤn.

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

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

4317  {
4318 #line 135 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
4319  return ‼C◼F257◼𝔽—193◼_Operator—bnotbnot(a);
4320 }
+ Here is the caller graph for this function:

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

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

Operation in the ring ℤn.

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

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

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

4295  {
4296 #line 117 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
4297  C◼F257◼𝔽—193 ret = a * b;
4299 }
_Intern◼_I584Rsma◼C◼F257◼Z—193◼type₀ C◼F257◼𝔽—193
Definition: C-F257.c:4254
C◼F257◼𝔽—193 C◼F257◼𝔽—193◼_Operator—bnotbnot(C◼F257◼𝔽—193 a)
Map a into ℤn.
Definition: C-F257.c:4278
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

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

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

Operation in the ring ℤn.

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

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

4289  {
4290 #line 112 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
4291  C◼F257◼𝔽—193 ret = a + (_Intern◼_I584Rsma◼C◼F257◼Z—193◼mod₀ - b);
4293 }
_Intern◼_I584Rsma◼C◼F257◼Z—193◼type₀ C◼F257◼𝔽—193
Definition: C-F257.c:4254
C◼F257◼𝔽—193 C◼F257◼𝔽—193◼_Operator—bnotbnot(C◼F257◼𝔽—193 a)
Map a into ℤn.
Definition: C-F257.c:4278
+ Here is the caller graph for this function:

Variable Documentation

§ C◼F257◼generator—193

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