Skip to main content

Finite-Field Arithmetic

Some protocols used in TLSNotary need to convert two-party sharings of products or sums of some field elements into each other. For this purpose we use share conversion protocols which use oblivious transfer (OT) as a sub-protocol. Here we want to have a closer look at the security guarantees these protocols offer.

Adding covert security

Our goal is to add covert security to our share conversion protocols. This means that we want an honest party to be able to detect a malicious adversary, who is then able to abort the protocol. Our main concern is that the adversary might be able to leak private inputs of the honest party without being noticed. For this reason we require that the adversary cannot do anything which would give him a better chance than guessing the private input at random, which is guessing kk bits with a probability of 2k2^{-k} for not being detected.

In the following we want to have a closer look at how the sender and receiver can deviate from the protocol.

Malicious receiver

Note that in our protocol a malicious receiver cannot forge the protocol output, since he does not send anything to the sender during protocol execution. Even when this protocol is embedded into an outer protocol, where at some point the receiver has to open his output or a computation involving it, then all he can do is to open an output yy' with yyy' \neq y, which is just equivalent to changing his input from bbb \rightarrow b'.

Malicious sender

In the case of a malicious sender the following things can happen:

  1. The sender can impose an arbitrary field element bb' as input onto the receiver without him noticing. To do this he simply sends (tik,tik)(t_i^k, t_i^k) in every OT, where kk is i-th bit of bb'.
  2. The sender can execute a selective-failure attack, which allows him to learn any predicate about the receiver's input. For each OT round ii, the sender alters one of the OT values to be Tik=tik+ciT_i^k = t_i^k + c_i, where ciF,k{0,1}c_i \in \mathcal{F}, \, k \in \{0, 1\}. This will cause that in the end the equation ab=x+ya \cdot b = x + y no longer holds but only if the forged OT value has actually been picked by the receiver.
  3. The sender does not use a random number generator with a seed rr to sample the masks sis_i, instead he simply chooses them at will.

M2A Protocol Review

Without loss of generality let us recall the Multiplication-To-Addition (M2A) protocol, but our observations also apply to the Addition-To-Multiplication (A2M) protocol, which is very similar. We start with a short review of the M2A protocol.

Let there be a sender with some field element aa and some receiver with another field element bb. After protocol execution the sender ends up with xx and the receiver ends up with yy, so that ab=x+ya \cdot b = x + y.

  • a,b,x,yFa,b,x,y \in \mathcal{F}
  • rr - rng seed
  • mm - bit-length of elements in F\mathcal{F}
  • nn - bit-length of rng seed

OT Sender

with input aF,r{0,1}na \in \mathcal{F}, \, r \leftarrow \{0, 1\}^n

  1. Sample some random masks: si=rng(r,i),0i<m,siFs_i = rng(r, i), \, 0 \le i < m, \, s_i \in \mathcal{F}
  2. For every sis_i compute:
    • ti0=sit_i^0 = s_i
    • ti1=a2i+sit_i^1 = a \cdot 2^i + s_i
  3. Compute new share: x=six = - \sum s_i
  4. Send ii OTs to receiver: (ti0,ti1)(t_i^0, t_i^1)

OT Receiver

with input bFb \in \mathcal{F}

  1. Set vi=tibiv_i = t_i^{b_i} (from OT)
  2. Compute new share: y=viy = \sum v_i

Replay protocol

In order to mitigate the mentioned protocol deviations in the case of a malicious sender we will introduce a replay protocol.

In this section we will use capital letters for values sent in the replay protocol, which in the case of an honest sender are equal to their lowercase counterparts.

The idea for the replay protocol is that at some point after the conversion protocol, the sender has to reveal the rng seed rr and his input aa to the receiver. In order to do this, he will send RR and AA to the receiver after the conversion protocol has been executed. If the sender is honest then of course r==Rr == R and a==Aa == A. The receiver can then check if the value he picked during protocol execution does match what he can now reconstruct from RR and AA, i.e. that Tibi==tibiT_i^{b_i} == t_i^{b_i}.

Using this replay protocol the sender at some point reveals all his secrets because he sends his rng seed and protocol input to the receiver. This means that we can only use covertly secure share conversion with replay as a sub-protocol if it is acceptable for the outer protocol, that the input to share-conversion becomes public at some later point.

Now in practice we often want to execute several rounds of share-conversion, as we need to convert several field elements. Because of this we let the sender use the same rng seed rr to seed his rng once and then he uses this rng instance for all protocol rounds. This means we have ll protocol executions anbn=xn+yna_n \cdot b_n = x_n + y_n, and all masks sn,is_{n, i} produced from this rng seed rr. So the sender will write his seed RR and all the AnA_n to some tape, which in the end is sent to the receiver. As a security precaution we also let the sender commit to his rng seed before the first protocol execution. In detail:

Sender
  1. Sender has some inputs ana_n and picks some rng seed rr.
  2. Sender commits to his rng seed and sends the commitment to the receiver.
  3. Sender sends all his OTs for nn protocol executions.
  4. Sender sends tape which contains the rng seed RR and all the AnA_n.
Receiver
  1. Receiver checks that RR is indeed the committed rng seed.
  2. For every protocol execution ll the receiver checks that Tn,ibn,i==tn,ibn,iT_{n, i}^{b_{n, i}} == t_{n, i}^{b_{n, i}}.

Having a look at the ways a malicious sender could cheat from earlier, we notice:

  1. The sender can no longer impose an arbitrary field element bb' onto the receiver, because the receiver would notice that tTt \neq T during the replay.
  2. The sender can still carry out a selective-failure attack, but this is equivalent to guessing kk bits of bb at random with a probability of 2k2^{-k} for being undetected.
  3. The sender is now forced to use an rng seed to produce the masks, because during the replay, these masks are reproduced from RR and indirectly checked via t==Tt == T.