From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oa1-x2b.google.com (mail-oa1-x2b.google.com [IPv6:2001:4860:4864:20::2b]) by sourceware.org (Postfix) with ESMTPS id 3194838582A8 for ; Fri, 22 Jul 2022 17:15:06 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 3194838582A8 Received: by mail-oa1-x2b.google.com with SMTP id 586e51a60fabf-10d9137bd2eso7064852fac.3 for ; Fri, 22 Jul 2022 10:15:06 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:references:from:organization:in-reply-to :content-transfer-encoding; bh=stoDoLjtYkk/P/Bt3atzCbUf1jSaXn8qCvLyXIRFpK0=; b=niTrsSIhYWlJ+v/li8XAFUe22E0ha04sqap+9SikIw4SnBm7N/FNJ7ZGj49tewQjHi SM+ZsxstU2jGzH6ZA1GDPTHMoesBdcCjMBpai1Z/pISsYeQeb9m7xQJ+lB9j9yCQ4BvP P7f0MEcfHacHDmYuKimY6DAU58FYvqMA0uiOXPpl9DcCUxYMt74JUbCsAPDCE+q4ct+f YAhBJqmD1lg/LyhwVaYiVKqjUVkzEk5gwq3LNBdR0wxbNvmdXI/YkhYZLJhhGUYozLlJ yodH6B1CuG2OHT0zPnp+NmsMwDlj7HlheLkY6yOMg3tujSp5/KuDq8ixZuChPL8zn2S0 QFYg== X-Gm-Message-State: AJIora+vPcx5c1TenD8UFNBuzefb4CV/zch3nYAfbrsXnjHM3+4TB9gv 6TEb6qLQlPEzggxMBDyj4w+aVDLMCLbcZg== X-Google-Smtp-Source: AGRyM1uU8n5f5F+s/1yETnzJuUVBoobyTLnLfaLwQnM5/dNH+F6dXCc1er24iyHbtckXmz831Fw91g== X-Received: by 2002:a05:6870:3282:b0:10d:7164:c66e with SMTP id q2-20020a056870328200b0010d7164c66emr549218oac.147.1658510105368; Fri, 22 Jul 2022 10:15:05 -0700 (PDT) Received: from ?IPV6:2804:431:c7cb:8ded:c15d:b142:fa26:49e5? ([2804:431:c7cb:8ded:c15d:b142:fa26:49e5]) by smtp.gmail.com with ESMTPSA id t15-20020a056870638f00b0010d75440f41sm2422417oap.45.2022.07.22.10.15.04 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 22 Jul 2022 10:15:05 -0700 (PDT) Message-ID: <9a53815c-5b85-1426-645f-016067f7e953@linaro.org> Date: Fri, 22 Jul 2022 14:15:02 -0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.0.3 Subject: Re: [PATCH v12 9/9] manual: Add documentation for arc4random functions Content-Language: en-US To: Zack Weinberg , libc-alpha@sourceware.org References: <20220722122137.3270666-1-adhemerval.zanella@linaro.org> <20220722122137.3270666-10-adhemerval.zanella@linaro.org> <53167bfe-a962-a9e2-5adc-185759104d87@owlfolio.org> From: Adhemerval Zanella Netto Organization: Linaro In-Reply-To: <53167bfe-a962-a9e2-5adc-185759104d87@owlfolio.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-5.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Jul 2022 17:15:07 -0000 On 22/07/22 12:33, Zack Weinberg via Libc-alpha wrote: > On 2022-07-22 8:21 AM, Adhemerval Zanella via Libc-alpha wrote: >> +Although these functions provide higher random quality than ISO, BSD, and >> +SVID functions, these still use a Pseudo-Random generator and should not >> +be used in cryptographic contexts. > > Huh? Isn't the whole point of arc4random that it _is_ cryptographically strong? > > zw Even OpenBSD manual is not clear about it [1]. This implementation is similar to OpenBSD, the main differences is that glibc implements a per-thread buffer instead of a global state (and although OpenBSD does think a global state is good qualitiy the are candid say they have no formal proof of these qualities [2]); and fork handling is done by glibc instead of relying on kernel (I do want to see if we can use a block allocator in this case). The main problem is if we state this is a CSRNG we need to certify somehow, which I don't have the background to do; and it might incur in extra certification depending of the intended glibc usage [2]. So I think it would be a more conservative approach to state our implementation is not a CSRNG (although it does follow most of the principles layout as fast-key-erasure random-number generators [4]). [1] https://sourceware.org/pipermail/libc-alpha/2022-July/140728.html [2] https://www.youtube.com/watch?v=gp_90-3R0pE [3] https://sourceware.org/pipermail/libc-alpha/2022-July/140782.html [4] http://blog.cr.yp.to/20170723-random.html