===
You CANNOT PATENT AN IDEA !!! Period !!! I've done enough Patent Lawsuits to know that is the case!
You CAN PATENT the specific implementation of an idea!
RSA only patented a specific implementation of Powers of X being the base calculation for a numeric result. This means that RSA specifically used the MOD (Modulo) operator after a base number value is raised by a specific power. That modulo result is used for other parts of the algorithm. That is ABSOLUTELY FINE in that a specific order of math operations that is NOT well known by the general public or by someone knowledgeable in the art can result in a difficult-to-factor result. This specific implementation of encryption is MOST DEFINITELY PATENTABLE!
However, my FUNCTIONAL duplicate of this, allows me to create some OTHER software that ENCRYPTS DATA! So WHY, as a business person would I WANT to duplicate the exact algorithm of a competitor, when I want TO IMPLEMENT AN IDEA (i.e. Encrypt Data) but be able to do it faster or with needing less hardware resources! Ergo, I create a NEW encryption algorithm (i.e. ROTATE-DATA-768) that emulates the function (i.e. Encrypt/Decrypt data) but do it FASTER and WITH LESS hardware resources!
---
In terms of hardware, the specific design and layout of the individual gates, pathways and logic of a CPU chip to obtain a specific result is patentable. What is NOT patentable is the IDEA of using junctions, pathways and storage locations to create a CPU or GPU chip of any type or size! In my case, I DO NOT WANT to emulate the pathways of an Intel i9 chip! I have a much fancier layout that spreads simple asynchronous microcores for EVERY TYPE of math and character processing function amongst an entire substrate keeping the cores closest to the cache and long-term memory as possible.
Ergo, I make a chip that allows me to work on 128 different text strings up to 65,535 characters in length AT THE SAME TIME (i.e. in Parallel). This is IDEAL for massively parallel text search algorithms! OR...I add simple microcores that do nothing but add, subtract, multiply, divide, root, power, mod and XOR, OR, AND, NOT, REVERSE BITS, SPIN BITS for an array of 4096 64-bit integer numbers in parallel so I can do a fancy convolution filter in parallel on a single 4K line of 64-bit RGBA video or still image pixels. That is a NEW TYPE of SIMD command so it's patentable! (Not anymore though, since I just disclosed this NOW as being open source under the GNU GPL3 licence!)
Remember, even IN a clean room environment, you are implementing the DUPLICATION OF A FINAL RESULT, not of the process itself! Ergo, you use as much divergence of process as you require so that ANY REASONABLE PATENT EVALUATOR would conclude that while you are implementing the IDEA of say compression or encryption, that the PROCESS of that end result is different enough that you do not infringe on another competitor's patents. They key point is, that you ARE ALLOWED to emulate or duplicate PARTS of a process that are deemed NOT NOVEL or NEW.
i.e. You can "Quote" parts (i.e. a few sentences) of your competitors processes but you CANNOT plagiarize "Entire Paragraphs and Pages" of their work!
.