Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7945955
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T01:00:33+00:00 2026-06-04T01:00:33+00:00

I’ve decided to admit defeat. Here is my code. It should build a tree

  • 0

I’ve decided to admit defeat. Here is my code. It should build a tree of the execution of the SHA-2 algorithm for a single chunk 512bit input without preprocessing. However, I turned it down from 64 iterations to 4 iterations because traversing the tree never finished for 64 iterations. Even at 4 iterations, it traverses 10,000 nodes- even when only 1000 have been allocated, including a bunch of constants which are leaves and not even counted in the traversal count. In addition, the assertions guarantee acyclical, and if it was cyclical, it would simply never return, not take forever and then return.

What on earth have I done with this code to cause it to take forever to traverse for such a tiny acyclical tree?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T01:00:35+00:00Added an answer on June 4, 2026 at 1:00 am

    Well, that is to be expected. The tree may be stored in a very compact manner, but it has lots and lots of repeated portions. It is massively big.

    As an example, consider this sequence:

    auto s0 = la.rotate(2) ^ la.rotate(13) ^ la.rotate(22);
    

    Now the s0 tree has three of the original la expressions below it.

    auto t2 = s0 + maj;
    

    … and that tree goes in t2…

    la = t1 + t2;
    

    … which ends up in la again at the end of the loop. So, la has now (at least) three references to the la tree of the previous iteration. The next iteration will again triplicate this. And over and over. From this we can derive a lower bound of 3^64 instances of the original la in the final tree (even though only one will exist in storage). 3^64 is 3.43368382 × 10^30, i.e., about three gazillions.

    The generation of the tree takes the easy route and just reuses the subtrees. The traversal function on the other hand, will end up traversing the same subtree many, many times.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have this code to decode numeric html entities to the UTF8 equivalent character.
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I'm trying to use string.replace('’','') to replace the dreaded weird single-quote character: ’ (aka
I'm trying to create an if statement in PHP that prevents a single post
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
I used javascript for loading a picture on my website depending on which small

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.