Comparison protocols

Two comparison protocols have been implemented in VIFF. They are available in the classes ComparisonToft05Mixin and ComparisonToft07Mixin. Both protocols have been designed by Tomas Toft.

The classes are mixin classes which means that they are meant to be used (“mixed”) with other classes to build a finished usable class. Two standard “flavors” are provided in the Toft05Runtime and Toft07Runtime.

class viff.comparison.ComparisonToft05Mixin

Comparison by Tomas Toft, 2005.

greater_than_equal(share_a, share_b)

Compute share_a >= share_b.

Both arguments must be from the same field. The result is a GF256 share.

Warning :The result type (GF256) is different from the argument types (general field elements).
class viff.comparison.Toft05Runtime(player, threshold, options=None)

Default mix of ComparisonToft05Mixin and PassiveRuntime.

Inheritance diagram of viff.comparison.Toft05Runtime

class viff.comparison.ComparisonToft07Mixin

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.

greater_than_equal(share_a, share_b)

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.

class viff.comparison.Toft07Runtime(player, threshold, options=None)

Default mix of ComparisonToft07Mixin and PassiveRuntime.

Inheritance diagram of viff.comparison.Toft07Runtime

Previous topic

Paillier Crypto System

Next topic

PRSS Module

This Page