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.

digraph inheritancee291c1fba7 {
rankdir=LR;
size="8.0, 12.0";
  "ComparisonToft05Mixin" [style="setlinewidth(0.5)",URL="#viff.comparison.ComparisonToft05Mixin",fontname=Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans,height=0.25,shape=box,fontsize=10];
  "PassiveRuntime" [style="setlinewidth(0.5)",URL="passive.html#viff.passive.PassiveRuntime",fontname=Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans,height=0.25,shape=box,fontsize=10];
  "Runtime" -> "PassiveRuntime" [arrowsize=0.5,style="setlinewidth(0.5)"];
  "Toft05Runtime" [style="setlinewidth(0.5)",URL="#viff.comparison.Toft05Runtime",fontname=Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans,height=0.25,shape=box,fontsize=10];
  "ComparisonToft05Mixin" -> "Toft05Runtime" [arrowsize=0.5,style="setlinewidth(0.5)"];
  "PassiveRuntime" -> "Toft05Runtime" [arrowsize=0.5,style="setlinewidth(0.5)"];
  "Runtime" [style="setlinewidth(0.5)",URL="runtime.html#viff.runtime.Runtime",fontname=Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans,height=0.25,shape=box,fontsize=10];
}

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.

digraph inheritance5bed270536 {
rankdir=LR;
size="8.0, 12.0";
  "ComparisonToft07Mixin" [style="setlinewidth(0.5)",URL="#viff.comparison.ComparisonToft07Mixin",fontname=Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans,height=0.25,shape=box,fontsize=10];
  "PassiveRuntime" [style="setlinewidth(0.5)",URL="passive.html#viff.passive.PassiveRuntime",fontname=Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans,height=0.25,shape=box,fontsize=10];
  "Runtime" -> "PassiveRuntime" [arrowsize=0.5,style="setlinewidth(0.5)"];
  "Toft07Runtime" [style="setlinewidth(0.5)",URL="#viff.comparison.Toft07Runtime",fontname=Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans,height=0.25,shape=box,fontsize=10];
  "ComparisonToft07Mixin" -> "Toft07Runtime" [arrowsize=0.5,style="setlinewidth(0.5)"];
  "PassiveRuntime" -> "Toft07Runtime" [arrowsize=0.5,style="setlinewidth(0.5)"];
  "Runtime" [style="setlinewidth(0.5)",URL="runtime.html#viff.runtime.Runtime",fontname=Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans,height=0.25,shape=box,fontsize=10];
}

Previous topic

Paillier Crypto System

Next topic

PRSS Module

This Page