The present invention relates to configuring field programmable gate arrays generally, and more particularly to protecting configuration bitstreams from detection or alteration.
Field programmable gate array devices are logic or mixed signal devices that may be configured to provide a user-defined function. FPGAs are typically configured using data received from a configuration device. This data may be referred to as a configuration bitstream or program object file (POF). This bitstream opens and closes switches formed on an FPGA such that desired electrical connections are made.
Modern FPGAs contain hundreds of thousands of logic gates, as well as processors, memories, dedicated analog function blocks, and other circuits. This extensive circuitry requires a correspondingly long configuration bitstream to configure it. For example, 55 Megabits of configuration data are now needed by some FPGAs.
This configuration data represents an FPGA user design that is the outcome of a huge investment in manpower and research and development costs, often in the million dollar range. To protect this investment, configuration bitstreams are often encrypted. The encrypted bitstream is decrypted using a key stored on the FPGA, and the FPGA is then configured. When the FPGA is configured by a configuration device, the bitstream that is susceptible to detection is encrypted and thus protected.
Unfortunately, problems remain even with encryption. For example, if the encryption key can be determined, for example by examining an FPGA, the encrypted bitstream can be copied and the protected device can be cloned. Alternately, if the key is determined, the device can be reconfigured to provide a different function. This can be particularly problematic if the device is performing an important function, such as network security. Similar problems exist if other types of encoding are used.
Thus, what is needed are circuits, methods, and apparatus that provide encoding keys that cannot readily be determined.
Accordingly, embodiments of the present invention provide circuits, methods, and apparatus that prevent detection of an encryption or encoding key. This key may be used to encode and decode a configuration bitstream for an FPGA or other programmable or configurable device, or it may be used on any device to prevent detection of bitstreams or other types of information, for example, device serial numbers or other identifying or security information.
One embodiment of the present invention alters or masks a first key. The result of this alteration is then used encode a configuration bitstream either directly or after further processing or alteration, and it is stored on an FPGA or other device instead of the first key. The first key can be altered or masked by encryption, scrambling, exclusive-ORing with a second key or other pattern to generate a result. Alternately, other functions, which may be presently known or later developed, can be used to alter or mask the first key, the result of which can then be stored on the FPGA or other device. This masked key is retrieved and used to decode the encoded configuration bitstream either directly or again, after further alteration.
An exemplary embodiment of the present invention uses two keys to form a single encoding key. The encoding key is used to encode a configuration bitstream or other data needing protection, and the encoding key is stored on an FPGA or other device. When the device is to be configured, the key is retrieved and the encoded bitstream is received on the FPGA. The retrieved key is then used to decode the bitstream, which then configures the FPGA.
Another exemplary embodiment of the present invention uses two keys. The first key is used to encode a second key. The result is used to encode the second key again, and both products are stored. When the device is to be configured, both products are retrieved and one is used to decode the other. The result is used to decode the result of the two encoded keys. A key that may then be used to decode an encoded bitstream is decoded using these two keys.
A further embodiment of the present invention stores one or more keys in a one-time programmable memory (OTP) array to prevent their erasure or modification. The encoding key may be further obfuscated by one or more of a number of different methods. For example, the key may be obfuscated before storage. This may be done by encryption, permutation, inversion, compression, or a combination of these or other functions. After retrieval from storage, the reverse is performed to recover the key. Optionally, the key may be further encoded with itself and then used to encode the configuration bitstream. If this optional encoding step is done, the retrieved key is encoded again with itself, and the result is used to decode the bitstream. These and other methods may be used separately or in combination to further obfuscate the key. Various embodiments of the present invention may incorporate one or more of these and the other features described herein.
A better understanding of the nature and advantages of the present invention may be gained with reference to the following detailed description and the accompanying drawings.
PLD 100 also includes a distributed memory structure including RAM blocks of varying sizes provided throughout the array. The RAM blocks include, for example, 512 bit blocks 104, 4K blocks 106 and an M-Block 108 providing 512K bits of RAM. These memory blocks may also include shift registers and FIFO buffers. PLD 100 further includes digital signal processing (DSP) blocks 110 that can implement, for example, multipliers with add or subtract features.
It is to be understood that PLD 100 is described herein for illustrative purposes only and that the present invention can be implemented in many different types of PLDs, FPGAs, and the other types of digital integrated circuits.
While PLDs of the type shown in
System 200 includes a processing unit 202, a memory unit 204 and an I/O unit 206 interconnected together by one or more buses. According to this exemplary embodiment, a programmable logic device (PLD) 208 is embedded in processing unit 202. PLD 208 may serve many different purposes within the system in
Processing unit 202 may direct data to an appropriate system component for processing or storage, execute a program stored in memory 204 or receive and transmit data via I/O unit 206, or other similar function. Processing unit 202 can be a central processing unit (CPU), microprocessor, floating point coprocessor, graphics coprocessor, hardware controller, microcontroller, programmable logic device programmed for use as a controller, network controller, and the like. Furthermore, in many embodiments, there is often no need for a CPU.
For example, instead of a CPU, one or more PLD 208 can control the logical operations of the system. In an embodiment, PLD 208 acts as a reconfigurable processor, which can be reprogrammed as needed to handle a particular computing task. Alternately, programmable logic device 208 may itself include an embedded microprocessor. Memory unit 204 may be a random access memory (RAM), read only memory (ROM), fixed or flexible disk media, PC Card flash disk memory, tape, or any other storage means, or any combination of these storage means.
In typical applications, the activities illustrated in
The following acts typically occur at power up, after a fault or error condition, or at other appropriate times while the FPGA is in use in an electrical system. In act 460, the encrypted bitstream is loaded from the configuration device to the field programmable gate array. In act 470, the encrypted bitstream is decrypted in the FPGA and used to configure the FPGA in act 480. This configuration act configures the FPGA such that it performs the desired function.
Software module 510 receives one or more keys, Key 0515 through Key N 520, from a user, other software program or module, or other appropriate source. For example, one or more of these keys may be provided by the software program 510 itself. Quartus, available from Altera Corporation in San Jose, Calif. is an example of a program that may be used as program 510. Alternately, these keys may be provided by a user, they may be provided or suggested by other software, found in a look-up table or other source, or provided in some other manner. The number of keys actually used may be two, or more than two keys may be used.
These keys are received by software module Function 1530, which performs a first function on the keys to generate an output. This function, as with the other functions in this and the other figures, may include encryption, scrambling, exclusive-ORing, or combination of any of these, their reverse, or other functions. For example, one key may be encoded by the other key using a data encryption standard (DES), triple data encryption standard (3DES), or an advance encryption standard (AES), or software module. Alternately, other types of encryption or ciphering can be used.
The output of the software module, Function 1530, is received by a second software module, Function 2532. This module modifies the output of the first software module, Function 1530, and provides an encoding key at its output. The second software module may perform the same function as the first software module Function 1530, or it may perform a different function.
The output of the software module Function 2540 and the configuration bitstream or program object file 536 are received by an encoding software module, the encoder 534. Alternately, the second software function module, Function 2532, may be omitted, and the output of the first software function module, Function 1530, may be received by the encoder 534. This encoder software module 534 may perform the same function as the first software module Function 1530, or it may perform a different function. The output of the encoding software module 534 provides a masked or encoded configuration bitstream. This encoded bitstream (or encoded program object file, E-POF) is then provided on bus 542 to the configuration device 540. Typically, the configuration device 540 is sold with one or more field programmable gate arrays 550 and they are all then incorporated into an end product. In various embodiments, the configuration device is incorporated as part of the FPGA 550.
The keys, Key 0515 through Key N 520, are also provided to FPGA 550, for example through a JTAG (Joint Test Action Group, IEEE standard 1149.1) or other appropriate interface 562. The FPGA may be an FPGA manufactured by Altera Corporation. The FPGA 550 incorporates a first function block, Function 1560, which receives the keys, Key 0515 through Key N 520. The first function block, Function 1560, performs a function on them to generate an encoded key. This function may be the same as the function performed by the first software module Function 1530. Again, as with all the software modules and function blocks described herein, this function may include encryption, such as DES, 3DES, and AES, exclusive ORing, scrambling, or other function or combination of these or other functions. The encoded key provided by function block Function 1560 is then received by an obfuscation circuit 570. The obfuscation circuit 570 acts to disguise the encoded key. The disguised encoded key is stored in a memory array 580. In this way, even if the contents of the memory array 580 are discovered, the encoded key is protected.
Again, the encoded key is disguised from detection. Specifically, the encoded key itself is not stored, rather a version that has been obfuscated in some way is stored. For example, the key may be permutated and inverted, encrypted, or disguised in some other fashion. Further, in a specific embodiment, the key is safe from erasure or modification since the key is stored in a one-time programmable memory. For example, the key may be stored in an array of one-time programmable fuses. In other embodiments, the key may be stored in a programmable memory array, where after the key is stored, the write-enable line or path to the memory is cut or otherwise disabled.
In typical applications, the configuration bitstream is encoded and stored in a configuration device and the encoded key is stored in the memory array 580 in the device manufacturer or customer's factory. Once the device is in an end product and is being configured, the following activities occur.
The output of the memory array 580 is received by reverse or de-obfuscation circuit 575 which reconstructs the original encoded key. A second function block, Function 2562, receives the encoded key and performs a function on it to regenerate on the FPGA 550 the encoding key used in software 510. This second function block, Function 2562, may be the same function performed by the second software module 534. Again, this function may include encryption, exclusive-ORing, scrambling, or other function or combination of these or other functions.
The output of the second function block, Function 2562 is provided to the decoder 564, which also receives the encoded configuration bitstream on bus 544 from the configuration device 540. Alternately, if the second function software block 532 is omitted, the second function block Function 2562 is similarly omitted. In this case, the output of the de-obfuscation circuit 575 is provided to the decoder 564. The decoder decodes the encoded configuration bitstream and provides a decoded bitstream 590. The FPGA is then configured using the decoded configuration bitstream 590.
In this way, the key stored in the memory array 580 is different from the key used to decode the encoded configuration bitstream. Accordingly, even if the contents of the memory array 580 are discovered, for example by reverse engineering, the key used to encode and decode the configuration bitstream, and thus the configuration bitstream itself, remains protected.
It should be noted that multiple, separate function circuits are shown. In this example, a first function block, Function 1560, a second function block, Function 2562, and a Decoder 564, are shown. In typical embodiments, these are one function block circuit that is reused multiple times. For example, multiplexers at the circuit input and output may be used to direct data to and from the function block at different points in the circuit's operation. In a typical embodiment, this circuit is a dedicated, hardwired circuit, since the encoded configuration bitstream is not available to configure it. In other embodiments, the circuitry may be configurable and configured by bits that are either included in a portion of the bitstream that is not encoded, hardwired into the integrated circuit, or provided in some other appropriate manner. Similar concepts apply to the software program modules included in these figures.
Again, the function blocks is this and the other included examples may provide or include an encryption function. This encryption function may be stand-alone or part of a larger function. The encryption may be AES, though other encryption circuits may be used, for example 3DES, or simply DES circuits, or other proprietary encryption algorithms may be used. Also, unconventional numbers of rounds of encryption may be used. For example, instead of a conventional 10 rounds of AES encoding, 5, 15, or other numbers of rounds may be used. In the future there will be other encryption schemes that will certainly be developed and may alternately be used. In a specific embodiment of the present invention, one or more keys having a length of 128 bits are used, though other lengths, such as 192 and 265 bits, may be used. Also, each device may have an individual key, each design may have a common key, each customer may have a key, or other arrangements may be made.
Also, in some embodiments of the present invention, erasure and modification of the key is prevented by storing the key in a number of one-time programmable fuses. These fuses are typically polysilicon fuses that are either blown or left as a connection. Alternately, as mentioned above, the fuses may be replaced by other nonvolatile memory structures, for example where the means for writing or erasing data stored in the memory structures is permanently disabled once the key is written. For example, a flash memory may be used, where the write enable line is disabled by blowing a fuse once the key is written. This type arrangement removes the necessity of a battery that is found in many prior art solutions. These batteries have been a consistent source of reliability problems and can cause electrostatic discharge thus damaging the device.
Using this type of memory prevents erasure and modification of the contents of the memory 580, thus helping to ensure that the device cannot be reconfigured to perform a different function than what was intended. Further security may be had by using a message authentication function.
In this and the other included figures, the bitstream is encoded then decoded. In some applications, less than the entire bitstream is encoded. For example, there may be header information or the like which is common to all devices and may be generally known. If this information is encrypted, the key could be determined. Accordingly, this information is typically not encoded in embodiments of the present invention.
In act 610, a plurality of keys is received, typically by a software program or module. It will be appreciated by one skilled in the art that these keys may have alternate sources. For example, these keys may be provided by users, software, third parties, or they may originate from other appropriate sources. In act 620, a function is performed on the plurality of keys to generate a first key.
In act 630, a function is performed on the first key to generate a second key. For example, the first key may be encrypted using itself to generate the second key. In act 640, a configuration bitstream is received. This configuration bitstream may be generated by an FPGA place & route tool like Altera's Quartus, or other similar source. In act 650, at least a part of the bitstream is encoded with the second key in order to generate an encoded bitstream. The encoded bitstream is stored in a memory on a configuration device or on an FPGA in act 660.
In act 670, the plurality of keys are received by an FPGA or other configurable integrated circuit. In act 680, a function is performed on the keys to generate the first key. In act 690, the first key is obfuscated or otherwise disguised. The obfuscated first key is stored in memory on a field programmable gate array or other such appropriate device in act 695.
Modifications and variations may be made to this and the other included flowcharts consistent with embodiments of the present invention. For example, the first key may be used to encode the configuration bitstream, that is the function performed to generate the second key is omitted. If act 630 is omitted, then act 730 in the following figure should also be omitted, as is described below.
It will be appreciated by one skilled in the art that these acts may be modified or rearranged, and that some acts may be optional while others may be added consistent with the present invention. For example, if act 630 is not used during the encryption of the bitstream, then act 730 is not needed and should be omitted. In this case, the first key is used to decode the encoded configuration bitstream in act 750.
The software module 810 receives or generates a plurality of keys, Key 0815 through Key N 820. Key 0815 is used to encrypt the configuration bitstream 836 by encoder software module 834. Encoder software module 834 provides an encoded bitstream to the configuration device 840.
The keys, Key 0815 through Key N 820, are also received by the FPGA 850 via JTAG interface 862. Function 1860 performs a function on these keys to generate a first key. The first key is obfuscated, for example by permutation and inversion circuits, encryption, or other function, by circuit 870 and stored in memory 880. The first key, and one or more other keys, are received by Function 2862, which performs a function on them to generate a second key. This second key is obfuscated by circuit 871, and the obfuscated second key is stored in memory 881.
When the device is to be configured, the first key and is received by reverse or de-obfuscation circuit 875, which reconstructs the first key, and provides it to Function 3864 and Function 4866. The second key is received by de-obfuscation circuit 876, which provides it to Function 384. Function 3864 modifies the first and second keys and provides an output to Function 4866. Function 4 reconstructs Key 0815 and provides it to decoder 868. Decoder 868 receives the encoded bitstream on bus 844 and decodes it using Key 0815. The decoded bitstream 890 is then used to configure FPGA 850.
In this figure, the function blocks Function 1860 and Function 2862 may be encryption, scrambling, exclusive-OR, or other types of circuits. The function blocks Function 3864 and Function 4866 are typically the inverse of the above function, and may include decryption, descrambling, exclusive-OR, or other types of circuits.
In act 930, a plurality of keys, including the first key, is received on an FPGA or other configurable device. In act 935, the function is performed on the keys to generate a second key. The second key is obfuscated in act 940 and stored in memory in act 945. In act 950, a plurality of keys including the second key is received, and in act 955 a function is performed on them to generate a third key. The third key is obfuscated in act 960, and in act 965 it is stored in memory.
A function is performed on the second and third keys to generate a fourth key in act 1030. A function is performed on the fourth key and the second key in order to regenerate the first key in act 1035. In act 1040, the encoded configuration bitstream is received. In act 1045, the encoded bitstream is decoded using the regenerated first key. An FPGA or other configurable device is configured in act 1050.
In this figure, the functions performed in acts 1030 and 1035 are likely the inverse of the functions performed in 935 and 955 in
State 1120 is an optional state that may be included on some devices that are consistent with embodiment of the present invention. In this mode, the key or keys are not stored in one-time programmable fuses or other nonvolatile memories, but are instead stored in a volatile memory such as a register. In this mode, if a non-encrypted configuration bitstream is received, the key can be ignored and decrypting circuitry can be bypassed. Typically, test mode access is enabled in this mode, though in alternate embodiments of the present invention test mode access may be disabled. This state may be particularly useful in an application where a panic mode is desirable. For example, during capture of a device, it may be desirable to erase the key making the device inoperable. A panic mode may also be implemented using a one-time programmable fuse array, where all fuses are blown when a panic situation arises and device enters the panic mode.
State 1130 is used when a one-time programmable key is entered into the device. In this mode, the configuration bitstream may either be encrypted or un-encrypted. When a non-encrypted bitstream is entered, the decryption circuitry is bypassed. Typically, a test mode access is enabled in this state. State 1140 is used when it is desirable that only encrypted bitstreams be allowed. Also, test mode access is typically allowed in this mode.
State 1150 requires an encrypted bitstream and allows test mode access once the user enters the correct key into device. If the entered key and the stored key are a match, test access is enabled. In state 1160, no test mode access is allowed under any circumstances. Once a device is in this mode no diagnosis may be made on failed parts.
The state of a particular device may be controlled by a separate state machine, as indicated by the arrows between states, such as arrow 1122. For example, if a device is in the normal, non-secure mode 1110, it may be placed in the volatile key mode 1120, and vice versa. For example, if the power is removed when the device is in the volatile key state 1120, it may return to no key state 1110. Once a higher level of security is required, for example state 1130, it cannot return to a lower security state. This prevents modification of the device once it is in an application.
The above description of exemplary embodiments of the invention has been presented for the purposes of illustration and description. It is not intended to be exhaustive or to limit the invention to the precise form described, and many modifications and variations are possible in light of the teaching above. The embodiments were chosen and described in order to best explain the principles of the invention and its practical applications to thereby enable others skilled in the art to best utilize the invention in various embodiments and with various modifications as are suited to the particular use contemplated.
Number | Name | Date | Kind |
---|---|---|---|
4598170 | Piosenka et al. | Jul 1986 | A |
4812675 | Goetting | Mar 1989 | A |
6212639 | Erickson et al. | Apr 2001 | B1 |
6996713 | Trimberger | Feb 2006 | B1 |
7028191 | Michener et al. | Apr 2006 | B2 |
7197647 | Van Essen et al. | Mar 2007 | B1 |
7299203 | Nelson | Nov 2007 | B1 |
7325141 | Chow et al. | Jan 2008 | B2 |
20020114455 | Asahi et al. | Aug 2002 | A1 |
20020145931 | Pitts | Oct 2002 | A1 |
20020199110 | Kean | Dec 2002 | A1 |
20040186991 | Kobayashi et al. | Sep 2004 | A1 |
20050113070 | Okabe | May 2005 | A1 |
20050289355 | Kitariev et al. | Dec 2005 | A1 |