Secure logical AND using Ishai-Sahai-Wagner Scheme I want to try to implement a secure AND the way it was described here:
https://eprint.iacr.org/2010/441.pdf 

It says that there are two bits a and b and that they have been split into d+1 shares. How can I split a bit? I guess there isn't something more atomic than a bit, isn't it? Can you give me an example on how to do this?
I mean I could say that, for example:

Let $d$ be 4. Assume that $a$ = 1, then I can split it into the following 4 shares: $a_1 = 1, a_2 = 1, a_3 = 1, a_4 = 0$ because then it holds that $1 \mathbin{\oplus}1\mathbin{\oplus}1\mathbin{\oplus}0 = 1 = a$. Is that what is meant with the $d$ shares? I assume these shares are random values?

I tried a first implementation of the secure AND as follows:

void SecAND(char a, char b, char* arr, char* brr)
{
  int i; int j;
  int d = 4;
  int r[4][4];
  int c[4];
  for(i = 0; i &lt; d; i++)
  {
      for(j = i+1; j &lt; d; j++)
      {
          srand(time(NULL));
          int rij = rand() % 2;
          r[i][j] = rij;
      }
  }

  for(i = 0; i &lt; d; i++)
  {
      for(j = i+1; j &lt; d; j++)
      {
          r[j][i] = (r[i][j]^(arr[i]*brr[j]))^(arr[j]*brr[i]);
      }
  }

  for(i = 0; i &lt; d; i++)
  {
      c[i] = (arr[i]*brr[i]);

      for(j = 0; j &lt; d; j++)
      {
          if(j != i)
          {
              c[i] = c[i] ^r[i][j];
          }
      }
  }


}

Can this be correct?
"Splitting into $d + 1$ shares" is mentioned in the Introduction, right after a reference to secret sharing schemes and mentioning threshold property. So, this particular IACR preprint is not the best source on secret sharing. I'd suggest to start from Shamir secret sharing algorithm.