From 2a1ca6ae74350aaaeee8671ea381cb78f46ce155 Mon Sep 17 00:00:00 2001 From: Kevin Witlox Date: Thu, 7 Jul 2022 14:39:26 +0200 Subject: [PATCH] Fix cryptic assert statement in oram.py --- Compiler/oram.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Compiler/oram.py b/Compiler/oram.py index d4b43438..f218dfdb 100644 --- a/Compiler/oram.py +++ b/Compiler/oram.py @@ -1227,7 +1227,8 @@ class TreeORAM(AbstractORAM): """ Batch initalization. Obliviously shuffles and adds N entries to random leaf buckets. """ m = len(values) - assert((m & (m-1)) == 0) + if not (m & (m-1)) == 0: + raise CompilerError('Batch size must a power of 2.') if m != self.size: raise CompilerError('Batch initialization must have N values.') if self.value_type != sint: