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

Typedef Documentation

§ C◼F257◼𝔽—139

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

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

Function Documentation

§ C◼F257◼order—139()

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

Compute the order of element .

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

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

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

6673  {
6674 #line 147 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
6675  if (¬(C◼F257◼𝔽—139◼_Operator—notnot(x ))) return 0;
6676  C◼F257◼𝔽—139 y = x;
6677  for (C◼F257◼𝔽—139 i = 1; i; ((i )=(C◼F257◼𝔽—139◼_Operator—add(i , 1)))) {
6678 #line 150 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
6679  if (C◼F257◼𝔽—139◼_Operator—eq(y , 1 )) return i;
6681  }
6682  // should not be reached
6683  return 0;
6684 }
C◼F257◼𝔽—139 C◼F257◼𝔽—139◼_Operator—notnot(C◼F257◼𝔽—139 a)
Test if non-zero in ℤn.
Definition: C-F257.c:6657
C◼F257◼𝔽—139 C◼F257◼𝔽—139◼_Operator—prod(C◼F257◼𝔽—139 a, C◼F257◼𝔽—139 b)
Operation in the ring ℤn.
Definition: C-F257.c:6635
_Bool C◼F257◼𝔽—139◼_Operator—eq(C◼F257◼𝔽—139 a, C◼F257◼𝔽—139 b)
Equality in the ring ℤn.
Definition: C-F257.c:6652
C◼F257◼𝔽—139 C◼F257◼𝔽—139◼_Operator—add(C◼F257◼𝔽—139 a, C◼F257◼𝔽—139 b)
Operation in the ring ℤn.
Definition: C-F257.c:6623
_Intern◼_I584Rsma◼C◼F257◼Z—139◼type₀ C◼F257◼𝔽—139
Definition: C-F257.c:6594
+ Here is the call graph for this function:

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

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

Operation in the ring ℤn.

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

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

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

6623  {
6624 #line 107 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
6625  C◼F257◼𝔽—139 ret = a + b;
6627 }
C◼F257◼𝔽—139 C◼F257◼𝔽—139◼_Operator—bnotbnot(C◼F257◼𝔽—139 a)
Map a into ℤn.
Definition: C-F257.c:6618
_Intern◼_I584Rsma◼C◼F257◼Z—139◼type₀ C◼F257◼𝔽—139
Definition: C-F257.c:6594
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

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

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

Map a into ℤn.

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

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

6618  {
6619 #line 103 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
6620  return a % _Intern◼_I584Rsma◼C◼F257◼Z—139◼mod₀;
6621 }
+ Here is the caller graph for this function:

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

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

Operation in the ring ℤn.

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

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

6641  {
6642 #line 122 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
6643  C◼F257◼𝔽—139 ret = a * _Intern◼_I584Rsma◼C◼F257◼Z—139◼inverse(b);
6645 }
C◼F257◼𝔽—139 C◼F257◼𝔽—139◼_Operator—bnotbnot(C◼F257◼𝔽—139 a)
Map a into ℤn.
Definition: C-F257.c:6618
_Intern◼_I584Rsma◼C◼F257◼Z—139◼type₀ C◼F257◼𝔽—139
Definition: C-F257.c:6594
+ Here is the caller graph for this function:

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

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

Equality in the ring ℤn.

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

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

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

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

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

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

Operation in the ring ℤn.

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

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

6647  {
6648 #line 127 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
6650 }
C◼F257◼𝔽—139 C◼F257◼𝔽—139◼_Operator—prod(C◼F257◼𝔽—139 a, C◼F257◼𝔽—139 b)
Operation in the ring ℤn.
Definition: C-F257.c:6635
C◼F257◼𝔽—139 C◼F257◼𝔽—139◼_Operator—div(C◼F257◼𝔽—139 a, C◼F257◼𝔽—139 b)
Operation in the ring ℤn.
Definition: C-F257.c:6641
C◼F257◼𝔽—139 C◼F257◼𝔽—139◼_Operator—sub(C◼F257◼𝔽—139 a, C◼F257◼𝔽—139 b)
Operation in the ring ℤn.
Definition: C-F257.c:6629
+ Here is the call graph for this function:

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

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

Test if non-zero in ℤn.

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

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

6657  {
6658 #line 135 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
6659  return ‼C◼F257◼𝔽—139◼_Operator—bnotbnot(a);
6660 }
+ Here is the caller graph for this function:

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

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

Operation in the ring ℤn.

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

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

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

6635  {
6636 #line 117 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
6637  C◼F257◼𝔽—139 ret = a * b;
6639 }
C◼F257◼𝔽—139 C◼F257◼𝔽—139◼_Operator—bnotbnot(C◼F257◼𝔽—139 a)
Map a into ℤn.
Definition: C-F257.c:6618
_Intern◼_I584Rsma◼C◼F257◼Z—139◼type₀ C◼F257◼𝔽—139
Definition: C-F257.c:6594
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

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

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

Operation in the ring ℤn.

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

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

6629  {
6630 #line 112 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
6631  C◼F257◼𝔽—139 ret = a + (_Intern◼_I584Rsma◼C◼F257◼Z—139◼mod₀ - b);
6633 }
C◼F257◼𝔽—139 C◼F257◼𝔽—139◼_Operator—bnotbnot(C◼F257◼𝔽—139 a)
Map a into ℤn.
Definition: C-F257.c:6618
_Intern◼_I584Rsma◼C◼F257◼Z—139◼type₀ C◼F257◼𝔽—139
Definition: C-F257.c:6594
+ Here is the caller graph for this function:

Variable Documentation

§ C◼F257◼generator—139

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