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

Typedef Documentation

§ C◼F257◼𝔽—43

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

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

Function Documentation

§ C◼F257◼order—43()

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

Compute the order of element .

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

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

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

11353  {
11354 #line 147 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
11355  if (¬(C◼F257◼𝔽—43◼_Operator—notnot(x ))) return 0;
11356  C◼F257◼𝔽—43 y = x;
11357  for (C◼F257◼𝔽—43 i = 1; i; ((i )=(C◼F257◼𝔽—43◼_Operator—add(i , 1)))) {
11358 #line 150 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
11359  if (C◼F257◼𝔽—43◼_Operator—eq(y , 1 )) return i;
11360  ((y )=(C◼F257◼𝔽—43◼_Operator—prod(y , x )));
11361  }
11362  // should not be reached
11363  return 0;
11364 }
C◼F257◼𝔽—43 C◼F257◼𝔽—43◼_Operator—add(C◼F257◼𝔽—43 a, C◼F257◼𝔽—43 b)
Operation in the ring ℤn.
Definition: C-F257.c:11303
C◼F257◼𝔽—43 C◼F257◼𝔽—43◼_Operator—notnot(C◼F257◼𝔽—43 a)
Test if non-zero in ℤn.
Definition: C-F257.c:11337
_Intern◼_I584Rsma◼C◼F257◼Z—43◼type₀ C◼F257◼𝔽—43
Definition: C-F257.c:11274
_Bool C◼F257◼𝔽—43◼_Operator—eq(C◼F257◼𝔽—43 a, C◼F257◼𝔽—43 b)
Equality in the ring ℤn.
Definition: C-F257.c:11332
C◼F257◼𝔽—43 C◼F257◼𝔽—43◼_Operator—prod(C◼F257◼𝔽—43 a, C◼F257◼𝔽—43 b)
Operation in the ring ℤn.
Definition: C-F257.c:11315
+ Here is the call graph for this function:

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

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

Operation in the ring ℤn.

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

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

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

11303  {
11304 #line 107 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
11305  C◼F257◼𝔽—43 ret = a + b;
11307 }
C◼F257◼𝔽—43 C◼F257◼𝔽—43◼_Operator—bnotbnot(C◼F257◼𝔽—43 a)
Map a into ℤn.
Definition: C-F257.c:11298
_Intern◼_I584Rsma◼C◼F257◼Z—43◼type₀ C◼F257◼𝔽—43
Definition: C-F257.c:11274
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

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

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

Map a into ℤn.

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

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

11298  {
11299 #line 103 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
11300  return a % _Intern◼_I584Rsma◼C◼F257◼Z—43◼mod₀;
11301 }
+ Here is the caller graph for this function:

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

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

Operation in the ring ℤn.

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

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

11321  {
11322 #line 122 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
11323  C◼F257◼𝔽—43 ret = a * _Intern◼_I584Rsma◼C◼F257◼Z—43◼inverse(b);
11325 }
C◼F257◼𝔽—43 C◼F257◼𝔽—43◼_Operator—bnotbnot(C◼F257◼𝔽—43 a)
Map a into ℤn.
Definition: C-F257.c:11298
_Intern◼_I584Rsma◼C◼F257◼Z—43◼type₀ C◼F257◼𝔽—43
Definition: C-F257.c:11274
+ Here is the caller graph for this function:

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

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

Equality in the ring ℤn.

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

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

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

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

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

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

Operation in the ring ℤn.

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

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

11327  {
11328 #line 127 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
11330 }
C◼F257◼𝔽—43 C◼F257◼𝔽—43◼_Operator—div(C◼F257◼𝔽—43 a, C◼F257◼𝔽—43 b)
Operation in the ring ℤn.
Definition: C-F257.c:11321
C◼F257◼𝔽—43 C◼F257◼𝔽—43◼_Operator—sub(C◼F257◼𝔽—43 a, C◼F257◼𝔽—43 b)
Operation in the ring ℤn.
Definition: C-F257.c:11309
C◼F257◼𝔽—43 C◼F257◼𝔽—43◼_Operator—prod(C◼F257◼𝔽—43 a, C◼F257◼𝔽—43 b)
Operation in the ring ℤn.
Definition: C-F257.c:11315
+ Here is the call graph for this function:

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

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

Test if non-zero in ℤn.

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

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

11337  {
11338 #line 135 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
11339  return ‼C◼F257◼𝔽—43◼_Operator—bnotbnot(a);
11340 }
+ Here is the caller graph for this function:

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

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

Operation in the ring ℤn.

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

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

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

11315  {
11316 #line 117 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
11317  C◼F257◼𝔽—43 ret = a * b;
11319 }
C◼F257◼𝔽—43 C◼F257◼𝔽—43◼_Operator—bnotbnot(C◼F257◼𝔽—43 a)
Map a into ℤn.
Definition: C-F257.c:11298
_Intern◼_I584Rsma◼C◼F257◼Z—43◼type₀ C◼F257◼𝔽—43
Definition: C-F257.c:11274
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

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

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

Operation in the ring ℤn.

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

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

11309  {
11310 #line 112 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
11311  C◼F257◼𝔽—43 ret = a + (_Intern◼_I584Rsma◼C◼F257◼Z—43◼mod₀ - b);
11313 }
C◼F257◼𝔽—43 C◼F257◼𝔽—43◼_Operator—bnotbnot(C◼F257◼𝔽—43 a)
Map a into ℤn.
Definition: C-F257.c:11298
_Intern◼_I584Rsma◼C◼F257◼Z—43◼type₀ C◼F257◼𝔽—43
Definition: C-F257.c:11274
+ Here is the caller graph for this function:

Variable Documentation

§ C◼F257◼generator—43

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