From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=pass header.i=@linaro.org header.s=google header.b=n6mPNmHD; spf=pass (domain: linaro.org, ip: 209.85.166.178, mailfrom: ard.biesheuvel@linaro.org) Received: from mail-it1-f178.google.com (mail-it1-f178.google.com [209.85.166.178]) by groups.io with SMTP; Fri, 24 May 2019 08:31:02 -0700 Received: by mail-it1-f178.google.com with SMTP id m140so14423502itg.2 for ; Fri, 24 May 2019 08:31:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=5vLO0QEZR29+z0cBkrCFNPAoCt8VRRfrFqXVU7AK34A=; b=n6mPNmHDn35hw6TM128MXbJCxPNJ2GOZj0D9gxs6nHxgYDcETf1aoOCwDmvBXaTccs vdPMB3dEBB/ErGReL4kt41+luynQSshZs4lWxxSCc3Ln1oDFBrz8qXpMt10XzJbjeE1K vjOdyLdVxvJXy/RlmWgkWuf9KpMnu1x950E13Aylefp5EjsDe4053spJX+wWyEE7wQP4 NVayJlidf8OSnx+wJMrQ4vfPJkuVMQfAnAVv6kf24+2oMx+tGM5qizjFA3guB63XYo4j g2qvUej6764brmFOb0yILEh76rOQA/BONQzr9r4hsc/755GtC9L6SpHJJU2uFHLj6OOA JSfQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=5vLO0QEZR29+z0cBkrCFNPAoCt8VRRfrFqXVU7AK34A=; b=q7bk5BrDAl9JdarWLN6OCFyuFNuBiLekEt5loUexWmKb79hrt41gt3yPUvYofdhoFs zjgM5klxWyamR3lnwOJtzyHCjSnKbqDeILkeeiaqPlQr2VIQ8yT0UUgLVPEkvSbdKDgA urt48LTgB+Fq3jCHbj09tArwdq8Kj86rqyWRRg0XiHNyO5Hlbrp/gVK2Is+v6asZzxxR whxkOegTtjgMD3qN72fuVI9/K8okjeYu33eRtLXtZ6rh//yR5+e/QXzdH3+I5xGIIJ+/ d77/2ETtM1qGdAjUoYtkHUbB64LufIohTJerSZn0Oc98VCJNZO7OmvceHEUgCWpzywzT cWWQ== X-Gm-Message-State: APjAAAXHMyMmJcG9RXZBQlZl6eaPoB4VjlV0Y+IW4Nz/EhA8xA5eX5kW jnJWn3h7J7vvSqgSTw/4H6X46550mIP7hfHKDX45yw== X-Google-Smtp-Source: APXvYqzfq0Je5rsUxj9HwHzHnD5nXU0af42rEY5rqnXSJmFi1Pm8d2D8resksHBetpSIvhDipoSnETfWOSDrMN91BQQ= X-Received: by 2002:a02:a494:: with SMTP id d20mr3858516jam.62.1558711861377; Fri, 24 May 2019 08:31:01 -0700 (PDT) MIME-Version: 1.0 References: <6c4a456a-3198-bfa2-6d89-433e4d3f3fd5@redhat.com> <06ce80d4-02da-4323-af3b-0d0f8be3f6eb@default> In-Reply-To: <06ce80d4-02da-4323-af3b-0d0f8be3f6eb@default> From: "Ard Biesheuvel" Date: Fri, 24 May 2019 17:30:49 +0200 Message-ID: Subject: Re: why does RAND_add() take "randomness" as a "double"? To: Paul Dale Cc: Laszlo Ersek , Jian J Wang , edk2-devel-groups-io , "Lu, XiaoyuX" Content-Type: text/plain; charset="UTF-8" (remove openssl user list) On Wed, 22 May 2019 at 03:48, Paul Dale wrote: > > Double makes sense. Entropy is often estimated as a real value. > > E.g. we have the aforementioned coin flipper feeding data serially. > Adding each bit sequentially means 0.125 bytes of entropy per call. > > Not the best example.... > It looks like the people saying double is a good idea didn't actually look at the code. The double argument is compared to a size_t cast to double, and assigned that same value under some conditions. I think the problem is that the double argument is part of the RAND API, so they cannot easily change it.