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

Typedef Documentation

§ C◼F257◼𝔽—61

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

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

Function Documentation

§ C◼F257◼order—61()

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

Compute the order of element .

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

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

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

10417  {
10418 #line 147 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
10419  if (¬(C◼F257◼𝔽—61◼_Operator—notnot(x ))) return 0;
10420  C◼F257◼𝔽—61 y = x;
10421  for (C◼F257◼𝔽—61 i = 1; i; ((i )=(C◼F257◼𝔽—61◼_Operator—add(i , 1)))) {
10422 #line 150 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
10423  if (C◼F257◼𝔽—61◼_Operator—eq(y , 1 )) return i;
10424  ((y )=(C◼F257◼𝔽—61◼_Operator—prod(y , x )));
10425  }
10426  // should not be reached
10427  return 0;
10428 }
_Intern◼_I584Rsma◼C◼F257◼Z—61◼type₀ C◼F257◼𝔽—61
Definition: C-F257.c:10338
C◼F257◼𝔽—61 C◼F257◼𝔽—61◼_Operator—notnot(C◼F257◼𝔽—61 a)
Test if non-zero in ℤn.
Definition: C-F257.c:10401
_Bool C◼F257◼𝔽—61◼_Operator—eq(C◼F257◼𝔽—61 a, C◼F257◼𝔽—61 b)
Equality in the ring ℤn.
Definition: C-F257.c:10396
C◼F257◼𝔽—61 C◼F257◼𝔽—61◼_Operator—add(C◼F257◼𝔽—61 a, C◼F257◼𝔽—61 b)
Operation in the ring ℤn.
Definition: C-F257.c:10367
C◼F257◼𝔽—61 C◼F257◼𝔽—61◼_Operator—prod(C◼F257◼𝔽—61 a, C◼F257◼𝔽—61 b)
Operation in the ring ℤn.
Definition: C-F257.c:10379
+ Here is the call graph for this function:

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

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

Operation in the ring ℤn.

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

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

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

10367  {
10368 #line 107 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
10369  C◼F257◼𝔽—61 ret = a + b;
10371 }
_Intern◼_I584Rsma◼C◼F257◼Z—61◼type₀ C◼F257◼𝔽—61
Definition: C-F257.c:10338
C◼F257◼𝔽—61 C◼F257◼𝔽—61◼_Operator—bnotbnot(C◼F257◼𝔽—61 a)
Map a into ℤn.
Definition: C-F257.c:10362
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

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

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

Map a into ℤn.

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

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

10362  {
10363 #line 103 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
10364  return a % _Intern◼_I584Rsma◼C◼F257◼Z—61◼mod₀;
10365 }
+ Here is the caller graph for this function:

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

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

Operation in the ring ℤn.

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

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

10385  {
10386 #line 122 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
10387  C◼F257◼𝔽—61 ret = a * _Intern◼_I584Rsma◼C◼F257◼Z—61◼inverse(b);
10389 }
_Intern◼_I584Rsma◼C◼F257◼Z—61◼type₀ C◼F257◼𝔽—61
Definition: C-F257.c:10338
C◼F257◼𝔽—61 C◼F257◼𝔽—61◼_Operator—bnotbnot(C◼F257◼𝔽—61 a)
Map a into ℤn.
Definition: C-F257.c:10362
+ Here is the caller graph for this function:

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

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

Equality in the ring ℤn.

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

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

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

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

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

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

Operation in the ring ℤn.

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

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

10391  {
10392 #line 127 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
10394 }
C◼F257◼𝔽—61 C◼F257◼𝔽—61◼_Operator—div(C◼F257◼𝔽—61 a, C◼F257◼𝔽—61 b)
Operation in the ring ℤn.
Definition: C-F257.c:10385
C◼F257◼𝔽—61 C◼F257◼𝔽—61◼_Operator—sub(C◼F257◼𝔽—61 a, C◼F257◼𝔽—61 b)
Operation in the ring ℤn.
Definition: C-F257.c:10373
C◼F257◼𝔽—61 C◼F257◼𝔽—61◼_Operator—prod(C◼F257◼𝔽—61 a, C◼F257◼𝔽—61 b)
Operation in the ring ℤn.
Definition: C-F257.c:10379
+ Here is the call graph for this function:

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

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

Test if non-zero in ℤn.

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

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

10401  {
10402 #line 135 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
10403  return ‼C◼F257◼𝔽—61◼_Operator—bnotbnot(a);
10404 }
+ Here is the caller graph for this function:

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

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

Operation in the ring ℤn.

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

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

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

10379  {
10380 #line 117 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
10381  C◼F257◼𝔽—61 ret = a * b;
10383 }
_Intern◼_I584Rsma◼C◼F257◼Z—61◼type₀ C◼F257◼𝔽—61
Definition: C-F257.c:10338
C◼F257◼𝔽—61 C◼F257◼𝔽—61◼_Operator—bnotbnot(C◼F257◼𝔽—61 a)
Map a into ℤn.
Definition: C-F257.c:10362
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

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

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

Operation in the ring ℤn.

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

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

10373  {
10374 #line 112 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
10375  C◼F257◼𝔽—61 ret = a + (_Intern◼_I584Rsma◼C◼F257◼Z—61◼mod₀ - b);
10377 }
_Intern◼_I584Rsma◼C◼F257◼Z—61◼type₀ C◼F257◼𝔽—61
Definition: C-F257.c:10338
C◼F257◼𝔽—61 C◼F257◼𝔽—61◼_Operator—bnotbnot(C◼F257◼𝔽—61 a)
Map a into ℤn.
Definition: C-F257.c:10362
+ Here is the caller graph for this function:

Variable Documentation

§ C◼F257◼generator—61

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