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

Typedef Documentation

§ C◼F257◼𝔽—11

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

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

Function Documentation

§ C◼F257◼order—11()

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

Compute the order of element .

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

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

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

13459  {
13460 #line 147 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
13461  if (¬(C◼F257◼𝔽—11◼_Operator—notnot(x ))) return 0;
13462  C◼F257◼𝔽—11 y = x;
13463  for (C◼F257◼𝔽—11 i = 1; i; ((i )=(C◼F257◼𝔽—11◼_Operator—add(i , 1)))) {
13464 #line 150 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
13465  if (C◼F257◼𝔽—11◼_Operator—eq(y , 1 )) return i;
13466  ((y )=(C◼F257◼𝔽—11◼_Operator—prod(y , x )));
13467  }
13468  // should not be reached
13469  return 0;
13470 }
C◼F257◼𝔽—11 C◼F257◼𝔽—11◼_Operator—prod(C◼F257◼𝔽—11 a, C◼F257◼𝔽—11 b)
Operation in the ring ℤn.
Definition: C-F257.c:13421
_Bool C◼F257◼𝔽—11◼_Operator—eq(C◼F257◼𝔽—11 a, C◼F257◼𝔽—11 b)
Equality in the ring ℤn.
Definition: C-F257.c:13438
C◼F257◼𝔽—11 C◼F257◼𝔽—11◼_Operator—add(C◼F257◼𝔽—11 a, C◼F257◼𝔽—11 b)
Operation in the ring ℤn.
Definition: C-F257.c:13409
_Intern◼_I584Rsma◼C◼F257◼Z—11◼type₀ C◼F257◼𝔽—11
Definition: C-F257.c:13380
C◼F257◼𝔽—11 C◼F257◼𝔽—11◼_Operator—notnot(C◼F257◼𝔽—11 a)
Test if non-zero in ℤn.
Definition: C-F257.c:13443
+ Here is the call graph for this function:

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

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

Operation in the ring ℤn.

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

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

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

13409  {
13410 #line 107 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
13411  C◼F257◼𝔽—11 ret = a + b;
13413 }
C◼F257◼𝔽—11 C◼F257◼𝔽—11◼_Operator—bnotbnot(C◼F257◼𝔽—11 a)
Map a into ℤn.
Definition: C-F257.c:13404
_Intern◼_I584Rsma◼C◼F257◼Z—11◼type₀ C◼F257◼𝔽—11
Definition: C-F257.c:13380
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

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

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

Map a into ℤn.

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

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

13404  {
13405 #line 103 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
13406  return a % _Intern◼_I584Rsma◼C◼F257◼Z—11◼mod₀;
13407 }
+ Here is the caller graph for this function:

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

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

Operation in the ring ℤn.

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

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

13427  {
13428 #line 122 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
13429  C◼F257◼𝔽—11 ret = a * _Intern◼_I584Rsma◼C◼F257◼Z—11◼inverse(b);
13431 }
C◼F257◼𝔽—11 C◼F257◼𝔽—11◼_Operator—bnotbnot(C◼F257◼𝔽—11 a)
Map a into ℤn.
Definition: C-F257.c:13404
_Intern◼_I584Rsma◼C◼F257◼Z—11◼type₀ C◼F257◼𝔽—11
Definition: C-F257.c:13380
+ Here is the caller graph for this function:

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

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

Equality in the ring ℤn.

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

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

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

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

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

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

Operation in the ring ℤn.

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

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

13433  {
13434 #line 127 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
13436 }
C◼F257◼𝔽—11 C◼F257◼𝔽—11◼_Operator—div(C◼F257◼𝔽—11 a, C◼F257◼𝔽—11 b)
Operation in the ring ℤn.
Definition: C-F257.c:13427
C◼F257◼𝔽—11 C◼F257◼𝔽—11◼_Operator—prod(C◼F257◼𝔽—11 a, C◼F257◼𝔽—11 b)
Operation in the ring ℤn.
Definition: C-F257.c:13421
C◼F257◼𝔽—11 C◼F257◼𝔽—11◼_Operator—sub(C◼F257◼𝔽—11 a, C◼F257◼𝔽—11 b)
Operation in the ring ℤn.
Definition: C-F257.c:13415
+ Here is the call graph for this function:

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

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

Test if non-zero in ℤn.

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

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

13443  {
13444 #line 135 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
13445  return ‼C◼F257◼𝔽—11◼_Operator—bnotbnot(a);
13446 }
+ Here is the caller graph for this function:

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

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

Operation in the ring ℤn.

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

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

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

13421  {
13422 #line 117 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
13423  C◼F257◼𝔽—11 ret = a * b;
13425 }
C◼F257◼𝔽—11 C◼F257◼𝔽—11◼_Operator—bnotbnot(C◼F257◼𝔽—11 a)
Map a into ℤn.
Definition: C-F257.c:13404
_Intern◼_I584Rsma◼C◼F257◼Z—11◼type₀ C◼F257◼𝔽—11
Definition: C-F257.c:13380
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

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

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

Operation in the ring ℤn.

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

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

13415  {
13416 #line 112 "/home/gustedt/build/cmod/C/C-snippet-modulo.X"
13417  C◼F257◼𝔽—11 ret = a + (_Intern◼_I584Rsma◼C◼F257◼Z—11◼mod₀ - b);
13419 }
C◼F257◼𝔽—11 C◼F257◼𝔽—11◼_Operator—bnotbnot(C◼F257◼𝔽—11 a)
Map a into ℤn.
Definition: C-F257.c:13404
_Intern◼_I584Rsma◼C◼F257◼Z—11◼type₀ C◼F257◼𝔽—11
Definition: C-F257.c:13380
+ Here is the caller graph for this function:

Variable Documentation

§ C◼F257◼generator—11

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