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

Typedef Documentation

§ C◼F257◼𝔽—137

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

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

Function Documentation

§ C◼F257◼order—137()

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

Compute the order of element .

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

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

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

6907  {
6908 #line 147 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
6909  if (¬(C◼F257◼𝔽—137◼_Operator—notnot(x ))) return 0;
6910  C◼F257◼𝔽—137 y = x;
6911  for (C◼F257◼𝔽—137 i = 1; i; ((i )=(C◼F257◼𝔽—137◼_Operator—add(i , 1)))) {
6912 #line 150 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
6913  if (C◼F257◼𝔽—137◼_Operator—eq(y , 1 )) return i;
6915  }
6916  // should not be reached
6917  return 0;
6918 }
_Bool C◼F257◼𝔽—137◼_Operator—eq(C◼F257◼𝔽—137 a, C◼F257◼𝔽—137 b)
Equality in the ring ℤn.
Definition: C-F257.c:6886
C◼F257◼𝔽—137 C◼F257◼𝔽—137◼_Operator—add(C◼F257◼𝔽—137 a, C◼F257◼𝔽—137 b)
Operation in the ring ℤn.
Definition: C-F257.c:6857
C◼F257◼𝔽—137 C◼F257◼𝔽—137◼_Operator—notnot(C◼F257◼𝔽—137 a)
Test if non-zero in ℤn.
Definition: C-F257.c:6891
_Intern◼_I584Rsma◼C◼F257◼Z—137◼type₀ C◼F257◼𝔽—137
Definition: C-F257.c:6828
C◼F257◼𝔽—137 C◼F257◼𝔽—137◼_Operator—prod(C◼F257◼𝔽—137 a, C◼F257◼𝔽—137 b)
Operation in the ring ℤn.
Definition: C-F257.c:6869
+ Here is the call graph for this function:

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

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

Operation in the ring ℤn.

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

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

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

6857  {
6858 #line 107 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
6859  C◼F257◼𝔽—137 ret = a + b;
6861 }
_Intern◼_I584Rsma◼C◼F257◼Z—137◼type₀ C◼F257◼𝔽—137
Definition: C-F257.c:6828
C◼F257◼𝔽—137 C◼F257◼𝔽—137◼_Operator—bnotbnot(C◼F257◼𝔽—137 a)
Map a into ℤn.
Definition: C-F257.c:6852
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

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

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

Map a into ℤn.

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

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

6852  {
6853 #line 103 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
6854  return a % _Intern◼_I584Rsma◼C◼F257◼Z—137◼mod₀;
6855 }
+ Here is the caller graph for this function:

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

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

Operation in the ring ℤn.

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

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

6875  {
6876 #line 122 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
6877  C◼F257◼𝔽—137 ret = a * _Intern◼_I584Rsma◼C◼F257◼Z—137◼inverse(b);
6879 }
_Intern◼_I584Rsma◼C◼F257◼Z—137◼type₀ C◼F257◼𝔽—137
Definition: C-F257.c:6828
C◼F257◼𝔽—137 C◼F257◼𝔽—137◼_Operator—bnotbnot(C◼F257◼𝔽—137 a)
Map a into ℤn.
Definition: C-F257.c:6852
+ Here is the caller graph for this function:

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

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

Equality in the ring ℤn.

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

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

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

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

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

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

Operation in the ring ℤn.

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

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

6881  {
6882 #line 127 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
6884 }
C◼F257◼𝔽—137 C◼F257◼𝔽—137◼_Operator—div(C◼F257◼𝔽—137 a, C◼F257◼𝔽—137 b)
Operation in the ring ℤn.
Definition: C-F257.c:6875
C◼F257◼𝔽—137 C◼F257◼𝔽—137◼_Operator—sub(C◼F257◼𝔽—137 a, C◼F257◼𝔽—137 b)
Operation in the ring ℤn.
Definition: C-F257.c:6863
C◼F257◼𝔽—137 C◼F257◼𝔽—137◼_Operator—prod(C◼F257◼𝔽—137 a, C◼F257◼𝔽—137 b)
Operation in the ring ℤn.
Definition: C-F257.c:6869
+ Here is the call graph for this function:

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

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

Test if non-zero in ℤn.

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

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

6891  {
6892 #line 135 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
6893  return ‼C◼F257◼𝔽—137◼_Operator—bnotbnot(a);
6894 }
+ Here is the caller graph for this function:

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

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

Operation in the ring ℤn.

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

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

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

6869  {
6870 #line 117 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
6871  C◼F257◼𝔽—137 ret = a * b;
6873 }
_Intern◼_I584Rsma◼C◼F257◼Z—137◼type₀ C◼F257◼𝔽—137
Definition: C-F257.c:6828
C◼F257◼𝔽—137 C◼F257◼𝔽—137◼_Operator—bnotbnot(C◼F257◼𝔽—137 a)
Map a into ℤn.
Definition: C-F257.c:6852
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

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

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

Operation in the ring ℤn.

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

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

6863  {
6864 #line 112 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
6865  C◼F257◼𝔽—137 ret = a + (_Intern◼_I584Rsma◼C◼F257◼Z—137◼mod₀ - b);
6867 }
_Intern◼_I584Rsma◼C◼F257◼Z—137◼type₀ C◼F257◼𝔽—137
Definition: C-F257.c:6828
C◼F257◼𝔽—137 C◼F257◼𝔽—137◼_Operator—bnotbnot(C◼F257◼𝔽—137 a)
Map a into ℤn.
Definition: C-F257.c:6852
+ Here is the caller graph for this function:

Variable Documentation

§ C◼F257◼generator—137

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