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

Typedef Documentation

§ C◼F257◼𝔽—149

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

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

Function Documentation

§ C◼F257◼order—149()

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

Compute the order of element .

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

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

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

6439  {
6440 #line 147 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
6441  if (¬(C◼F257◼𝔽—149◼_Operator—notnot(x ))) return 0;
6442  C◼F257◼𝔽—149 y = x;
6443  for (C◼F257◼𝔽—149 i = 1; i; ((i )=(C◼F257◼𝔽—149◼_Operator—add(i , 1)))) {
6444 #line 150 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
6445  if (C◼F257◼𝔽—149◼_Operator—eq(y , 1 )) return i;
6447  }
6448  // should not be reached
6449  return 0;
6450 }
C◼F257◼𝔽—149 C◼F257◼𝔽—149◼_Operator—prod(C◼F257◼𝔽—149 a, C◼F257◼𝔽—149 b)
Operation in the ring ℤn.
Definition: C-F257.c:6401
C◼F257◼𝔽—149 C◼F257◼𝔽—149◼_Operator—add(C◼F257◼𝔽—149 a, C◼F257◼𝔽—149 b)
Operation in the ring ℤn.
Definition: C-F257.c:6389
C◼F257◼𝔽—149 C◼F257◼𝔽—149◼_Operator—notnot(C◼F257◼𝔽—149 a)
Test if non-zero in ℤn.
Definition: C-F257.c:6423
_Intern◼_I584Rsma◼C◼F257◼Z—149◼type₀ C◼F257◼𝔽—149
Definition: C-F257.c:6360
_Bool C◼F257◼𝔽—149◼_Operator—eq(C◼F257◼𝔽—149 a, C◼F257◼𝔽—149 b)
Equality in the ring ℤn.
Definition: C-F257.c:6418
+ Here is the call graph for this function:

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

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

Operation in the ring ℤn.

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

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

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

6389  {
6390 #line 107 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
6391  C◼F257◼𝔽—149 ret = a + b;
6393 }
C◼F257◼𝔽—149 C◼F257◼𝔽—149◼_Operator—bnotbnot(C◼F257◼𝔽—149 a)
Map a into ℤn.
Definition: C-F257.c:6384
_Intern◼_I584Rsma◼C◼F257◼Z—149◼type₀ C◼F257◼𝔽—149
Definition: C-F257.c:6360
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

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

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

Map a into ℤn.

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

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

6384  {
6385 #line 103 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
6386  return a % _Intern◼_I584Rsma◼C◼F257◼Z—149◼mod₀;
6387 }
+ Here is the caller graph for this function:

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

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

Operation in the ring ℤn.

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

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

6407  {
6408 #line 122 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
6409  C◼F257◼𝔽—149 ret = a * _Intern◼_I584Rsma◼C◼F257◼Z—149◼inverse(b);
6411 }
C◼F257◼𝔽—149 C◼F257◼𝔽—149◼_Operator—bnotbnot(C◼F257◼𝔽—149 a)
Map a into ℤn.
Definition: C-F257.c:6384
_Intern◼_I584Rsma◼C◼F257◼Z—149◼type₀ C◼F257◼𝔽—149
Definition: C-F257.c:6360
+ Here is the caller graph for this function:

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

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

Equality in the ring ℤn.

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

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

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

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

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

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

Operation in the ring ℤn.

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

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

6413  {
6414 #line 127 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
6416 }
C◼F257◼𝔽—149 C◼F257◼𝔽—149◼_Operator—prod(C◼F257◼𝔽—149 a, C◼F257◼𝔽—149 b)
Operation in the ring ℤn.
Definition: C-F257.c:6401
C◼F257◼𝔽—149 C◼F257◼𝔽—149◼_Operator—sub(C◼F257◼𝔽—149 a, C◼F257◼𝔽—149 b)
Operation in the ring ℤn.
Definition: C-F257.c:6395
C◼F257◼𝔽—149 C◼F257◼𝔽—149◼_Operator—div(C◼F257◼𝔽—149 a, C◼F257◼𝔽—149 b)
Operation in the ring ℤn.
Definition: C-F257.c:6407
+ Here is the call graph for this function:

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

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

Test if non-zero in ℤn.

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

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

6423  {
6424 #line 135 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
6425  return ‼C◼F257◼𝔽—149◼_Operator—bnotbnot(a);
6426 }
+ Here is the caller graph for this function:

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

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

Operation in the ring ℤn.

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

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

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

6401  {
6402 #line 117 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
6403  C◼F257◼𝔽—149 ret = a * b;
6405 }
C◼F257◼𝔽—149 C◼F257◼𝔽—149◼_Operator—bnotbnot(C◼F257◼𝔽—149 a)
Map a into ℤn.
Definition: C-F257.c:6384
_Intern◼_I584Rsma◼C◼F257◼Z—149◼type₀ C◼F257◼𝔽—149
Definition: C-F257.c:6360
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

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

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

Operation in the ring ℤn.

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

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

6395  {
6396 #line 112 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
6397  C◼F257◼𝔽—149 ret = a + (_Intern◼_I584Rsma◼C◼F257◼Z—149◼mod₀ - b);
6399 }
C◼F257◼𝔽—149 C◼F257◼𝔽—149◼_Operator—bnotbnot(C◼F257◼𝔽—149 a)
Map a into ℤn.
Definition: C-F257.c:6384
_Intern◼_I584Rsma◼C◼F257◼Z—149◼type₀ C◼F257◼𝔽—149
Definition: C-F257.c:6360
+ Here is the caller graph for this function:

Variable Documentation

§ C◼F257◼generator—149

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