Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:122199 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 77930 invoked from network); 19 Jan 2024 19:20:47 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 19 Jan 2024 19:20:47 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1705692088; bh=JtAaVdxRYq8UL41Sg9WkTY+Afbyi2WUMZXb7TlDDga4=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=PwgAYstgUyv7JGP01RPJkjFhhxZQz7UCVqRrRFl4zh8uvdf89BUBIbkbu5UU0/0W3 ssx93DQNniRFTMFdfU7iHhALspsP+gAzFZzLTZ0DE8V38qP/O+sAyv/dVzxaBd9JUx lvDWqOuvq2ltqxZlcfpQhJoKmcdreFvHeqv9AtbqWIWaN9ds7zcbx5B+QkLE+GoBux rOI2HTDyiW5ylJ4usB9jPdZMGJ/4cJIxhEqRKQNibpg1wOOhMiX1CDHSNw8t8ZoYLn IZ/i0eagH+Mcjk2nC6AJoAl3kpR5gIwe1p3bqJa0pWKGeol3crqgM0w9FdjNf16Kee Ef448Q4ZkmUdA== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 7FBF118005C for ; Fri, 19 Jan 2024 11:21:27 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,FREEMAIL_FROM, HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from mail-pj1-f50.google.com (mail-pj1-f50.google.com [209.85.216.50]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Fri, 19 Jan 2024 11:21:27 -0800 (PST) Received: by mail-pj1-f50.google.com with SMTP id 98e67ed59e1d1-2904d8c29d2so649053a91.2 for ; Fri, 19 Jan 2024 11:20:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1705692045; x=1706296845; darn=lists.php.net; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=1y9t2sWB3V7zCc+LRCvo0GklQTumnlTn2FujT0VadTU=; b=cs6Pf/wF9WiRJU1l90OLFHoBxOCyjJNn1cnvtWFcN7fP8rr0Y8A8alN76h/+de+Obh 4YgK8oLNXDJINF5WWz5wnIliBmxFbRaBZTOBt04/KBwRMO1/goeWDcej/dX4pB5vNaOf Gr5CiTivSy7ow+gfwqLRaRl4QwT9IDm+C3SHIPhGlsYi06GgLS0oM7mB5lK3bScb2Zbm D5ZGFzz5pci0yAlvxA8LuLhKWBlxVOnw2w2DqqLyCZ23fgpVfUbgmuxyJ6GQAFfEE7wQ Hrr8Lex81LY07TfzBXx6dbL+TIsZ52FfRvTJUylmhSofk/RHGISF1QtEdbL1/hgNHOAV YjUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705692045; x=1706296845; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=1y9t2sWB3V7zCc+LRCvo0GklQTumnlTn2FujT0VadTU=; b=Dp+yJm4XHB/83F6rYxEiAD06MNuyflkfbVxlpsLCxzLlP82NjwjZntVoj7koGknYeT 00AUlcKsmDaLBHaa79kqMELKwc5JOZttSRNA089A3QeAZitC3mhLL4K+BxHwh0YzGePE AFke4pSRaqskybqWiKFGXXCtzMup8c6eCSLiBpoPL90NT9D9+vbeaNLmJnBVJ7OrWRJo 2nW2YHY/py3yUeBdrSYFGOM34TyyCyXJ5XK6s84ZvwlHuMG69e0crkaPTPX/47rpxU11 A5VZip1Y8n1M2n/Pw5JnHT0Py6CmPh8r23l4+Pp1YUttccvcXKWIxnsD8A5vokCe4Tst KdMQ== X-Gm-Message-State: AOJu0YxHwO/7PcdNhTPXqpERh1swMW/LTRlFmKiSzN2czwxtstLWRX1b UqW7gCv8+33DCQKW11m2jrySbcLxgdWZSdDjgkB5m+CFpEuyvgl6kAXJWjRM6oxTD32k9QoVf/0 3+Xr0E8hvYstZnV4A960Br4lgknlg1zUzvVw= X-Google-Smtp-Source: AGHT+IHibZDYyXk9qi3AtGxlBjtacX8vNYMMAJVe9EdUQisk134xo0qrVPiKKzR+UPgocH75an9xcEYybF4gEQIpf9A= X-Received: by 2002:a17:90b:30c6:b0:290:1ceb:154f with SMTP id hi6-20020a17090b30c600b002901ceb154fmr225986pjb.34.1705692044852; Fri, 19 Jan 2024 11:20:44 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: Date: Fri, 19 Jan 2024 19:20:33 +0000 Message-ID: To: Hans Henrik Bergan Cc: internals@lists.php.net Content-Type: multipart/alternative; boundary="0000000000006e01b9060f516004" Subject: Re: [PHP-DEV] BLAKE3 hash From: fenniclog@gmail.com (tag Knife) --0000000000006e01b9060f516004 Content-Type: text/plain; charset="UTF-8" On Fri, 19 Jan 2024 at 18:43, Hans Henrik Bergan wrote: > Can we add the BLAKE3 hash? > > Created a PR here: https://github.com/php/php-src/pull/13194 > > BLAKE3 is a very fast ("blazing fast") cryptographically secure hash. It is > the latest iteration of the BLAKE hash, which was a SHA3 finalist~ see > https://github.com/BLAKE3-team/BLAKE3 for more info on BLAKE3. > > In the PR is a portable C implementation, along with optimized ARM-neon and > x86_64 SSE2, SSE41, AVX2, and AVX512 implementations for GCC+unix and > GCC+windows and MSVC (*MSVC is currently only using the portable > implementation, but it should be easy for a developer equipped with MSVC to > enable the optimized implementations. I don't have MSVC personally) > > That means the PR includes ~35 copies of the same algorithm, in > hand-written assembly, optimized for various CPU/compiler/OS combinations. > Which means the PR is hug*e.* > > It would be possible to only ship a subset of them (For example, keeping > just the gcc+unix+SSE2 and gcc+unix+AVX2 and ARM-neon and trash the rest, > would benefit a lot systems in-the-wild, and reduce the size of the PR > substantially) > > It would also be possible to only ship the portable pure C implementation, > but that would also be detrimental to the performance, which is the main > motivator for adding BLAKE3 in the first place. > > But the groundwork to ship them all is already done (see the PR) > > Thoughts? > BLAKE3 has 2 default sizes, BLAKE3_256 and BLAKE3_512. Internally the hashblock size is 512, With other algo's we have added these different hash sizes, would it be possible for you to expose the 2 hash sizes. --0000000000006e01b9060f516004--