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

Typedef Documentation

§ C◼F257◼𝔽—53

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

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

Function Documentation

§ C◼F257◼order—53()

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

Compute the order of element .

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

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

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

10885  {
10886 #line 147 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
10887  if (¬(C◼F257◼𝔽—53◼_Operator—notnot(x ))) return 0;
10888  C◼F257◼𝔽—53 y = x;
10889  for (C◼F257◼𝔽—53 i = 1; i; ((i )=(C◼F257◼𝔽—53◼_Operator—add(i , 1)))) {
10890 #line 150 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
10891  if (C◼F257◼𝔽—53◼_Operator—eq(y , 1 )) return i;
10892  ((y )=(C◼F257◼𝔽—53◼_Operator—prod(y , x )));
10893  }
10894  // should not be reached
10895  return 0;
10896 }
C◼F257◼𝔽—53 C◼F257◼𝔽—53◼_Operator—add(C◼F257◼𝔽—53 a, C◼F257◼𝔽—53 b)
Operation in the ring ℤn.
Definition: C-F257.c:10835
C◼F257◼𝔽—53 C◼F257◼𝔽—53◼_Operator—notnot(C◼F257◼𝔽—53 a)
Test if non-zero in ℤn.
Definition: C-F257.c:10869
C◼F257◼𝔽—53 C◼F257◼𝔽—53◼_Operator—prod(C◼F257◼𝔽—53 a, C◼F257◼𝔽—53 b)
Operation in the ring ℤn.
Definition: C-F257.c:10847
_Intern◼_I584Rsma◼C◼F257◼Z—53◼type₀ C◼F257◼𝔽—53
Definition: C-F257.c:10806
_Bool C◼F257◼𝔽—53◼_Operator—eq(C◼F257◼𝔽—53 a, C◼F257◼𝔽—53 b)
Equality in the ring ℤn.
Definition: C-F257.c:10864
+ Here is the call graph for this function:

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

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

Operation in the ring ℤn.

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

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

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

10835  {
10836 #line 107 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
10837  C◼F257◼𝔽—53 ret = a + b;
10839 }
C◼F257◼𝔽—53 C◼F257◼𝔽—53◼_Operator—bnotbnot(C◼F257◼𝔽—53 a)
Map a into ℤn.
Definition: C-F257.c:10830
_Intern◼_I584Rsma◼C◼F257◼Z—53◼type₀ C◼F257◼𝔽—53
Definition: C-F257.c:10806
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

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

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

Map a into ℤn.

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

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

10830  {
10831 #line 103 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
10832  return a % _Intern◼_I584Rsma◼C◼F257◼Z—53◼mod₀;
10833 }
+ Here is the caller graph for this function:

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

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

Operation in the ring ℤn.

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

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

10853  {
10854 #line 122 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
10855  C◼F257◼𝔽—53 ret = a * _Intern◼_I584Rsma◼C◼F257◼Z—53◼inverse(b);
10857 }
C◼F257◼𝔽—53 C◼F257◼𝔽—53◼_Operator—bnotbnot(C◼F257◼𝔽—53 a)
Map a into ℤn.
Definition: C-F257.c:10830
_Intern◼_I584Rsma◼C◼F257◼Z—53◼type₀ C◼F257◼𝔽—53
Definition: C-F257.c:10806
+ Here is the caller graph for this function:

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

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

Equality in the ring ℤn.

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

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

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

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

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

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

Operation in the ring ℤn.

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

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

10859  {
10860 #line 127 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
10862 }
C◼F257◼𝔽—53 C◼F257◼𝔽—53◼_Operator—prod(C◼F257◼𝔽—53 a, C◼F257◼𝔽—53 b)
Operation in the ring ℤn.
Definition: C-F257.c:10847
C◼F257◼𝔽—53 C◼F257◼𝔽—53◼_Operator—sub(C◼F257◼𝔽—53 a, C◼F257◼𝔽—53 b)
Operation in the ring ℤn.
Definition: C-F257.c:10841
C◼F257◼𝔽—53 C◼F257◼𝔽—53◼_Operator—div(C◼F257◼𝔽—53 a, C◼F257◼𝔽—53 b)
Operation in the ring ℤn.
Definition: C-F257.c:10853
+ Here is the call graph for this function:

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

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

Test if non-zero in ℤn.

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

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

10869  {
10870 #line 135 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
10871  return ‼C◼F257◼𝔽—53◼_Operator—bnotbnot(a);
10872 }
+ Here is the caller graph for this function:

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

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

Operation in the ring ℤn.

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

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

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

10847  {
10848 #line 117 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
10849  C◼F257◼𝔽—53 ret = a * b;
10851 }
C◼F257◼𝔽—53 C◼F257◼𝔽—53◼_Operator—bnotbnot(C◼F257◼𝔽—53 a)
Map a into ℤn.
Definition: C-F257.c:10830
_Intern◼_I584Rsma◼C◼F257◼Z—53◼type₀ C◼F257◼𝔽—53
Definition: C-F257.c:10806
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

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

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

Operation in the ring ℤn.

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

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

10841  {
10842 #line 112 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
10843  C◼F257◼𝔽—53 ret = a + (_Intern◼_I584Rsma◼C◼F257◼Z—53◼mod₀ - b);
10845 }
C◼F257◼𝔽—53 C◼F257◼𝔽—53◼_Operator—bnotbnot(C◼F257◼𝔽—53 a)
Map a into ℤn.
Definition: C-F257.c:10830
_Intern◼_I584Rsma◼C◼F257◼Z—53◼type₀ C◼F257◼𝔽—53
Definition: C-F257.c:10806
+ Here is the caller graph for this function:

Variable Documentation

§ C◼F257◼generator—53

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