A method for deriving a secondary secret from a root secret, the method comprising: a. reserving a memory buffer comprised in an integrated circuit, the memory buffer being large enough to contain all of the bits which will comprise the secondary secret; b. receiving a plurality of bits from a root secret, the root secret being stored in a secure memory of the integrated circuit; c. inputting the plurality of bits from the root secret and at least one control bit into a permutation network, and thereby producing a multiplicity of output bits, the at least one control bit comprising one of: one bit of a value g; and one bit an output of a function which receives g as an input; d. receiving the multiplicity of output bits from the permutation network; e. inputting the multiplicity of output bits from the permutation network into a plurality of logic gates, thereby combining the multiplicity of output bits, wherein a fixed number of bits is output from the logic gates; f. inputting the fixed number of bits output by the logic gates into an error correcting code module, the fixed number of bits output by the logic gates comprising a first group of intermediate output bits and a second group of intermediate output bits and receiving output bits from the error correcting code module, the output bits of the error correcting code module comprising the first group of intermediate output bits as changed by the error correcting code module, where the change depends on the second group of intermediate output bits; g. filling non-filled registers in the reserved memory buffer with the first group of intermediate output bits as changed by the error correcting code module; and h. repeating steps b - g until the entire secondary secret is derived, wherein steps b - g are performed in a single clock cycle of the integrated circuit. a. reserving a memory buffer comprised in an integrated circuit, the memory buffer being large enough to contain all of the bits which will comprise the secondary secret; b. receiving a plurality of bits from a root secret, the root secret being stored in a secure memory of the integrated circuit; c. inputting the plurality of bits from the root secret and at least one control bit into a permutation network, and thereby producing a multiplicity of output bits, the at least one control bit comprising one of: one bit of a value g; and one bit an output of a function which receives g as an input; one bit of a value g; and one bit an output of a function which receives g as an input; d. receiving the multiplicity of output bits from the permutation network; e. inputting the multiplicity of output bits from the permutation network into a plurality of logic gates, thereby combining the multiplicity of output bits, wherein a fixed number of bits is output from the logic gates; f. inputting the fixed number of bits output by the logic gates into an error correcting code module, the fixed number of bits output by the logic gates comprising a first group of intermediate output bits and a second group of intermediate output bits and receiving output bits from the error correcting code module, the output bits of the error correcting code module comprising the first group of intermediate output bits as changed by the error correcting code module, where the change depends on the second group of intermediate output bits; g. filling non-filled registers in the reserved memory buffer with the first group of intermediate output bits as changed by the error correcting code module; and h. repeating steps b - g until the entire secondary secret is derived,