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

Typedef Documentation

§ C◼F257◼𝔽—157

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

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

Function Documentation

§ C◼F257◼order—157()

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

Compute the order of element .

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

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

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

5971  {
5972 #line 147 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
5973  if (¬(C◼F257◼𝔽—157◼_Operator—notnot(x ))) return 0;
5974  C◼F257◼𝔽—157 y = x;
5975  for (C◼F257◼𝔽—157 i = 1; i; ((i )=(C◼F257◼𝔽—157◼_Operator—add(i , 1)))) {
5976 #line 150 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
5977  if (C◼F257◼𝔽—157◼_Operator—eq(y , 1 )) return i;
5979  }
5980  // should not be reached
5981  return 0;
5982 }
C◼F257◼𝔽—157 C◼F257◼𝔽—157◼_Operator—notnot(C◼F257◼𝔽—157 a)
Test if non-zero in ℤn.
Definition: C-F257.c:5955
_Bool C◼F257◼𝔽—157◼_Operator—eq(C◼F257◼𝔽—157 a, C◼F257◼𝔽—157 b)
Equality in the ring ℤn.
Definition: C-F257.c:5950
C◼F257◼𝔽—157 C◼F257◼𝔽—157◼_Operator—add(C◼F257◼𝔽—157 a, C◼F257◼𝔽—157 b)
Operation in the ring ℤn.
Definition: C-F257.c:5921
C◼F257◼𝔽—157 C◼F257◼𝔽—157◼_Operator—prod(C◼F257◼𝔽—157 a, C◼F257◼𝔽—157 b)
Operation in the ring ℤn.
Definition: C-F257.c:5933
_Intern◼_I584Rsma◼C◼F257◼Z—157◼type₀ C◼F257◼𝔽—157
Definition: C-F257.c:5892
+ Here is the call graph for this function:

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

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

Operation in the ring ℤn.

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

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

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

5921  {
5922 #line 107 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
5923  C◼F257◼𝔽—157 ret = a + b;
5925 }
C◼F257◼𝔽—157 C◼F257◼𝔽—157◼_Operator—bnotbnot(C◼F257◼𝔽—157 a)
Map a into ℤn.
Definition: C-F257.c:5916
_Intern◼_I584Rsma◼C◼F257◼Z—157◼type₀ C◼F257◼𝔽—157
Definition: C-F257.c:5892
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

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

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

Map a into ℤn.

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

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

5916  {
5917 #line 103 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
5918  return a % _Intern◼_I584Rsma◼C◼F257◼Z—157◼mod₀;
5919 }
+ Here is the caller graph for this function:

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

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

Operation in the ring ℤn.

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

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

5939  {
5940 #line 122 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
5941  C◼F257◼𝔽—157 ret = a * _Intern◼_I584Rsma◼C◼F257◼Z—157◼inverse(b);
5943 }
C◼F257◼𝔽—157 C◼F257◼𝔽—157◼_Operator—bnotbnot(C◼F257◼𝔽—157 a)
Map a into ℤn.
Definition: C-F257.c:5916
_Intern◼_I584Rsma◼C◼F257◼Z—157◼type₀ C◼F257◼𝔽—157
Definition: C-F257.c:5892
+ Here is the caller graph for this function:

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

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

Equality in the ring ℤn.

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

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

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

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

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

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

Operation in the ring ℤn.

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

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

5945  {
5946 #line 127 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
5948 }
C◼F257◼𝔽—157 C◼F257◼𝔽—157◼_Operator—div(C◼F257◼𝔽—157 a, C◼F257◼𝔽—157 b)
Operation in the ring ℤn.
Definition: C-F257.c:5939
C◼F257◼𝔽—157 C◼F257◼𝔽—157◼_Operator—prod(C◼F257◼𝔽—157 a, C◼F257◼𝔽—157 b)
Operation in the ring ℤn.
Definition: C-F257.c:5933
C◼F257◼𝔽—157 C◼F257◼𝔽—157◼_Operator—sub(C◼F257◼𝔽—157 a, C◼F257◼𝔽—157 b)
Operation in the ring ℤn.
Definition: C-F257.c:5927
+ Here is the call graph for this function:

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

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

Test if non-zero in ℤn.

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

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

5955  {
5956 #line 135 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
5957  return ‼C◼F257◼𝔽—157◼_Operator—bnotbnot(a);
5958 }
+ Here is the caller graph for this function:

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

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

Operation in the ring ℤn.

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

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

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

5933  {
5934 #line 117 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
5935  C◼F257◼𝔽—157 ret = a * b;
5937 }
C◼F257◼𝔽—157 C◼F257◼𝔽—157◼_Operator—bnotbnot(C◼F257◼𝔽—157 a)
Map a into ℤn.
Definition: C-F257.c:5916
_Intern◼_I584Rsma◼C◼F257◼Z—157◼type₀ C◼F257◼𝔽—157
Definition: C-F257.c:5892
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

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

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

Operation in the ring ℤn.

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

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

5927  {
5928 #line 112 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
5929  C◼F257◼𝔽—157 ret = a + (_Intern◼_I584Rsma◼C◼F257◼Z—157◼mod₀ - b);
5931 }
C◼F257◼𝔽—157 C◼F257◼𝔽—157◼_Operator—bnotbnot(C◼F257◼𝔽—157 a)
Map a into ℤn.
Definition: C-F257.c:5916
_Intern◼_I584Rsma◼C◼F257◼Z—157◼type₀ C◼F257◼𝔽—157
Definition: C-F257.c:5892
+ Here is the caller graph for this function:

Variable Documentation

§ C◼F257◼generator—157

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