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

Typedef Documentation

§ C◼F257◼𝔽—3

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

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

Function Documentation

§ C◼F257◼order—3()

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

Compute the order of element .

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

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

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

14161  {
14162 #line 147 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
14163  if (¬(C◼F257◼𝔽—3◼_Operator—notnot(x ))) return 0;
14164  C◼F257◼𝔽—3 y = x;
14165  for (C◼F257◼𝔽—3 i = 1; i; ((i )=(C◼F257◼𝔽—3◼_Operator—add(i , 1)))) {
14166 #line 150 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
14167  if (C◼F257◼𝔽—3◼_Operator—eq(y , 1 )) return i;
14168  ((y )=(C◼F257◼𝔽—3◼_Operator—prod(y , x )));
14169  }
14170  // should not be reached
14171  return 0;
14172 }
C◼F257◼𝔽—3 C◼F257◼𝔽—3◼_Operator—add(C◼F257◼𝔽—3 a, C◼F257◼𝔽—3 b)
Operation in the ring ℤn.
Definition: C-F257.c:14111
_Bool C◼F257◼𝔽—3◼_Operator—eq(C◼F257◼𝔽—3 a, C◼F257◼𝔽—3 b)
Equality in the ring ℤn.
Definition: C-F257.c:14140
C◼F257◼𝔽—3 C◼F257◼𝔽—3◼_Operator—prod(C◼F257◼𝔽—3 a, C◼F257◼𝔽—3 b)
Operation in the ring ℤn.
Definition: C-F257.c:14123
_Intern◼_I584Rsma◼C◼F257◼Z—3◼type₀ C◼F257◼𝔽—3
Definition: C-F257.c:14082
C◼F257◼𝔽—3 C◼F257◼𝔽—3◼_Operator—notnot(C◼F257◼𝔽—3 a)
Test if non-zero in ℤn.
Definition: C-F257.c:14145
+ Here is the call graph for this function:

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

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

Operation in the ring ℤn.

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

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

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

14111  {
14112 #line 107 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
14113  C◼F257◼𝔽—3 ret = a + b;
14115 }
C◼F257◼𝔽—3 C◼F257◼𝔽—3◼_Operator—bnotbnot(C◼F257◼𝔽—3 a)
Map a into ℤn.
Definition: C-F257.c:14106
_Intern◼_I584Rsma◼C◼F257◼Z—3◼type₀ C◼F257◼𝔽—3
Definition: C-F257.c:14082
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

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

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

Map a into ℤn.

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

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

14106  {
14107 #line 103 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
14108  return a % _Intern◼_I584Rsma◼C◼F257◼Z—3◼mod₀;
14109 }
+ Here is the caller graph for this function:

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

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

Operation in the ring ℤn.

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

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

14129  {
14130 #line 122 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
14131  C◼F257◼𝔽—3 ret = a * _Intern◼_I584Rsma◼C◼F257◼Z—3◼inverse(b);
14133 }
C◼F257◼𝔽—3 C◼F257◼𝔽—3◼_Operator—bnotbnot(C◼F257◼𝔽—3 a)
Map a into ℤn.
Definition: C-F257.c:14106
_Intern◼_I584Rsma◼C◼F257◼Z—3◼type₀ C◼F257◼𝔽—3
Definition: C-F257.c:14082
+ Here is the caller graph for this function:

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

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

Equality in the ring ℤn.

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

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

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

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

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

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

Operation in the ring ℤn.

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

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

14135  {
14136 #line 127 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
14138 }
C◼F257◼𝔽—3 C◼F257◼𝔽—3◼_Operator—div(C◼F257◼𝔽—3 a, C◼F257◼𝔽—3 b)
Operation in the ring ℤn.
Definition: C-F257.c:14129
C◼F257◼𝔽—3 C◼F257◼𝔽—3◼_Operator—sub(C◼F257◼𝔽—3 a, C◼F257◼𝔽—3 b)
Operation in the ring ℤn.
Definition: C-F257.c:14117
C◼F257◼𝔽—3 C◼F257◼𝔽—3◼_Operator—prod(C◼F257◼𝔽—3 a, C◼F257◼𝔽—3 b)
Operation in the ring ℤn.
Definition: C-F257.c:14123
+ Here is the call graph for this function:

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

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

Test if non-zero in ℤn.

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

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

14145  {
14146 #line 135 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
14147  return ‼C◼F257◼𝔽—3◼_Operator—bnotbnot(a);
14148 }
+ Here is the caller graph for this function:

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

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

Operation in the ring ℤn.

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

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

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

14123  {
14124 #line 117 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
14125  C◼F257◼𝔽—3 ret = a * b;
14127 }
C◼F257◼𝔽—3 C◼F257◼𝔽—3◼_Operator—bnotbnot(C◼F257◼𝔽—3 a)
Map a into ℤn.
Definition: C-F257.c:14106
_Intern◼_I584Rsma◼C◼F257◼Z—3◼type₀ C◼F257◼𝔽—3
Definition: C-F257.c:14082
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

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

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

Operation in the ring ℤn.

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

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

14117  {
14118 #line 112 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
14119  C◼F257◼𝔽—3 ret = a + (_Intern◼_I584Rsma◼C◼F257◼Z—3◼mod₀ - b);
14121 }
C◼F257◼𝔽—3 C◼F257◼𝔽—3◼_Operator—bnotbnot(C◼F257◼𝔽—3 a)
Map a into ℤn.
Definition: C-F257.c:14106
_Intern◼_I584Rsma◼C◼F257◼Z—3◼type₀ C◼F257◼𝔽—3
Definition: C-F257.c:14082
+ Here is the caller graph for this function:

Variable Documentation

§ C◼F257◼generator—3

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