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

Typedef Documentation

§ C◼F257◼𝔽—29

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

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

Function Documentation

§ C◼F257◼order—29()

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

Compute the order of element .

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

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

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

12289  {
12290 #line 147 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
12291  if (¬(C◼F257◼𝔽—29◼_Operator—notnot(x ))) return 0;
12292  C◼F257◼𝔽—29 y = x;
12293  for (C◼F257◼𝔽—29 i = 1; i; ((i )=(C◼F257◼𝔽—29◼_Operator—add(i , 1)))) {
12294 #line 150 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
12295  if (C◼F257◼𝔽—29◼_Operator—eq(y , 1 )) return i;
12296  ((y )=(C◼F257◼𝔽—29◼_Operator—prod(y , x )));
12297  }
12298  // should not be reached
12299  return 0;
12300 }
C◼F257◼𝔽—29 C◼F257◼𝔽—29◼_Operator—prod(C◼F257◼𝔽—29 a, C◼F257◼𝔽—29 b)
Operation in the ring ℤn.
Definition: C-F257.c:12251
_Intern◼_I584Rsma◼C◼F257◼Z—29◼type₀ C◼F257◼𝔽—29
Definition: C-F257.c:12210
C◼F257◼𝔽—29 C◼F257◼𝔽—29◼_Operator—add(C◼F257◼𝔽—29 a, C◼F257◼𝔽—29 b)
Operation in the ring ℤn.
Definition: C-F257.c:12239
C◼F257◼𝔽—29 C◼F257◼𝔽—29◼_Operator—notnot(C◼F257◼𝔽—29 a)
Test if non-zero in ℤn.
Definition: C-F257.c:12273
_Bool C◼F257◼𝔽—29◼_Operator—eq(C◼F257◼𝔽—29 a, C◼F257◼𝔽—29 b)
Equality in the ring ℤn.
Definition: C-F257.c:12268
+ Here is the call graph for this function:

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

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

Operation in the ring ℤn.

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

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

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

12239  {
12240 #line 107 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
12241  C◼F257◼𝔽—29 ret = a + b;
12243 }
C◼F257◼𝔽—29 C◼F257◼𝔽—29◼_Operator—bnotbnot(C◼F257◼𝔽—29 a)
Map a into ℤn.
Definition: C-F257.c:12234
_Intern◼_I584Rsma◼C◼F257◼Z—29◼type₀ C◼F257◼𝔽—29
Definition: C-F257.c:12210
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

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

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

Map a into ℤn.

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

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

12234  {
12235 #line 103 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
12236  return a % _Intern◼_I584Rsma◼C◼F257◼Z—29◼mod₀;
12237 }
+ Here is the caller graph for this function:

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

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

Operation in the ring ℤn.

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

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

12257  {
12258 #line 122 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
12259  C◼F257◼𝔽—29 ret = a * _Intern◼_I584Rsma◼C◼F257◼Z—29◼inverse(b);
12261 }
C◼F257◼𝔽—29 C◼F257◼𝔽—29◼_Operator—bnotbnot(C◼F257◼𝔽—29 a)
Map a into ℤn.
Definition: C-F257.c:12234
_Intern◼_I584Rsma◼C◼F257◼Z—29◼type₀ C◼F257◼𝔽—29
Definition: C-F257.c:12210
+ Here is the caller graph for this function:

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

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

Equality in the ring ℤn.

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

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

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

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

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

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

Operation in the ring ℤn.

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

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

12263  {
12264 #line 127 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
12266 }
C◼F257◼𝔽—29 C◼F257◼𝔽—29◼_Operator—sub(C◼F257◼𝔽—29 a, C◼F257◼𝔽—29 b)
Operation in the ring ℤn.
Definition: C-F257.c:12245
C◼F257◼𝔽—29 C◼F257◼𝔽—29◼_Operator—prod(C◼F257◼𝔽—29 a, C◼F257◼𝔽—29 b)
Operation in the ring ℤn.
Definition: C-F257.c:12251
C◼F257◼𝔽—29 C◼F257◼𝔽—29◼_Operator—div(C◼F257◼𝔽—29 a, C◼F257◼𝔽—29 b)
Operation in the ring ℤn.
Definition: C-F257.c:12257
+ Here is the call graph for this function:

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

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

Test if non-zero in ℤn.

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

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

12273  {
12274 #line 135 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
12275  return ‼C◼F257◼𝔽—29◼_Operator—bnotbnot(a);
12276 }
+ Here is the caller graph for this function:

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

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

Operation in the ring ℤn.

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

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

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

12251  {
12252 #line 117 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
12253  C◼F257◼𝔽—29 ret = a * b;
12255 }
C◼F257◼𝔽—29 C◼F257◼𝔽—29◼_Operator—bnotbnot(C◼F257◼𝔽—29 a)
Map a into ℤn.
Definition: C-F257.c:12234
_Intern◼_I584Rsma◼C◼F257◼Z—29◼type₀ C◼F257◼𝔽—29
Definition: C-F257.c:12210
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

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

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

Operation in the ring ℤn.

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

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

12245  {
12246 #line 112 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
12247  C◼F257◼𝔽—29 ret = a + (_Intern◼_I584Rsma◼C◼F257◼Z—29◼mod₀ - b);
12249 }
C◼F257◼𝔽—29 C◼F257◼𝔽—29◼_Operator—bnotbnot(C◼F257◼𝔽—29 a)
Map a into ℤn.
Definition: C-F257.c:12234
_Intern◼_I584Rsma◼C◼F257◼Z—29◼type₀ C◼F257◼𝔽—29
Definition: C-F257.c:12210
+ Here is the caller graph for this function:

Variable Documentation

§ C◼F257◼generator—29

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