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

Typedef Documentation

§ C◼F257◼𝔽—31

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

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

Function Documentation

§ C◼F257◼order—31()

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

Compute the order of element .

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

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

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

12055  {
12056 #line 147 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
12057  if (¬(C◼F257◼𝔽—31◼_Operator—notnot(x ))) return 0;
12058  C◼F257◼𝔽—31 y = x;
12059  for (C◼F257◼𝔽—31 i = 1; i; ((i )=(C◼F257◼𝔽—31◼_Operator—add(i , 1)))) {
12060 #line 150 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
12061  if (C◼F257◼𝔽—31◼_Operator—eq(y , 1 )) return i;
12062  ((y )=(C◼F257◼𝔽—31◼_Operator—prod(y , x )));
12063  }
12064  // should not be reached
12065  return 0;
12066 }
C◼F257◼𝔽—31 C◼F257◼𝔽—31◼_Operator—notnot(C◼F257◼𝔽—31 a)
Test if non-zero in ℤn.
Definition: C-F257.c:12039
_Intern◼_I584Rsma◼C◼F257◼Z—31◼type₀ C◼F257◼𝔽—31
Definition: C-F257.c:11976
_Bool C◼F257◼𝔽—31◼_Operator—eq(C◼F257◼𝔽—31 a, C◼F257◼𝔽—31 b)
Equality in the ring ℤn.
Definition: C-F257.c:12034
C◼F257◼𝔽—31 C◼F257◼𝔽—31◼_Operator—add(C◼F257◼𝔽—31 a, C◼F257◼𝔽—31 b)
Operation in the ring ℤn.
Definition: C-F257.c:12005
C◼F257◼𝔽—31 C◼F257◼𝔽—31◼_Operator—prod(C◼F257◼𝔽—31 a, C◼F257◼𝔽—31 b)
Operation in the ring ℤn.
Definition: C-F257.c:12017
+ Here is the call graph for this function:

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

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

Operation in the ring ℤn.

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

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

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

12005  {
12006 #line 107 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
12007  C◼F257◼𝔽—31 ret = a + b;
12009 }
C◼F257◼𝔽—31 C◼F257◼𝔽—31◼_Operator—bnotbnot(C◼F257◼𝔽—31 a)
Map a into ℤn.
Definition: C-F257.c:12000
_Intern◼_I584Rsma◼C◼F257◼Z—31◼type₀ C◼F257◼𝔽—31
Definition: C-F257.c:11976
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

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

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

Map a into ℤn.

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

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

12000  {
12001 #line 103 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
12002  return a % _Intern◼_I584Rsma◼C◼F257◼Z—31◼mod₀;
12003 }
+ Here is the caller graph for this function:

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

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

Operation in the ring ℤn.

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

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

12023  {
12024 #line 122 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
12025  C◼F257◼𝔽—31 ret = a * _Intern◼_I584Rsma◼C◼F257◼Z—31◼inverse(b);
12027 }
C◼F257◼𝔽—31 C◼F257◼𝔽—31◼_Operator—bnotbnot(C◼F257◼𝔽—31 a)
Map a into ℤn.
Definition: C-F257.c:12000
_Intern◼_I584Rsma◼C◼F257◼Z—31◼type₀ C◼F257◼𝔽—31
Definition: C-F257.c:11976
+ Here is the caller graph for this function:

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

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

Equality in the ring ℤn.

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

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

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

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

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

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

Operation in the ring ℤn.

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

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

12029  {
12030 #line 127 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
12032 }
C◼F257◼𝔽—31 C◼F257◼𝔽—31◼_Operator—div(C◼F257◼𝔽—31 a, C◼F257◼𝔽—31 b)
Operation in the ring ℤn.
Definition: C-F257.c:12023
C◼F257◼𝔽—31 C◼F257◼𝔽—31◼_Operator—sub(C◼F257◼𝔽—31 a, C◼F257◼𝔽—31 b)
Operation in the ring ℤn.
Definition: C-F257.c:12011
C◼F257◼𝔽—31 C◼F257◼𝔽—31◼_Operator—prod(C◼F257◼𝔽—31 a, C◼F257◼𝔽—31 b)
Operation in the ring ℤn.
Definition: C-F257.c:12017
+ Here is the call graph for this function:

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

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

Test if non-zero in ℤn.

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

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

12039  {
12040 #line 135 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
12041  return ‼C◼F257◼𝔽—31◼_Operator—bnotbnot(a);
12042 }
+ Here is the caller graph for this function:

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

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

Operation in the ring ℤn.

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

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

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

12017  {
12018 #line 117 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
12019  C◼F257◼𝔽—31 ret = a * b;
12021 }
C◼F257◼𝔽—31 C◼F257◼𝔽—31◼_Operator—bnotbnot(C◼F257◼𝔽—31 a)
Map a into ℤn.
Definition: C-F257.c:12000
_Intern◼_I584Rsma◼C◼F257◼Z—31◼type₀ C◼F257◼𝔽—31
Definition: C-F257.c:11976
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

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

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

Operation in the ring ℤn.

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

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

12011  {
12012 #line 112 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
12013  C◼F257◼𝔽—31 ret = a + (_Intern◼_I584Rsma◼C◼F257◼Z—31◼mod₀ - b);
12015 }
C◼F257◼𝔽—31 C◼F257◼𝔽—31◼_Operator—bnotbnot(C◼F257◼𝔽—31 a)
Map a into ℤn.
Definition: C-F257.c:12000
_Intern◼_I584Rsma◼C◼F257◼Z—31◼type₀ C◼F257◼𝔽—31
Definition: C-F257.c:11976
+ Here is the caller graph for this function:

Variable Documentation

§ C◼F257◼generator—31

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