Re: [PHP-DEV] BLAKE3 hash

2024-01-29 Thread Hans Henrik Bergan
with https://github.com/php/php-src/commit/52dba99d47563f38d8ed5f84690a3cb2c1785475 , the PR ( https://github.com/php/php-src/pull/13194 ) got the first merge conflict. I fixed it, but what's next? Could vote on it, if there is little more to discuss? quick recap AMD Ryzen 9 7950x: portable

Re: [PHP-DEV] BLAKE3 hash

2024-01-26 Thread Hans Henrik Bergan
just tested ARM Neon optimizations on Oracle Cloud's cheapest ARM VPS: VM.Standard.A1.Flex, Ubuntu 22.04, GCC11.4, results: -O2 portable: 596MB/s -O2 -march=native portable: 601MB/s -O2 ARM Neon optimized implementation: 1138MB/s Again, even with -march=native, the compiler cannot make the

Re: [PHP-DEV] BLAKE3 hash

2024-01-24 Thread Marco Pivetta
On Thu, 25 Jan 2024, 06:22 Hans Henrik Bergan, wrote: > On Wed, 24 Jan 2024 at 17:59, Marco Pivetta wrote: > > > > Depends on the actual numbers: is there any way to make a comparison that > > is relatively stable across architectures? > > > > Would it be feasible to start with the > >

Re: [PHP-DEV] BLAKE3 hash

2024-01-24 Thread Hans Henrik Bergan
On Wed, 24 Jan 2024 at 17:59, Marco Pivetta wrote: > > Depends on the actual numbers: is there any way to make a comparison that > is relatively stable across architectures? > > Would it be feasible to start with the > cross-platform-let-the-compiler-do-its-job version (that somebody may >

Re: [PHP-DEV] BLAKE3 hash

2024-01-24 Thread Marco Pivetta
On Wed, 24 Jan 2024 at 17:55, tag Knife wrote: > Should we even be considering the specific instruction implementations? > I've always been in the camp > Depends on the actual numbers: is there any way to make a comparison that is relatively stable across architectures? Would it be feasible to

Re: [PHP-DEV] BLAKE3 hash

2024-01-24 Thread tag Knife
On Wed, 24 Jan 2024 at 16:27, Hans Henrik Bergan wrote: > Maybe vote on it? (that was suggested in the PR too, > https://github.com/php/php-src/pull/13194#issuecomment-1900430400 ) > > Can think of 6 things > > 1: Should BLAKE3 be added to PHP? yes/no > 2: Should ARM Neon (2007) optimized

Re: [PHP-DEV] BLAKE3 hash

2024-01-24 Thread Hans Henrik Bergan
Maybe vote on it? (that was suggested in the PR too, https://github.com/php/php-src/pull/13194#issuecomment-1900430400 ) Can think of 6 things 1: Should BLAKE3 be added to PHP? yes/no 2: Should ARM Neon (2007) optimized implementation be bundled? yes/no 3: Should x86_64 SSE2 (2000) optimized

Re: [PHP-DEV] BLAKE3 hash

2024-01-21 Thread Hans Henrik Bergan
On Mon, 22 Jan 2024 at 07:10, tag Knife wrote: > > That's why I suggested implementing separate lengths of the like we have for > SHA3, so we could have BLAKE3_256 and BLAKE3_512 and maybe inbetweens. we can look into exposing blake3's XOF (arbitrary length) capabilities after (and if) initial

Re: [PHP-DEV] BLAKE3 hash

2024-01-21 Thread tag Knife
On Fri, 19 Jan 2024 at 21:03, Hans Henrik Bergan wrote: > Having looked into it, it seems difficult after all, > I would want a new $options argument for hash_final(), and some > internal changes to struct php_hash_blake3_ops, > and that internal change would have to be updated for all other

Re: [PHP-DEV] BLAKE3 hash

2024-01-21 Thread tag Knife
On Mon, 22 Jan 2024 at 02:43, Gina P. Banyard wrote: > On Monday, 22 January 2024 at 02:29, tag Knife > wrote: > > That's why I suggested implementing separate length algorithms like we > have > > for SHA3. > > Just an etiquette note, please don't top post on the mailing list. [1] > I have no

Re: [PHP-DEV] BLAKE3 hash

2024-01-21 Thread Gina P. Banyard
On Monday, 22 January 2024 at 02:29, tag Knife wrote: > That's why I suggested implementing separate length algorithms like we have > for SHA3. Just an etiquette note, please don't top post on the mailing list. [1] I have no idea what this sentence is replying to, and it makes following the

Re: [PHP-DEV] BLAKE3 hash

2024-01-21 Thread tag Knife
That's why I suggested implementing separate length algorithms like we have for SHA3. On Fri, 19 Jan 2024 at 21:03, Hans Henrik Bergan wrote: > Having looked into it, it seems difficult after all, > I would want a new $options argument for hash_final(), and some > internal changes to struct

Re: [PHP-DEV] BLAKE3 hash

2024-01-19 Thread Hans Henrik Bergan
Having looked into it, it seems difficult after all, I would want a new $options argument for hash_final(), and some internal changes to struct php_hash_blake3_ops, and that internal change would have to be updated for all other hashes PHP support.. I'm not up for doing that now. And I think it

Re: [PHP-DEV] BLAKE3 hash

2024-01-19 Thread Hans Henrik Bergan
>BLAKE3 has 2 default sizes Nope, only 1 canonical size, 256 bits. *BUT* BLAKE3 is XOF, it can be exactly as long as you want it to be: $ echo test | b3sum --length 5 dea2b412aa - $ echo test | b3sum --length 10 dea2b412aa90f1b43a06 - $ echo test | b3sum --length 32

Re: [PHP-DEV] BLAKE3 hash

2024-01-19 Thread tag Knife
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

[PHP-DEV] BLAKE3 hash

2024-01-19 Thread Hans Henrik Bergan
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