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

Typedef Documentation

§ C◼F257◼𝔽—5

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

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

Function Documentation

§ C◼F257◼order—5()

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

Compute the order of element .

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

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

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

13927  {
13928 #line 147 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
13929  if (¬(C◼F257◼𝔽—5◼_Operator—notnot(x ))) return 0;
13930  C◼F257◼𝔽—5 y = x;
13931  for (C◼F257◼𝔽—5 i = 1; i; ((i )=(C◼F257◼𝔽—5◼_Operator—add(i , 1)))) {
13932 #line 150 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
13933  if (C◼F257◼𝔽—5◼_Operator—eq(y , 1 )) return i;
13934  ((y )=(C◼F257◼𝔽—5◼_Operator—prod(y , x )));
13935  }
13936  // should not be reached
13937  return 0;
13938 }
_Intern◼_I584Rsma◼C◼F257◼Z—5◼type₀ C◼F257◼𝔽—5
Definition: C-F257.c:13848
_Bool C◼F257◼𝔽—5◼_Operator—eq(C◼F257◼𝔽—5 a, C◼F257◼𝔽—5 b)
Equality in the ring ℤn.
Definition: C-F257.c:13906
C◼F257◼𝔽—5 C◼F257◼𝔽—5◼_Operator—notnot(C◼F257◼𝔽—5 a)
Test if non-zero in ℤn.
Definition: C-F257.c:13911
C◼F257◼𝔽—5 C◼F257◼𝔽—5◼_Operator—prod(C◼F257◼𝔽—5 a, C◼F257◼𝔽—5 b)
Operation in the ring ℤn.
Definition: C-F257.c:13889
C◼F257◼𝔽—5 C◼F257◼𝔽—5◼_Operator—add(C◼F257◼𝔽—5 a, C◼F257◼𝔽—5 b)
Operation in the ring ℤn.
Definition: C-F257.c:13877
+ Here is the call graph for this function:

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

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

Operation in the ring ℤn.

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

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

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

13877  {
13878 #line 107 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
13879  C◼F257◼𝔽—5 ret = a + b;
13881 }
C◼F257◼𝔽—5 C◼F257◼𝔽—5◼_Operator—bnotbnot(C◼F257◼𝔽—5 a)
Map a into ℤn.
Definition: C-F257.c:13872
_Intern◼_I584Rsma◼C◼F257◼Z—5◼type₀ C◼F257◼𝔽—5
Definition: C-F257.c:13848
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

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

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

Map a into ℤn.

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

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

13872  {
13873 #line 103 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
13874  return a % _Intern◼_I584Rsma◼C◼F257◼Z—5◼mod₀;
13875 }
+ Here is the caller graph for this function:

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

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

Operation in the ring ℤn.

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

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

13895  {
13896 #line 122 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
13897  C◼F257◼𝔽—5 ret = a * _Intern◼_I584Rsma◼C◼F257◼Z—5◼inverse(b);
13899 }
C◼F257◼𝔽—5 C◼F257◼𝔽—5◼_Operator—bnotbnot(C◼F257◼𝔽—5 a)
Map a into ℤn.
Definition: C-F257.c:13872
_Intern◼_I584Rsma◼C◼F257◼Z—5◼type₀ C◼F257◼𝔽—5
Definition: C-F257.c:13848
+ Here is the caller graph for this function:

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

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

Equality in the ring ℤn.

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

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

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

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

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

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

Operation in the ring ℤn.

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

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

13901  {
13902 #line 127 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
13904 }
C◼F257◼𝔽—5 C◼F257◼𝔽—5◼_Operator—div(C◼F257◼𝔽—5 a, C◼F257◼𝔽—5 b)
Operation in the ring ℤn.
Definition: C-F257.c:13895
C◼F257◼𝔽—5 C◼F257◼𝔽—5◼_Operator—prod(C◼F257◼𝔽—5 a, C◼F257◼𝔽—5 b)
Operation in the ring ℤn.
Definition: C-F257.c:13889
C◼F257◼𝔽—5 C◼F257◼𝔽—5◼_Operator—sub(C◼F257◼𝔽—5 a, C◼F257◼𝔽—5 b)
Operation in the ring ℤn.
Definition: C-F257.c:13883
+ Here is the call graph for this function:

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

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

Test if non-zero in ℤn.

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

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

13911  {
13912 #line 135 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
13913  return ‼C◼F257◼𝔽—5◼_Operator—bnotbnot(a);
13914 }
+ Here is the caller graph for this function:

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

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

Operation in the ring ℤn.

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

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

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

13889  {
13890 #line 117 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
13891  C◼F257◼𝔽—5 ret = a * b;
13893 }
C◼F257◼𝔽—5 C◼F257◼𝔽—5◼_Operator—bnotbnot(C◼F257◼𝔽—5 a)
Map a into ℤn.
Definition: C-F257.c:13872
_Intern◼_I584Rsma◼C◼F257◼Z—5◼type₀ C◼F257◼𝔽—5
Definition: C-F257.c:13848
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

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

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

Operation in the ring ℤn.

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

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

13883  {
13884 #line 112 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
13885  C◼F257◼𝔽—5 ret = a + (_Intern◼_I584Rsma◼C◼F257◼Z—5◼mod₀ - b);
13887 }
C◼F257◼𝔽—5 C◼F257◼𝔽—5◼_Operator—bnotbnot(C◼F257◼𝔽—5 a)
Map a into ℤn.
Definition: C-F257.c:13872
_Intern◼_I584Rsma◼C◼F257◼Z—5◼type₀ C◼F257◼𝔽—5
Definition: C-F257.c:13848
+ Here is the caller graph for this function:

Variable Documentation

§ C◼F257◼generator—5

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