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

Typedef Documentation

§ C◼F257◼𝔽—113

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

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

Function Documentation

§ C◼F257◼order—113()

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

Compute the order of element .

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

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

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

7609  {
7610 #line 147 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
7611  if (¬(C◼F257◼𝔽—113◼_Operator—notnot(x ))) return 0;
7612  C◼F257◼𝔽—113 y = x;
7613  for (C◼F257◼𝔽—113 i = 1; i; ((i )=(C◼F257◼𝔽—113◼_Operator—add(i , 1)))) {
7614 #line 150 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
7615  if (C◼F257◼𝔽—113◼_Operator—eq(y , 1 )) return i;
7617  }
7618  // should not be reached
7619  return 0;
7620 }
_Intern◼_I584Rsma◼C◼F257◼Z—113◼type₀ C◼F257◼𝔽—113
Definition: C-F257.c:7530
C◼F257◼𝔽—113 C◼F257◼𝔽—113◼_Operator—add(C◼F257◼𝔽—113 a, C◼F257◼𝔽—113 b)
Operation in the ring ℤn.
Definition: C-F257.c:7559
_Bool C◼F257◼𝔽—113◼_Operator—eq(C◼F257◼𝔽—113 a, C◼F257◼𝔽—113 b)
Equality in the ring ℤn.
Definition: C-F257.c:7588
C◼F257◼𝔽—113 C◼F257◼𝔽—113◼_Operator—prod(C◼F257◼𝔽—113 a, C◼F257◼𝔽—113 b)
Operation in the ring ℤn.
Definition: C-F257.c:7571
C◼F257◼𝔽—113 C◼F257◼𝔽—113◼_Operator—notnot(C◼F257◼𝔽—113 a)
Test if non-zero in ℤn.
Definition: C-F257.c:7593
+ Here is the call graph for this function:

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

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

Operation in the ring ℤn.

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

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

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

7559  {
7560 #line 107 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
7561  C◼F257◼𝔽—113 ret = a + b;
7563 }
_Intern◼_I584Rsma◼C◼F257◼Z—113◼type₀ C◼F257◼𝔽—113
Definition: C-F257.c:7530
C◼F257◼𝔽—113 C◼F257◼𝔽—113◼_Operator—bnotbnot(C◼F257◼𝔽—113 a)
Map a into ℤn.
Definition: C-F257.c:7554
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

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

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

Map a into ℤn.

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

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

7554  {
7555 #line 103 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
7556  return a % _Intern◼_I584Rsma◼C◼F257◼Z—113◼mod₀;
7557 }
+ Here is the caller graph for this function:

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

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

Operation in the ring ℤn.

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

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

7577  {
7578 #line 122 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
7579  C◼F257◼𝔽—113 ret = a * _Intern◼_I584Rsma◼C◼F257◼Z—113◼inverse(b);
7581 }
_Intern◼_I584Rsma◼C◼F257◼Z—113◼type₀ C◼F257◼𝔽—113
Definition: C-F257.c:7530
C◼F257◼𝔽—113 C◼F257◼𝔽—113◼_Operator—bnotbnot(C◼F257◼𝔽—113 a)
Map a into ℤn.
Definition: C-F257.c:7554
+ Here is the caller graph for this function:

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

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

Equality in the ring ℤn.

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

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

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

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

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

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

Operation in the ring ℤn.

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

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

7583  {
7584 #line 127 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
7586 }
C◼F257◼𝔽—113 C◼F257◼𝔽—113◼_Operator—div(C◼F257◼𝔽—113 a, C◼F257◼𝔽—113 b)
Operation in the ring ℤn.
Definition: C-F257.c:7577
C◼F257◼𝔽—113 C◼F257◼𝔽—113◼_Operator—prod(C◼F257◼𝔽—113 a, C◼F257◼𝔽—113 b)
Operation in the ring ℤn.
Definition: C-F257.c:7571
C◼F257◼𝔽—113 C◼F257◼𝔽—113◼_Operator—sub(C◼F257◼𝔽—113 a, C◼F257◼𝔽—113 b)
Operation in the ring ℤn.
Definition: C-F257.c:7565
+ Here is the call graph for this function:

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

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

Test if non-zero in ℤn.

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

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

7593  {
7594 #line 135 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
7595  return ‼C◼F257◼𝔽—113◼_Operator—bnotbnot(a);
7596 }
+ Here is the caller graph for this function:

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

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

Operation in the ring ℤn.

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

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

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

7571  {
7572 #line 117 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
7573  C◼F257◼𝔽—113 ret = a * b;
7575 }
_Intern◼_I584Rsma◼C◼F257◼Z—113◼type₀ C◼F257◼𝔽—113
Definition: C-F257.c:7530
C◼F257◼𝔽—113 C◼F257◼𝔽—113◼_Operator—bnotbnot(C◼F257◼𝔽—113 a)
Map a into ℤn.
Definition: C-F257.c:7554
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

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

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

Operation in the ring ℤn.

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

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

7565  {
7566 #line 112 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
7567  C◼F257◼𝔽—113 ret = a + (_Intern◼_I584Rsma◼C◼F257◼Z—113◼mod₀ - b);
7569 }
_Intern◼_I584Rsma◼C◼F257◼Z—113◼type₀ C◼F257◼𝔽—113
Definition: C-F257.c:7530
C◼F257◼𝔽—113 C◼F257◼𝔽—113◼_Operator—bnotbnot(C◼F257◼𝔽—113 a)
Map a into ℤn.
Definition: C-F257.c:7554
+ Here is the caller graph for this function:

Variable Documentation

§ C◼F257◼generator—113

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