Miasm2
 All Classes Namespaces Files Functions Variables Typedefs Properties Macros
Public Member Functions | Public Attributes | List of all members
miasm2.expression.modint.modint Class Reference
+ Inheritance diagram for miasm2.expression.modint.modint:
+ Collaboration diagram for miasm2.expression.modint.modint:

Public Member Functions

def __init__
 
def __repr__
 
def __hash__
 
def maxcast
 
def __cmp__
 
def __add__
 
def __and__
 
def __div__
 
def __int__
 
def __long__
 
def __invert__
 
def __lshift__
 
def __mod__
 
def __mul__
 
def __neg__
 
def __or__
 
def __radd__
 
def __rand__
 
def __rdiv__
 
def __rlshift__
 
def __rmod__
 
def __rmul__
 
def __ror__
 
def __rrshift__
 
def __rshift__
 
def __rsub__
 
def __rxor__
 
def __sub__
 
def __xor__
 
def __hex__
 
def __abs__
 
def __rpow__
 
def __pow__
 

Public Attributes

 arg
 

Detailed Description

Definition at line 175 of file modint.py.

Constructor & Destructor Documentation

def miasm2.expression.modint.modint.__init__ (   self,
  arg 
)

Definition at line 177 of file modint.py.

178  def __init__(self, arg):
179  if isinstance(arg, moduint):
180  arg = arg.arg
181  a = arg % self.__class__.limit
182  if a >= self.__class__.limit / 2:
183  a -= self.__class__.limit
184  self.arg = a
185  assert(self.arg >= -self.__class__.limit /
186  2 and self.arg < self.__class__.limit)
187 

Member Function Documentation

def miasm2.expression.modint.moduint.__abs__ (   self)
inherited

Definition at line 165 of file modint.py.

166  def __abs__(self):
167  return abs(self.arg)
def miasm2.expression.modint.moduint.__add__ (   self,
  y 
)
inherited

Definition at line 30 of file modint.py.

30 
31  def __add__(self, y):
32  if isinstance(y, moduint):
33  cls = self.maxcast(y)
34  return cls(self.arg + y.arg)
35  else:
36  return self.__class__(self.arg + y)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

def miasm2.expression.modint.moduint.__and__ (   self,
  y 
)
inherited

Definition at line 37 of file modint.py.

37 
38  def __and__(self, y):
39  if isinstance(y, moduint):
40  cls = self.maxcast(y)
41  return cls(self.arg & y.arg)
42  else:
43  return self.__class__(self.arg & y)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

def miasm2.expression.modint.moduint.__cmp__ (   self,
  y 
)
inherited

Definition at line 24 of file modint.py.

24 
25  def __cmp__(self, y):
26  if isinstance(y, moduint):
27  return cmp(self.arg, y.arg)
28  else:
29  return cmp(self.arg, y)

+ Here is the call graph for this function:

def miasm2.expression.modint.moduint.__div__ (   self,
  y 
)
inherited

Definition at line 44 of file modint.py.

44 
45  def __div__(self, y):
46  if isinstance(y, moduint):
47  cls = self.maxcast(y)
48  return cls(self.arg / y.arg)
49  else:
50  return self.__class__(self.arg / y)

+ Here is the call graph for this function:

def miasm2.expression.modint.moduint.__hash__ (   self)
inherited

Definition at line 13 of file modint.py.

13 
14  def __hash__(self):
15  return hash(self.arg)
def miasm2.expression.modint.moduint.__hex__ (   self)
inherited

Definition at line 162 of file modint.py.

163  def __hex__(self):
164  return hex(self.arg)
def miasm2.expression.modint.moduint.__int__ (   self)
inherited

Definition at line 51 of file modint.py.

51 
52  def __int__(self):
53  return int(self.arg)
def miasm2.expression.modint.moduint.__invert__ (   self)
inherited

Definition at line 57 of file modint.py.

57 
58  def __invert__(self):
59  return self.__class__(~self.arg)
def miasm2.expression.modint.moduint.__long__ (   self)
inherited

Definition at line 54 of file modint.py.

54 
55  def __long__(self):
56  return long(self.arg)
def miasm2.expression.modint.moduint.__lshift__ (   self,
  y 
)
inherited

Definition at line 60 of file modint.py.

60 
61  def __lshift__(self, y):
62  if isinstance(y, moduint):
63  cls = self.maxcast(y)
64  return cls(self.arg << y.arg)
65  else:
66  return self.__class__(self.arg << y)

+ Here is the call graph for this function:

def miasm2.expression.modint.moduint.__mod__ (   self,
  y 
)
inherited

Definition at line 67 of file modint.py.

67 
68  def __mod__(self, y):
69  if isinstance(y, moduint):
70  cls = self.maxcast(y)
71  return cls(self.arg % y.arg)
72  else:
73  return self.__class__(self.arg % y)

+ Here is the call graph for this function:

def miasm2.expression.modint.moduint.__mul__ (   self,
  y 
)
inherited

Definition at line 74 of file modint.py.

74 
75  def __mul__(self, y):
76  if isinstance(y, moduint):
77  cls = self.maxcast(y)
78  return cls(self.arg * y.arg)
79  else:
80  return self.__class__(self.arg * y)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

def miasm2.expression.modint.moduint.__neg__ (   self)
inherited

Definition at line 81 of file modint.py.

81 
82  def __neg__(self):
83  return self.__class__(-self.arg)
def miasm2.expression.modint.moduint.__or__ (   self,
  y 
)
inherited

Definition at line 84 of file modint.py.

84 
85  def __or__(self, y):
86  if isinstance(y, moduint):
87  cls = self.maxcast(y)
88  return cls(self.arg | y.arg)
89  else:
90  return self.__class__(self.arg | y)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

def miasm2.expression.modint.moduint.__pow__ (   self,
  v 
)
inherited

Definition at line 171 of file modint.py.

172  def __pow__(self, v):
173  return self.__class__(self.arg ** v)
174 
def miasm2.expression.modint.moduint.__radd__ (   self,
  y 
)
inherited

Definition at line 91 of file modint.py.

91 
92  def __radd__(self, y):
93  return self.__add__(y)

+ Here is the call graph for this function:

def miasm2.expression.modint.moduint.__rand__ (   self,
  y 
)
inherited

Definition at line 94 of file modint.py.

94 
95  def __rand__(self, y):
96  return self.__and__(y)

+ Here is the call graph for this function:

def miasm2.expression.modint.moduint.__rdiv__ (   self,
  y 
)
inherited

Definition at line 97 of file modint.py.

97 
98  def __rdiv__(self, y):
99  if isinstance(y, moduint):
100  cls = self.maxcast(y)
101  return cls(y.arg / self.arg)
102  else:
103  return self.__class__(y / self.arg)

+ Here is the call graph for this function:

def miasm2.expression.modint.moduint.__repr__ (   self)
inherited

Definition at line 10 of file modint.py.

10 
11  def __repr__(self):
12  return self.__class__.__name__ + '(' + hex(self.arg) + ')'
def miasm2.expression.modint.moduint.__rlshift__ (   self,
  y 
)
inherited

Definition at line 104 of file modint.py.

105  def __rlshift__(self, y):
106  if isinstance(y, moduint):
107  cls = self.maxcast(y)
108  return cls(y.arg << self.arg)
109  else:
110  return self.__class__(y << self.arg)

+ Here is the call graph for this function:

def miasm2.expression.modint.moduint.__rmod__ (   self,
  y 
)
inherited

Definition at line 111 of file modint.py.

112  def __rmod__(self, y):
113  if isinstance(y, moduint):
114  cls = self.maxcast(y)
115  return cls(y.arg % self.arg)
116  else:
117  return self.__class__(y % self.arg)

+ Here is the call graph for this function:

def miasm2.expression.modint.moduint.__rmul__ (   self,
  y 
)
inherited

Definition at line 118 of file modint.py.

119  def __rmul__(self, y):
120  return self.__mul__(y)

+ Here is the call graph for this function:

def miasm2.expression.modint.moduint.__ror__ (   self,
  y 
)
inherited

Definition at line 121 of file modint.py.

122  def __ror__(self, y):
123  return self.__or__(y)

+ Here is the call graph for this function:

def miasm2.expression.modint.moduint.__rpow__ (   self,
  v 
)
inherited

Definition at line 168 of file modint.py.

169  def __rpow__(self, v):
170  return v ** self.arg
def miasm2.expression.modint.moduint.__rrshift__ (   self,
  y 
)
inherited

Definition at line 124 of file modint.py.

125  def __rrshift__(self, y):
126  if isinstance(y, moduint):
127  cls = self.maxcast(y)
128  return cls(y.arg >> self.arg)
129  else:
130  return self.__class__(y >> self.arg)

+ Here is the call graph for this function:

def miasm2.expression.modint.moduint.__rshift__ (   self,
  y 
)
inherited

Definition at line 131 of file modint.py.

132  def __rshift__(self, y):
133  if isinstance(y, moduint):
134  cls = self.maxcast(y)
135  return cls(self.arg >> y.arg)
136  else:
137  return self.__class__(self.arg >> y)

+ Here is the call graph for this function:

def miasm2.expression.modint.moduint.__rsub__ (   self,
  y 
)
inherited

Definition at line 138 of file modint.py.

139  def __rsub__(self, y):
140  if isinstance(y, moduint):
141  cls = self.maxcast(y)
142  return cls(y.arg - self.arg)
143  else:
144  return self.__class__(y - self.arg)

+ Here is the call graph for this function:

def miasm2.expression.modint.moduint.__rxor__ (   self,
  y 
)
inherited

Definition at line 145 of file modint.py.

146  def __rxor__(self, y):
147  return self.__xor__(y)

+ Here is the call graph for this function:

def miasm2.expression.modint.moduint.__sub__ (   self,
  y 
)
inherited

Definition at line 148 of file modint.py.

149  def __sub__(self, y):
150  if isinstance(y, moduint):
151  cls = self.maxcast(y)
152  return cls(self.arg - y.arg)
153  else:
154  return self.__class__(self.arg - y)

+ Here is the call graph for this function:

def miasm2.expression.modint.moduint.__xor__ (   self,
  y 
)
inherited

Definition at line 155 of file modint.py.

156  def __xor__(self, y):
157  if isinstance(y, moduint):
158  cls = self.maxcast(y)
159  return cls(self.arg ^ y.arg)
160  else:
161  return self.__class__(self.arg ^ y)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

def miasm2.expression.modint.moduint.maxcast (   cls,
  c2 
)
inherited

Definition at line 17 of file modint.py.

17 
18  def maxcast(cls, c2):
19  c2 = c2.__class__
20  if cls.size > c2.size:
21  return cls
22  else:
23  return c2

+ Here is the caller graph for this function:

Member Data Documentation

miasm2.expression.modint.modint.arg

Definition at line 183 of file modint.py.


The documentation for this class was generated from the following file: