Package viff :: Module comparison :: Class ComparisonToft07Mixin
[hide private]
[frames] | no frames]

Class ComparisonToft07Mixin

source code


Efficient comparison by Tomas Toft 2007. This mixin provides a greater_than_equal method which can compare Zp field elements and gives a secret result shared over Zp.
Instance Methods [hide private]
 
convert_bit_share(self, share, dst_field)
Convert a 0/1 share into dst_field.
source code
 
greater_than_equal_preproc(self, field, smallField=None)
Preprocessing for greater_than_equal.
source code
 
greater_than_equal_online(self, share_a, share_b, preproc, field)
Compute share_a >= share_b.
source code
 
_finish_greater_than_equal(self, c, field, smallField, s_bit, s_sign, mask, r_modl, r_bits, z)
Finish the calculation.
source code
 
greater_than_equal(self, share_a, share_b)
Compute share_a >= share_b.
source code
Method Details [hide private]

greater_than_equal_preproc(self, field, smallField=None)

source code 
Preprocessing for greater_than_equal.
Decorators:
  • @profile

greater_than_equal_online(self, share_a, share_b, preproc, field)

source code 
Compute share_a >= share_b. Result is secret shared.
Decorators:
  • @profile

greater_than_equal(self, share_a, share_b)

source code 

Compute share_a >= share_b.

Both arguments must be shares from the same field. The result is a new 0/1 share from the field.