Index Mathematics Conjectures nbv lettuce Widgets

bdlop_milli_config

stdlib/bdlop/bdlop_milli_config.nbv

bdlop_milli_config(N, msg_len)

page 10 and 22 of more efficient vector commitments lettuce/src/commitments/bdlop/spec.pdf https://eprint.iacr.org/2016/997

Precompiles
assert_eq!, if_eq!, println!, sqrt_ceil!
Used by
bdlop/bdlop_linear_nizk_verify

Source

# page 10 and 22 of more efficient vector commitments
# lettuce/src/commitments/bdlop/spec.pdf
# https://eprint.iacr.org/2016/997
(N, msg_len)

static n = 2
static l = msg_len
static k = 1 + n + msg_len
static beta = 1
static mut kappa = 0

if_eq! N, 128 {
  # chosen for 198 bit security
  # log2(binomial_coef(N, kappa) * 2^kappa) = 198.385
  kappa = 80
}

if_eq! N, 64 {
  # for testing only
  # log2(binomial_coef(N, kappa) * 2^kappa) = 90.491
  kappa = 30
  println! "bdlop configuration unsafe! targeting 90 bits of security!"
}

if_eq! N, 256 {
  # ~196 bit security
  kappa = 40
}

if_eq! N, 512 {
  # ~215 bit security
  kappa = 35
}

if_eq! N, 1024 {
  # ~216 bit security
  kappa = 29
}

static SIGMA = 11 * kappa * beta * (sqrt_ceil! (k * N))

static N_ROOT = sqrt_ceil! N
assert_eq! N_ROOT * N_ROOT, N

static L2_NORM_BOUND = 2 * SIGMA * N_ROOT
static L1_NORM_BOUND = 1 # needs config
# we'll do a loose l_infinite norm check by using the l2 norm bound
static L_INF_NORM_BOUND = L2_NORM_BOUND

(N, SIGMA, L_INF_NORM_BOUND, L1_NORM_BOUND, L2_NORM_BOUND)