Summary of the invention
Based on this, it is necessary to often there are problems that hysteresis quality the monitoring result that existing monitoring mode provides, provide
A kind of self checking method of randomizer, selftest module and randomizer.
On the one hand, the embodiment of the present invention provides a kind of randomizer, including random source generating circuit, post processing circuitry
With random number hardware check module;
The random source generating circuit merges into the multichannel initial random number for generating multichannel initial random number
Preliminary random number sequence exports the preliminary random number sequence to the post processing circuitry;
The post processing circuitry is used to carry out the preliminary random number sequence of input equilibrium treatment, and export all the way finally with
Machine Number Sequence;
Random number channel in the random number hardware check module and the randomizer corresponds, for supervising
Whether the random number sequence surveyed in each random number channel meets setting condition;
Wherein, the random number channel includes: the output channel of the multichannel initial random number, and the stochastic source generates electricity
The output channel of the output channel on road and the post processing circuitry;The setting condition includes: can be by correct randomness
Monitoring has unpredictability, and cannot repeat to generate.
In one embodiment, the random source generating circuit include: multiple Chaos dynamic systems, multiple exclusive or chains with
And first XOR circuit;
The output end of multiple Chaos dynamic systems connects the input terminal of an exclusive or chain;The output end of multiple exclusive or chains connects
The input terminal of first XOR circuit;The output end of first XOR circuit connects the stochastic source and generates electricity
The output end on road;
The output channel of the multichannel initial random number includes: the output channels of multiple Chaos dynamic systems and multiple
The output channel of exclusive or chain.
In one embodiment, the post processing circuitry includes: the second XOR circuit and multiple d type flip flops;Institute
Multiple d type flip flop cascades are stated, the input terminal of the post processing circuitry is connected positioned at the input terminal of the first d type flip flop;It is described more
The output end of a d type flip flop grade is also respectively connected with the input terminal of second XOR circuit;The second XOR logic electricity
The output end on road connects the output end of the randomizer.
In one embodiment, in the random source generating circuit, every two Chaos dynamic system connection one is different
Or the input terminal of chain.
It in one embodiment, include four exclusive or chains, four exclusive or chains in the random source generating circuit
Output end be all connected with the input terminal of first XOR circuit.
It in one embodiment, include 128 d type flip flops, 128 d type flip flop grades in the post processing circuitry
Connection connection.
In one embodiment, the random number hardware check module includes startup monitoring modular and online prison
Survey module;
The startup monitoring modular has just powered in the randomizer or randomizer is from closing
It is run when turning to enabled, whether the random number sequence for monitoring corresponding random number channel output meets the setting condition;
When the randomizer operates normally, the online monitoring modular operation, the startup monitors mould
Block is out of service;Whether the random number sequence that the online monitoring modular is used to monitor corresponding random number channel output meets
The setting condition;The randomizer is when the monitoring of the startup monitoring modular passes through, into normal operation rank
Section.
In one embodiment, the startup monitoring modular includes the monitoring modular based on playing card monitoring principle;
The online monitoring modular includes being based on single-bit frequency monitoring principle, distance of swimming sum monitoring principle or matrix
The monitoring modular of order monitoring principle.
On the other hand, a kind of random number hardware check module of randomizer, including startup monitoring modular are provided
With online monitoring modular;
The startup monitoring modular has just powered in the randomizer or randomizer is from closing
It is run when turning to enabled, the random number sequence of the random number channel output for monitoring the random number hardware check module connection
Whether the setting condition is met;
When the randomizer operates normally, the online monitoring modular operation, the startup monitors mould
Block is out of service;The online monitoring modular is used to be monitored the data of the corresponding random number channel output.
On the other hand, a kind of self checking method of randomizer, for example any of the above-described reality of the randomizer are provided
It applies described in example, the self checking method includes:
When the randomizer powers on or turns to enabled state from closed state, multiple random number hardware checks
Module starting;The number that random number channels multiple in the randomizer are exported by multiple random number hardware check modules
According to progress first stage monitoring;
It is described random if the first stage monitoring result in the road randomizer Zhong Mei random number channel is to pass through
Number generator enters normal operating phase;Otherwise, pass through corresponding random number hardware check module output abnormality standby signal;
In the randomizer normal operating phase, by the multiple random number hardware check module to it is described with
The data of multiple random number channel outputs carry out second stage monitoring in machine number generator;If any in the randomizer
The second stage monitoring result in road random number channel is not pass through, hard by the corresponding random number in any road random number channel
Part selftest module output abnormality standby signal;
First stage monitoring and second stage monitoring are whether to monitor random number sequence in random number channel
Meet and impose a condition: can be monitored by correct randomness, there is unpredictability, and cannot repeat to generate.
A technical solution in above-mentioned technical proposal has the following advantages that or the utility model has the advantages that increases in randomizer
If random number hardware check module, startup monitoring and online are carried out with the randomness to data source in randomizer
Two kinds of hardware are monitored to monitor automatically;And it is divided into the real-time monitoring powered in initial stage and the course of work, random number is occurred
Device carries out the different monitorings of different phase.By carrying out hardware check to randomizer, eliminate in software monitors mode
The software monitors platform needed;And the real time monitoring function in randomizer use process is increased, is conducive to ensure
Randomizer exports normal random number sequence, improves the safety of the affiliated chip of randomizer, and simplify
Monitoring environmental requirement.
Specific embodiment
In order to make the objectives, technical solutions, and advantages of the present invention clearer, with reference to the accompanying drawings and embodiments, right
The present invention is further elaborated.It should be appreciated that the specific embodiments described herein are merely illustrative of the present invention, and
It is not used in the restriction present invention.
Referenced herein " embodiment " is it is meant that a particular feature, structure, or characteristic described can wrap in conjunction with the embodiments
It is contained at least one embodiment of the application.Each position in the description occur the phrase might not each mean it is identical
Embodiment, nor the independent or alternative embodiment with other embodiments mutual exclusion.Those skilled in the art explicitly and
Implicitly understand, embodiment described herein can be combined with other embodiments.
The safety monitoring method of randomizer provided by the present application can be applied to application ring as shown in Figure 1
In border.The randomizer includes: random source generating circuit, post processing circuitry and random number hardware check module.Each portion
Divide and be mainly responsible for: the random source generating circuit is closed for generating multichannel initial random number, and by the multichannel initial random number
And be preliminary random number sequence, the preliminary random number sequence is exported to the post processing circuitry;The post processing circuitry is used
In the preliminary random number sequence progress equilibrium treatment to input, and export final random number sequence all the way;The random number hardware
Random number channel in selftest module and the randomizer corresponds, for monitor in each random number channel with
Whether machine Number Sequence meets setting condition.
In the embodiment of the present invention, random number channel not only include the final random number output channel of randomizer (i.e.
The output channel of the post processing circuitry), it further include the output channel of multichannel initial random number;Therefore, in randomizer
In, random number channel has multiple, and accordingly, random number hardware check module also has multiple, and random number hardware check module
It is corresponded with random number channel.It should be understood that in randomizer, random number hardware is certainly in the embodiment of the present invention
Examine module in a manner of hardware existing for, it is corresponding without separately setting during the safety monitoring of randomizer
Software monitors platform.
Refering to what is shown in Fig. 1, in some embodiments, random source generating circuit may further include: multiple chaos power
System, multiple exclusive or chains and the first XOR circuit.The output end of multiple Chaos dynamic systems connects an exclusive or chain
Input terminal;The output end of multiple exclusive or chains connects the input terminal of first XOR circuit;The first XOR logic electricity
The output end on road connects the output end of the random source generating circuit.Accordingly, the output channel of multichannel initial random number can be with
It specifically includes: the output channel of the output channel of multiple Chaos dynamic systems and multiple exclusive or chains.
With further reference to shown in Fig. 1, in some embodiments, post processing circuitry be may further include: the second exclusive or is patrolled
Collect circuit and multiple d type flip flops;The multiple d type flip flop cascade, the input terminal connection rear place positioned at the first d type flip flop
Manage the input terminal of circuit;The output end of the multiple d type flip flop grade is also respectively connected with the input of second XOR circuit
End;The output end of second XOR circuit connects the output end of the randomizer, for exporting random number sequence
Column.
Refering to what is shown in Fig. 2, include 128 d type flip flops (i.e. DFF) in post processing circuitry in some embodiments, it is described
128 d type flip flop cascade connections, thus obtained random number can meet State Commercial Cryptography Administration's requirement.
Further, each section in above-mentioned randomizer is described as follows:
Chaos dynamic system, as stochastic source, each Chaos dynamic system is for generating initial random number all the way;
Exclusive or chain, the initial random number that multiple Chaos dynamic systems for connecting to it generate merge processing, obtain
To preliminary random number all the way.
The dynamic factor of usual Chaos dynamic system is 1.54, much smaller than preferably exerting sharp displacement maps dynamic factor 2 again,
So will cause the loss of information content, therefore closed by the initial random number that exclusive or chain generates multiple Chaos dynamic systems
And to promote the information content of the random number all the way of output, while removing in the initial random number data that Chaos dynamic system generates
Correlation between adjacent bit.In some embodiments, refering to what is shown in Fig. 2, in random source generating circuit, two same mechanism
Chaos dynamic system connect an exclusive or chain, the initial random number that two Chaos dynamic systems are generated by the exclusive or chain into
Row processing, obtains preliminary random number all the way.
First XOR circuit, if the preliminary random number exclusive or in main line for exporting random source generating circuit is at one
Road;Correlation in preliminary random number sequence for removing random source generating circuit output between adjacent bit simultaneously.
Multistage d type flip flop and the second XOR circuit structure, for guarantee randomizer output it is final with
0 and 1 distributing homogeneity in machine Number Sequence, that is, guarantee the final random number equiblibrium mass distribution of output, while realizing removal multistage D touching
Send out the purpose of the correlation in the random number sequence of device output between adjacent bit.
In some embodiments, refering to what is shown in Fig. 2, in random source generating circuit, the chaos dynamical system of two same mechanism
System one exclusive or chain of connection, and be provided with 4 exclusive or chains, then in corresponding randomizer, random number channel (i.e. to
Monitoring data source) totally 14 tunnel, it is divided into 4 classes:
The first kind: the output of 8 Chaos dynamic systems amounts to 8 tunnels;
Second class: the preliminary random number 1~4 obtained after every two Chaos dynamic system data processing amounts to 4 tunnels;
Third class: after 4 circuit-switched datas are merged into all the way by the first XOR circuit, into before postposition DFF module
Preliminary random number, amount to 1 tunnel;
4th class: the final true random number sequence of randomizer output amounts to 1 tunnel.
Relative to common randomizer, randomizer shown in Fig. 2 increases post processing circuitry, will be at the beginning of four tunnels
Step random number is merged into after a circuit-switched data, guarantees in random number sequence 0 and 1 distributing homogeneity by multistage d type flip flop,
It is merged into all the way finally by the second XOR circuit, obtains final random number output.
In the embodiment of the present invention, under normal circumstances, each road data source to be monitored should meet following condition: can be by correct
Randomness monitoring, have unpredictability, and cannot repeat generate.
In addition, in embodiments of the present invention, multiple random number hardware check modules are additionally provided in randomizer, with
Whether machine number hardware check module and data source to be monitored correspond, be respectively used to monitor every road data source to be monitored to meet and set
Provisioning request.It further include multiple centres in randomizer since data source to be monitored not only includes final random number sequence
Data source, therefore be conducive to improve the instantaneity of monitoring.
Refering to what is shown in Fig. 3, in one embodiment, random number hardware check module include startup monitoring modular and
Online monitoring modular, when randomizer has just powered on or randomizer turns to enabled from closing, by more
The startup monitoring modular of a random number hardware check module respectively monitors each road data source to be monitored, only respectively simultaneously
After the startup monitoring of road data source to be monitored passes through, just allow the final random number sequence of randomizer generation.?
After randomizer is monitored by startup, in course of normal operation, further pass through multiple random number hardware check moulds
The online monitoring modular of block respectively monitors each road data source to be monitored simultaneously, once monitor certain number to be monitored all the way
It is unsatisfactory for imposing a condition according to source, then provides the monitoring result of randomizer exception.
Specifically, the startup monitoring modular can specifically include the monitoring modular based on playing card monitoring principle;It is described
Online monitoring modular can be specifically included is supervised based on single-bit frequency monitoring principle, distance of swimming sum monitoring principle or rank of matrix
Survey the monitoring modular of principle.Wherein, to the monitoring of the playing card of random number sequence, the monitoring of single-bit frequency, the monitoring of distance of swimming sum or
The specific monitoring mode of rank of matrix monitoring can be carried out in conjunction with actual scene demand according to the related monitoring mode recorded, right
This is not construed as limiting.
Relative to traditional software monitors method, the monitoring method of the embodiment of the present invention can eliminate the lag of monitoring result
Property, convenient for finding the exception of randomizer in time, and simplify monitoring environmental requirement.
In one embodiment, as shown in figure 4, a kind of safety monitoring method of randomizer is provided, with this
Method is applied to be illustrated for the randomizer in Fig. 1, comprising the following steps:
S110, when monitoring that randomizer powers on or turns to enabled state from closed state, starting random number hair
Random number hardware check module in raw device.By multiple random number hardware check modules to multiple in the randomizer
The data of random number channel output carry out first stage monitoring.
S120 runs startup monitoring modular after each random number hardware check module starting first;By described
Startup monitoring modular is monitored the road randomizer Zhong Mei data source to be monitored.
S130, if the monitoring result of the startup monitoring modular of all random number hardware check modules is to pass through, i.e., at random
The road number generator Zhong Mei data source to be monitored meets setting condition, and randomizer enters normal operating phase, into step
Otherwise rapid S140 enters step S160.
In some embodiments, startup monitoring modular can be using playing card monitoring principle to every road data source to be monitored
It is monitored, according to the actual situation, startup monitoring modular, which can also use, need to meet the random of national Password Management office promulgation
Other monitoring principles of number monitoring standard are to every road data source to be monitored.
S140, the online in the randomizer normal operating phase, each random number hardware check module
Monitoring modular operation, startup monitoring modular stop monitoring;It is supervised by the online of all random number hardware check modules
Module is surveyed, the road randomizer Zhong Ge data source to be monitored is monitored.
In the embodiment of the present invention, by the startup monitoring modular of the multiple random number hardware check module, to described
The data of multiple random number channel outputs carry out second stage monitoring in randomizer.
S150 leads to if the online monitoring result in any road random number channel is not pass through in the randomizer
Cross the corresponding random number hardware check module output abnormality standby signal in any road random number channel.
In randomizer normal operating phase, if some online monitoring module monitors to rise a corresponding number to be monitored
Setting condition is not met according to source, then by the random number hardware check module where the online monitoring modular, is exported corresponding
The standby signal of data source exception to be monitored.
In some embodiments, online monitoring modular can be monitored using single-bit frequency monitoring principle, distance of swimming sum
Principle or the road rank of matrix monitoring principle Deng Duimei data source to be monitored are monitored, and according to the actual situation, online monitors mould
Block can also wait supervising using other monitoring principles that need to meet the random number monitoring standard that national Password Management office promulgates to every road
Measured data source.
S160 leads to if the startup monitoring result in any road random number channel is not pass through in the randomizer
Cross the corresponding random number hardware check module output abnormality standby signal in any road random number channel.
Wherein, random number hardware check module, which exports corresponding abnormal prompt signal, can be voice signal either instruction
Modulating signal.
The safety monitoring method of randomizer through the foregoing embodiment, it is each random in randomizer
Random number hardware check module is added in number channel, with the randomness of the data source to random numbers multiple in randomizer channel
It carries out startup monitoring and online monitors the hardware in two stages and monitors automatically;And it is divided into and powers on initial stage and work
Real-time monitoring in the process carries out the different of different phase to randomizer and monitors.By being carried out to randomizer
Hardware check eliminates the software monitors platform needed in software monitors mode;And it increases randomizer to use
Real time monitoring function in journey is conducive to ensure that randomizer exports normal random number sequence, improves random number hair
The safety of the raw affiliated chip of device.
It should be understood that for the various method embodiments described above, although each step in flow chart is according to arrow
Instruction is successively shown, but these steps are not that the inevitable sequence according to arrow instruction successively executes.Unless having herein bright
True explanation, there is no stringent sequences to limit for the execution of these steps, these steps can execute in other order.And
And at least part step in the flow chart of embodiment of the method may include multiple sub-steps or multiple stages, this is a little
Step or stage are not necessarily to execute completion in synchronization, but can execute at different times, these sub-steps
Perhaps the execution sequence in stage be also not necessarily successively carry out but can with the sub-step of other steps or other steps or
At least part in person's stage executes in turn or alternately.
Each technical characteristic of above embodiments can be combined arbitrarily, for simplicity of description, not to above-described embodiment
In each technical characteristic it is all possible combination be all described, as long as however, the combination of these technical characteristics be not present lance
Shield all should be considered as described in this specification.
In the above-described embodiments, it all emphasizes particularly on different fields to the description of each embodiment, there is no the portion being described in detail in some embodiment
Point, it may refer to the associated description of other embodiments.
The term " includes " of embodiment hereof and " having " and their any deformations, it is intended that cover non-exclusive packet
Contain.Such as contain series of steps or the process, method, system, product or equipment of (module) module are not limited to arrange
Out the step of or module, but optionally further comprising the step of not listing or module, or optionally further comprising for these mistakes
Journey, method, product or equipment intrinsic other steps or module.
Referenced herein " multiple " refer to two or more."and/or", the association for describing affiliated partner are closed
System indicates may exist three kinds of relationships, for example, A and/or B, can indicate: individualism A exists simultaneously A and B, individualism
These three situations of B.Character "/" typicallys represent the relationship that forward-backward correlation object is a kind of "or".
Referenced herein " first second " be only be the similar object of difference, do not represent for the specific of object
Sequence, it is possible to understand that specific sequence or precedence can be interchanged in ground, " first second " in the case where permission.It should manage
The object that solution " first second " is distinguished is interchangeable under appropriate circumstances so that the embodiments described herein can in addition to
Here the sequence other than those of diagram or description is implemented.
The several embodiments of the application above described embodiment only expresses, the description thereof is more specific and detailed, but simultaneously
It cannot therefore be construed as limiting the scope of the patent.It should be pointed out that coming for those of ordinary skill in the art
It says, without departing from the concept of this application, various modifications and improvements can be made, these belong to the protection of the application
Range.Therefore, the scope of protection shall be subject to the appended claims for the application patent.