7 from sys
import version_info
as _swig_python_version_info
9 if __package__
or "." in __name__:
15 import builtins
as __builtin__
21 strthis =
"proxy of " + self.this.__repr__()
22 except __builtin__.Exception:
24 return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)
27 def _swig_setattr_nondynamic_instance_variable(set):
28 def set_instance_attr(self, name, value):
30 set(self, name, value)
31 elif name ==
"thisown":
33 elif hasattr(self, name)
and isinstance(getattr(type(self), name), property):
34 set(self, name, value)
36 raise AttributeError(
"You cannot add instance attributes to %s" % self)
37 return set_instance_attr
40 def _swig_setattr_nondynamic_class_variable(set):
41 def set_class_attr(cls, name, value):
42 if hasattr(cls, name)
and not isinstance(getattr(cls, name), property):
45 raise AttributeError(
"You cannot add class attributes to %s" % cls)
49 def _swig_add_metaclass(metaclass):
50 """Class decorator for adding a metaclass to a SWIG wrapped class - a slimmed down version of six.add_metaclass"""
52 return metaclass(cls.__name__, cls.__bases__, cls.__dict__.copy())
56 class _SwigNonDynamicMeta(type):
57 """Meta class to enforce nondynamic attributes (no new attributes) for a class"""
58 __setattr__ = _swig_setattr_nondynamic_class_variable(type.__setattr__)
61 class SwigPyIterator(object):
62 thisown = property(
lambda x: x.this.own(),
lambda x, v: x.this.own(v), doc=
"The membership flag")
64 def __init__(self, *args, **kwargs):
65 raise AttributeError(
"No constructor defined - class is abstract")
67 __swig_destroy__ = _nt.delete_SwigPyIterator
70 return _nt.SwigPyIterator_value(self)
73 return _nt.SwigPyIterator_incr(self, n)
76 return _nt.SwigPyIterator_decr(self, n)
78 def distance(self, x):
79 return _nt.SwigPyIterator_distance(self, x)
82 return _nt.SwigPyIterator_equal(self, x)
85 return _nt.SwigPyIterator_copy(self)
88 return _nt.SwigPyIterator_next(self)
91 return _nt.SwigPyIterator___next__(self)
94 return _nt.SwigPyIterator_previous(self)
97 return _nt.SwigPyIterator_advance(self, n)
100 return _nt.SwigPyIterator___eq__(self, x)
103 return _nt.SwigPyIterator___ne__(self, x)
105 def __iadd__(self, n):
106 return _nt.SwigPyIterator___iadd__(self, n)
108 def __isub__(self, n):
109 return _nt.SwigPyIterator___isub__(self, n)
111 def __add__(self, n):
112 return _nt.SwigPyIterator___add__(self, n)
114 def __sub__(self, *args):
115 return _nt.SwigPyIterator___sub__(self, *args)
120 _nt.SwigPyIterator_swigregister(SwigPyIterator)
122 thisown = property(
lambda x: x.this.own(),
lambda x, v: x.this.own(v), doc=
"The membership flag")
123 __repr__ = _swig_repr
126 return _nt.Basics_greatest_power(self, n, p)
129 return _nt.Basics_op_gcd(self, x, y)
132 _nt.Basics_swiginit(self, _nt.new_Basics())
133 __swig_destroy__ = _nt.delete_Basics
136 _nt.Basics_swigregister(Basics)
138 thisown = property(
lambda x: x.this.own(),
lambda x, v: x.this.own(v), doc=
"The membership flag")
139 __repr__ = _swig_repr
142 return _nt.PrimalityTest_is_prime(self, n)
145 return _nt.PrimalityTest_compute_miller_rabin(self, d, n)
148 return _nt.PrimalityTest_miller_rabin_prime(self, n, iters)
151 return _nt.PrimalityTest_miller_rabin(self, iters, min_val, max_val)
154 return _nt.PrimalityTest_witness(self, n, d, a, s)
157 return _nt.PrimalityTest_AKS(self, n)
160 return _nt.PrimalityTest_jacobian_number(self, a, n)
163 return _nt.PrimalityTest_solovoy_strassen(self, p, iters)
166 return _nt.PrimalityTest_mod_mul(self, a, b, m)
169 return _nt.PrimalityTest_mod_pow(self, a, b, m)
172 return _nt.PrimalityTest_carmichael_num(self, n)
175 return _nt.PrimalityTest_ETF(self, n)
178 _nt.PrimalityTest_swiginit(self, _nt.new_PrimalityTest())
179 __swig_destroy__ = _nt.delete_PrimalityTest
182 _nt.PrimalityTest_swigregister(PrimalityTest)
184 thisown = property(
lambda x: x.this.own(),
lambda x, v: x.this.own(v), doc=
"The membership flag")
185 __repr__ = _swig_repr
188 return _nt.PrimalityGen_sieve_of_eratosthenes(self, n)
191 _nt.PrimalityGen_swiginit(self, _nt.new_PrimalityGen())
192 __swig_destroy__ = _nt.delete_PrimalityGen
195 _nt.PrimalityGen_swigregister(PrimalityGen)
197 thisown = property(
lambda x: x.this.own(),
lambda x, v: x.this.own(v), doc=
"The membership flag")
198 __repr__ = _swig_repr
201 return _nt.Logarithms_pollard_rho_log(self, a, b, m)
204 return _nt.Logarithms_BSGS(self, a, b, m)
207 _nt.Logarithms_swiginit(self, _nt.new_Logarithms())
208 __swig_destroy__ = _nt.delete_Logarithms
211 _nt.Logarithms_swigregister(Logarithms)
213 thisown = property(
lambda x: x.this.own(),
lambda x, v: x.this.own(v), doc=
"The membership flag")
214 __repr__ = _swig_repr
217 return _nt.Factorization_pollard_rho(self, n)
220 _nt.Factorization_swiginit(self, _nt.new_Factorization())
221 __swig_destroy__ = _nt.delete_Factorization
224 _nt.Factorization_swigregister(Factorization)
226 BYTE_LIMIT = _nt.BYTE_LIMIT
228 thisown = property(
lambda x: x.this.own(),
lambda x, v: x.this.own(v), doc=
"The membership flag")
229 __repr__ = _swig_repr
232 return _nt.RC4_byte_swap(self, a, b)
235 return _nt.RC4_trad_swap(self, a, b)
238 return _nt.RC4_XOR_swap(self, a, b)
240 def KSA(self, key, S, swap_type):
241 return _nt.RC4_KSA(self, key, S, swap_type)
243 def PRGA(self, S, plaintext, ciphertext, swap_type):
244 return _nt.RC4_PRGA(self, S, plaintext, ciphertext, swap_type)
247 return _nt.RC4_store_hash(self, plaintext, hashtext, swap_type)
249 def compute(self, key, plaintext, hashtext, swap_type):
250 return _nt.RC4_compute(self, key, plaintext, hashtext, swap_type)
253 _nt.RC4_swiginit(self, _nt.new_RC4())
254 __swig_destroy__ = _nt.delete_RC4
257 _nt.RC4_swigregister(RC4)
259 thisown = property(
lambda x: x.this.own(),
lambda x, v: x.this.own(v), doc=
"The membership flag")
260 __repr__ = _swig_repr
263 return _nt.Cipher_caesar(self, plaintext, key)
266 return _nt.Cipher_keyword_encode(self, key)
269 return _nt.Cipher_keyword(self, plaintext, encoded_text)
272 _nt.Cipher_swiginit(self, _nt.new_Cipher())
273 __swig_destroy__ = _nt.delete_Cipher
276 _nt.Cipher_swigregister(Cipher)
def greatest_power(self, n, p)
def caesar(self, plaintext, key)
def keyword_encode(self, key)
def keyword(self, plaintext, encoded_text)
def pollard_rho_log(self, a, b, m)
def sieve_of_eratosthenes(self, n)
def carmichael_num(self, n)
def miller_rabin_prime(self, n, iters)
def solovoy_strassen(self, p, iters)
def compute_miller_rabin(self, d, n)
def witness(self, n, d, a, s)
def mod_pow(self, a, b, m)
def miller_rabin(self, iters, min_val, max_val)
def mod_mul(self, a, b, m)
def jacobian_number(self, a, n)
def compute(self, key, plaintext, hashtext, swap_type)
def trad_swap(self, a, b)
def PRGA(self, S, plaintext, ciphertext, swap_type)
def store_hash(self, plaintext, hashtext, swap_type)
def KSA(self, key, S, swap_type)
def byte_swap(self, a, b)