MCPcopy Create free account
hub / github.com/Derious/cuMPC / EvalFullRecursive

Function EvalFullRecursive

mpc_keys/fss_keygen.h:340–377  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

338}
339
340void EvalFullRecursive(AES_KEY *key, unsigned char *k, uint128_t s, uint8_t t, size_t lvl, size_t stop, std::vector<uint8_t> &res)
341{
342 if (lvl == stop + 1)
343 {
344 uint128_t finalblock;
345 memcpy(&finalblock, &k[18 * (lvl)], 16);
346 uint128_t res_local = s;
347 res_local = res_local ^ finalblock.select(t);
348 uint8_t tmp[16];
349 res_local.to_bytes(tmp);
350 res.insert(res.end(), &tmp[0], &tmp[16]);
351 return;
352 }
353
354 uint128_t sL, sR;
355 int tL, tR;
356 Double_PRG(key, s, sL, sR, tL, tR);
357
358 if (t)
359 {
360 uint128_t sCW;
361 int tCW[2];
362
363 memcpy(&sCW, &k[(lvl) * 18], 16);
364
365 // block* sCW = (block*) key.data() + 17 + lvl*18;
366 tCW[0] = k[18 * (lvl) + 16];
367 tCW[1] = k[18 * (lvl) + 17];
368 tL ^= tCW[0];
369 tR ^= tCW[1];
370 sL ^= sCW;
371 sR ^= sCW;
372 }
373 // Log::v("-sL", sL);
374 EvalFullRecursive(key, k, sL, tL, lvl + 1, stop, res);
375 // Log::v("-sR", sR);
376 EvalFullRecursive(key, k, sR, tR, lvl + 1, stop, res);
377}
378
379std::vector<uint8_t> EvalFull(AES_KEY *key, unsigned char *k, size_t logn)
380{

Callers 1

EvalFullFunction · 0.85

Calls 6

memcpyFunction · 0.85
Double_PRGFunction · 0.85
to_bytesMethod · 0.80
selectMethod · 0.45
insertMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected