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

Typedef Documentation

§ C◼F257◼𝔽—131

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

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

Function Documentation

§ C◼F257◼order—131()

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

Compute the order of element .

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

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

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

7141  {
7142 #line 147 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
7143  if (¬(C◼F257◼𝔽—131◼_Operator—notnot(x ))) return 0;
7144  C◼F257◼𝔽—131 y = x;
7145  for (C◼F257◼𝔽—131 i = 1; i; ((i )=(C◼F257◼𝔽—131◼_Operator—add(i , 1)))) {
7146 #line 150 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
7147  if (C◼F257◼𝔽—131◼_Operator—eq(y , 1 )) return i;
7149  }
7150  // should not be reached
7151  return 0;
7152 }
C◼F257◼𝔽—131 C◼F257◼𝔽—131◼_Operator—notnot(C◼F257◼𝔽—131 a)
Test if non-zero in ℤn.
Definition: C-F257.c:7125
C◼F257◼𝔽—131 C◼F257◼𝔽—131◼_Operator—prod(C◼F257◼𝔽—131 a, C◼F257◼𝔽—131 b)
Operation in the ring ℤn.
Definition: C-F257.c:7103
C◼F257◼𝔽—131 C◼F257◼𝔽—131◼_Operator—add(C◼F257◼𝔽—131 a, C◼F257◼𝔽—131 b)
Operation in the ring ℤn.
Definition: C-F257.c:7091
_Intern◼_I584Rsma◼C◼F257◼Z—131◼type₀ C◼F257◼𝔽—131
Definition: C-F257.c:7062
_Bool C◼F257◼𝔽—131◼_Operator—eq(C◼F257◼𝔽—131 a, C◼F257◼𝔽—131 b)
Equality in the ring ℤn.
Definition: C-F257.c:7120
+ Here is the call graph for this function:

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

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

Operation in the ring ℤn.

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

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

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

7091  {
7092 #line 107 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
7093  C◼F257◼𝔽—131 ret = a + b;
7095 }
C◼F257◼𝔽—131 C◼F257◼𝔽—131◼_Operator—bnotbnot(C◼F257◼𝔽—131 a)
Map a into ℤn.
Definition: C-F257.c:7086
_Intern◼_I584Rsma◼C◼F257◼Z—131◼type₀ C◼F257◼𝔽—131
Definition: C-F257.c:7062
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

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

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

Map a into ℤn.

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

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

7086  {
7087 #line 103 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
7088  return a % _Intern◼_I584Rsma◼C◼F257◼Z—131◼mod₀;
7089 }
+ Here is the caller graph for this function:

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

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

Operation in the ring ℤn.

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

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

7109  {
7110 #line 122 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
7111  C◼F257◼𝔽—131 ret = a * _Intern◼_I584Rsma◼C◼F257◼Z—131◼inverse(b);
7113 }
C◼F257◼𝔽—131 C◼F257◼𝔽—131◼_Operator—bnotbnot(C◼F257◼𝔽—131 a)
Map a into ℤn.
Definition: C-F257.c:7086
_Intern◼_I584Rsma◼C◼F257◼Z—131◼type₀ C◼F257◼𝔽—131
Definition: C-F257.c:7062
+ Here is the caller graph for this function:

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

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

Equality in the ring ℤn.

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

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

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

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

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

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

Operation in the ring ℤn.

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

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

7115  {
7116 #line 127 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
7118 }
C◼F257◼𝔽—131 C◼F257◼𝔽—131◼_Operator—sub(C◼F257◼𝔽—131 a, C◼F257◼𝔽—131 b)
Operation in the ring ℤn.
Definition: C-F257.c:7097
C◼F257◼𝔽—131 C◼F257◼𝔽—131◼_Operator—prod(C◼F257◼𝔽—131 a, C◼F257◼𝔽—131 b)
Operation in the ring ℤn.
Definition: C-F257.c:7103
C◼F257◼𝔽—131 C◼F257◼𝔽—131◼_Operator—div(C◼F257◼𝔽—131 a, C◼F257◼𝔽—131 b)
Operation in the ring ℤn.
Definition: C-F257.c:7109
+ Here is the call graph for this function:

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

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

Test if non-zero in ℤn.

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

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

7125  {
7126 #line 135 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
7127  return ‼C◼F257◼𝔽—131◼_Operator—bnotbnot(a);
7128 }
+ Here is the caller graph for this function:

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

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

Operation in the ring ℤn.

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

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

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

7103  {
7104 #line 117 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
7105  C◼F257◼𝔽—131 ret = a * b;
7107 }
C◼F257◼𝔽—131 C◼F257◼𝔽—131◼_Operator—bnotbnot(C◼F257◼𝔽—131 a)
Map a into ℤn.
Definition: C-F257.c:7086
_Intern◼_I584Rsma◼C◼F257◼Z—131◼type₀ C◼F257◼𝔽—131
Definition: C-F257.c:7062
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

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

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

Operation in the ring ℤn.

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

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

7097  {
7098 #line 112 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
7099  C◼F257◼𝔽—131 ret = a + (_Intern◼_I584Rsma◼C◼F257◼Z—131◼mod₀ - b);
7101 }
C◼F257◼𝔽—131 C◼F257◼𝔽—131◼_Operator—bnotbnot(C◼F257◼𝔽—131 a)
Map a into ℤn.
Definition: C-F257.c:7086
_Intern◼_I584Rsma◼C◼F257◼Z—131◼type₀ C◼F257◼𝔽—131
Definition: C-F257.c:7062
+ Here is the caller graph for this function:

Variable Documentation

§ C◼F257◼generator—131

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