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

Typedef Documentation

§ C◼F257◼𝔽—233

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

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

Function Documentation

§ C◼F257◼order—233()

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

Compute the order of element .

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

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

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

2461  {
2462 #line 147 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
2463  if (¬(C◼F257◼𝔽—233◼_Operator—notnot(x ))) return 0;
2464  C◼F257◼𝔽—233 y = x;
2465  for (C◼F257◼𝔽—233 i = 1; i; ((i )=(C◼F257◼𝔽—233◼_Operator—add(i , 1)))) {
2466 #line 150 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
2467  if (C◼F257◼𝔽—233◼_Operator—eq(y , 1 )) return i;
2469  }
2470  // should not be reached
2471  return 0;
2472 }
C◼F257◼𝔽—233 C◼F257◼𝔽—233◼_Operator—notnot(C◼F257◼𝔽—233 a)
Test if non-zero in ℤn.
Definition: C-F257.c:2445
C◼F257◼𝔽—233 C◼F257◼𝔽—233◼_Operator—prod(C◼F257◼𝔽—233 a, C◼F257◼𝔽—233 b)
Operation in the ring ℤn.
Definition: C-F257.c:2423
_Intern◼_I584Rsma◼C◼F257◼Z—233◼type₀ C◼F257◼𝔽—233
Definition: C-F257.c:2382
_Bool C◼F257◼𝔽—233◼_Operator—eq(C◼F257◼𝔽—233 a, C◼F257◼𝔽—233 b)
Equality in the ring ℤn.
Definition: C-F257.c:2440
C◼F257◼𝔽—233 C◼F257◼𝔽—233◼_Operator—add(C◼F257◼𝔽—233 a, C◼F257◼𝔽—233 b)
Operation in the ring ℤn.
Definition: C-F257.c:2411
+ Here is the call graph for this function:

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

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

Operation in the ring ℤn.

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

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

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

2411  {
2412 #line 107 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
2413  C◼F257◼𝔽—233 ret = a + b;
2415 }
C◼F257◼𝔽—233 C◼F257◼𝔽—233◼_Operator—bnotbnot(C◼F257◼𝔽—233 a)
Map a into ℤn.
Definition: C-F257.c:2406
_Intern◼_I584Rsma◼C◼F257◼Z—233◼type₀ C◼F257◼𝔽—233
Definition: C-F257.c:2382
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

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

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

Map a into ℤn.

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

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

2406  {
2407 #line 103 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
2408  return a % _Intern◼_I584Rsma◼C◼F257◼Z—233◼mod₀;
2409 }
+ Here is the caller graph for this function:

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

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

Operation in the ring ℤn.

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

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

2429  {
2430 #line 122 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
2431  C◼F257◼𝔽—233 ret = a * _Intern◼_I584Rsma◼C◼F257◼Z—233◼inverse(b);
2433 }
C◼F257◼𝔽—233 C◼F257◼𝔽—233◼_Operator—bnotbnot(C◼F257◼𝔽—233 a)
Map a into ℤn.
Definition: C-F257.c:2406
_Intern◼_I584Rsma◼C◼F257◼Z—233◼type₀ C◼F257◼𝔽—233
Definition: C-F257.c:2382
+ Here is the caller graph for this function:

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

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

Equality in the ring ℤn.

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

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

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

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

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

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

Operation in the ring ℤn.

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

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

2435  {
2436 #line 127 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
2438 }
C◼F257◼𝔽—233 C◼F257◼𝔽—233◼_Operator—sub(C◼F257◼𝔽—233 a, C◼F257◼𝔽—233 b)
Operation in the ring ℤn.
Definition: C-F257.c:2417
C◼F257◼𝔽—233 C◼F257◼𝔽—233◼_Operator—prod(C◼F257◼𝔽—233 a, C◼F257◼𝔽—233 b)
Operation in the ring ℤn.
Definition: C-F257.c:2423
C◼F257◼𝔽—233 C◼F257◼𝔽—233◼_Operator—div(C◼F257◼𝔽—233 a, C◼F257◼𝔽—233 b)
Operation in the ring ℤn.
Definition: C-F257.c:2429
+ Here is the call graph for this function:

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

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

Test if non-zero in ℤn.

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

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

2445  {
2446 #line 135 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
2447  return ‼C◼F257◼𝔽—233◼_Operator—bnotbnot(a);
2448 }
+ Here is the caller graph for this function:

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

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

Operation in the ring ℤn.

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

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

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

2423  {
2424 #line 117 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
2425  C◼F257◼𝔽—233 ret = a * b;
2427 }
C◼F257◼𝔽—233 C◼F257◼𝔽—233◼_Operator—bnotbnot(C◼F257◼𝔽—233 a)
Map a into ℤn.
Definition: C-F257.c:2406
_Intern◼_I584Rsma◼C◼F257◼Z—233◼type₀ C◼F257◼𝔽—233
Definition: C-F257.c:2382
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

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

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

Operation in the ring ℤn.

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

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

2417  {
2418 #line 112 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
2419  C◼F257◼𝔽—233 ret = a + (_Intern◼_I584Rsma◼C◼F257◼Z—233◼mod₀ - b);
2421 }
C◼F257◼𝔽—233 C◼F257◼𝔽—233◼_Operator—bnotbnot(C◼F257◼𝔽—233 a)
Map a into ℤn.
Definition: C-F257.c:2406
_Intern◼_I584Rsma◼C◼F257◼Z—233◼type₀ C◼F257◼𝔽—233
Definition: C-F257.c:2382
+ Here is the caller graph for this function:

Variable Documentation

§ C◼F257◼generator—233

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