From f3dff5d5466aab8afec29a37a3b0735ee931b917 Mon Sep 17 00:00:00 2001 From: Weikeng Chen Date: Tue, 10 Jul 2018 20:13:21 -0700 Subject: [PATCH] reduces the rounds for revealOblivBoolArray --- src/ext/oblivc/obliv_bits.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/ext/oblivc/obliv_bits.c b/src/ext/oblivc/obliv_bits.c index cd5ac7c00..ad5891b0a 100644 --- a/src/ext/oblivc/obliv_bits.c +++ b/src/ext/oblivc/obliv_bits.c @@ -2102,8 +2102,12 @@ bool revealOblivBool(bool * dest, __obliv_c__bool src, int party) bool revealOblivBoolArray(bool *dest, const __obliv_c__bool * src, size_t n, int party) { bool rv = true; - for (size_t ii = 0; ii < n; ii++) - { rv &= revealOblivBool(&dest[ii], src[ii], party); } + if(party != 1) + for (size_t ii = 0; ii < n; ii++) + { rv &= revealOblivBool(&dest[ii], src[ii], 2); } + if(party != 2) + for (size_t ii = 0; ii < n; ii++) + { rv &= revealOblivBool(&dest[ii], src[ii], 1); } return rv; }