GNU social JP
  • FAQ
  • Login
GNU social JPは日本のGNU socialサーバーです。
Usage/ToS/admin/test/Pleroma FE
  • Public

    • Public
    • Network
    • Groups
    • Featured
    • Popular
    • People

Conversation

Notices

  1. Embed this notice
    Ryan Castellucci :nonbinary_flag: (ryanc@infosec.exchange)'s status on Friday, 06-Jun-2025 16:02:20 JST Ryan Castellucci :nonbinary_flag: Ryan Castellucci :nonbinary_flag:

    SHA2's "magic numbers" are uint32s: the fractional parts of the square roots of the first 8 primes and the fractional parts of the cube roots of the first 64 primes.

    A precomputed table is 288 bytes.

    How many bytes of x86_64 assembly would be needed to generate them?

    Reply with your estimate.

    In conversation about 13 days ago from infosec.exchange permalink
    • Embed this notice
      Ryan Castellucci :nonbinary_flag: (ryanc@infosec.exchange)'s status on Friday, 06-Jun-2025 16:57:39 JST Ryan Castellucci :nonbinary_flag: Ryan Castellucci :nonbinary_flag:
      in reply to
      • Ype Kingma

      @KingmaYpe that seems very optimistic, what would that look like?

      In conversation about 13 days ago permalink
    • Embed this notice
      Ype Kingma (kingmaype@mastodon.green)'s status on Friday, 06-Jun-2025 16:57:41 JST Ype Kingma Ype Kingma
      in reply to

      @ryanc

      About 20 instructions should do: 5 to generate the primes, 5 to find the square roots, 5-6 to find the cube roots, and a few more to select the fractional parts and to select the 8 or 64 primes.

      (A few more for bisection or even Newton iteration for the square and cube roots, but that luxury is superfluous here.)

      I wonder how many instructions a superoptimizer would leave of those about 20 instructions.

      In conversation about 13 days ago permalink
    • Embed this notice
      Ryan Castellucci :nonbinary_flag: (ryanc@infosec.exchange)'s status on Saturday, 07-Jun-2025 05:56:25 JST Ryan Castellucci :nonbinary_flag: Ryan Castellucci :nonbinary_flag:
      in reply to
      • Ype Kingma

      @KingmaYpe the score to beat is 164 bytes :-)

      In conversation about 13 days ago permalink
    • Embed this notice
      Ype Kingma (kingmaype@mastodon.green)'s status on Saturday, 07-Jun-2025 05:56:26 JST Ype Kingma Ype Kingma
      in reply to

      @ryanc

      The bit sizes I mentioned are slightly off, I'd better show working code :)
      Maybe later this weekend.

      In conversation about 13 days ago permalink
    • Embed this notice
      Ype Kingma (kingmaype@mastodon.green)'s status on Saturday, 07-Jun-2025 05:56:27 JST Ype Kingma Ype Kingma
      in reply to

      @ryanc

      The program structure is just brute force, linear searches for primes, square roots and cubic roots. The max prime here is 311, and that has 9 bits.

      I assumed one instruction to compute the square of a 32+9 bit number, and 2 instructions for its cube. That was probably too optimistic in both cases.

      In conversation about 13 days ago permalink

Feeds

  • Activity Streams
  • RSS 2.0
  • Atom
  • Help
  • About
  • FAQ
  • TOS
  • Privacy
  • Source
  • Version
  • Contact

GNU social JP is a social network, courtesy of GNU social JP管理人. It runs on GNU social, version 2.0.2-dev, available under the GNU Affero General Public License.

Creative Commons Attribution 3.0 All GNU social JP content and data are available under the Creative Commons Attribution 3.0 license.