[go: up one dir, main page]

CN104615475A - Safe code generating method and device in safety key system - Google Patents

Safe code generating method and device in safety key system Download PDF

Info

Publication number
CN104615475A
CN104615475A CN201510064871.4A CN201510064871A CN104615475A CN 104615475 A CN104615475 A CN 104615475A CN 201510064871 A CN201510064871 A CN 201510064871A CN 104615475 A CN104615475 A CN 104615475A
Authority
CN
China
Prior art keywords
coding
code word
safety
decoding
mode
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201510064871.4A
Other languages
Chinese (zh)
Other versions
CN104615475B (en
Inventor
李明军
李怡民
李军
张磊
于涛
刘莉娜
张利彪
王珂
曲秋莳
柳志成
马娜
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Traffic In Beijing Transport Professional School
Original Assignee
Traffic In Beijing Transport Professional School
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Traffic In Beijing Transport Professional School filed Critical Traffic In Beijing Transport Professional School
Priority to CN201510064871.4A priority Critical patent/CN104615475B/en
Publication of CN104615475A publication Critical patent/CN104615475A/en
Application granted granted Critical
Publication of CN104615475B publication Critical patent/CN104615475B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Devices For Executing Special Programs (AREA)

Abstract

The invention relates to a safe code generating method in a safety key system. The method comprises the steps that pre-generation information codes are subjected to binary system negation operation, so that source code words are generated; and the source code words are subjected to coding through binary system mathematical calculation. The safe code generating method in the safety key system has safety, convenience, efficiency and algorithm packaging performance, namely a coding function and a decoding function are subjected to object packaging, a client side only needs to use an overall read-only algorithm object, all algorithms can be accessed, and the memory burden of a programmer is lowered. The invention further discloses a safe code generating device in the safety key system.

Description

Safe coding in Safety-Critical System generates method and apparatus
Technical field
The present invention relates to urban rail transit technology field, the safe coding particularly related in a kind of Safety-Critical System generates method and apparatus.
Background technology
At present, in the safety-critical fields such as railway, civil aviaton, space flight, its control axis belongs to Safety-Critical System, must have high security, reliability and robustness.The quality of this type systematic not only depends on it is all correct under likely inputting, and more depends on when having outside electromagnetic interference, mechanical oscillation, thermonoise to exist, software or can normally run or failure to the safe side side.In the technical manual of specific industry, generally all to the program code of security critical software, harsh requirement can be proposed.Such as, in railway systems, " computer interlock technical conditions (draft for deliberation) (V1.31) " 8.4.3 bar and 8.4.4 bar just have clear stipulaties, Hamming distance between the different values of the variable of being correlated with from railway operation safety is not less than 4, and the ratio of illegal code word and legal-code is not less than 255:1.These two regulations are not only applicable to railway systems, are also applicable to the industry to reliability requirement harshness such as civil aviaton, space flight, automobile.
Take a broad view of every profession and trade security critical software, they can be divided into three kinds: one to be sequential encoding to the counte-rplan of these two regulations, namely the value of certain variable carrys out natural coding according to the orders such as 1,2,3,4 completely, this coded system has directly perceived, efficient, understandable advantage, but it have ignored above-mentioned two regulations completely, under complex electromagnetic environment, be vulnerable to the impact of internal memory saltus step, there is great potential safety hazard; Two is random codeds, namely the value of certain variable is determined by randomizer, this mode has advantage easily and efficiently, but the Hamming distance between any two values that it can not ensure same variable is not less than 4, therefore cannot avoid the internal memory jump problem because electromagnetic interference (EMI) etc. causes; Three is code words that manual appointment has specific Hamming distance, this coded system can ensure to observe above-mentioned two safe codings regulation, but easily make mistakes, efficiency is very low, context is extremely inconvenient alternately, often because the factor such as to forget of programmer causes artificially going here and there code, there is very large potential safety hazard.
Summary of the invention
The present invention will solve the above-mentioned technical matters mentioned, and the safe coding that the invention provides in a kind of Safety-Critical System generates method and apparatus.
For this purpose, the present invention proposes a kind of safe coding generation method in Safety-Critical System, comprising:
S1: carry out scale-of-two inversion operation to pre-generatmg information code, generates original code word;
S2: described original code word is encoded by binary math calculating.
Particularly, described step S2 comprises further: provided by the grand mode of C language precompile; Precompile is grand resolved before compiling, carried out macro expansion and constant folding at compile duration.
Particularly, described step S2 comprises further: provided by C language function fashion; The mode mapped by static array returns coding result.
Further, also comprise: the code word after coding is decoded.
Particularly, described to coding after code word decode, specifically comprise: provided by the mode of C language function; Dichotomy is used to carry out searching for and decoding.
For this purpose, the present invention proposes the safe coding generating apparatus in a kind of Safety-Critical System, comprising:
Original code word generation module, for carrying out scale-of-two inversion operation to pre-generatmg information code, generates original code word;
Coding module, for encoding by binary math calculating to described original code word.
Particularly, described coding module, also comprises:
First method providing unit, for providing by the grand mode of C language precompile;
Resolution unit, resolved before compiling for precompile is grand;
Macro operation unit, for carrying out macro expansion and constant folding at compile duration.
Particularly, described coding module, also comprises:
Second method providing unit, for providing by C language function fashion;
Coding result returns unit, returns coding result for the mode mapped by static array.
Further, also comprise: decoder module, for decoding to the code word after coding.
Particularly, described decoder module, also comprises:
Third Way providing unit, for providing by the mode of C language function;
Search and decoding unit, carry out for using dichotomy searching for and decoding.
The invention discloses a kind of safe coding generation method in Safety-Critical System, by carrying out scale-of-two inversion operation to pre-generatmg information code, generating original code word; Original code word is encoded by binary math calculating.Safe coding generation method in a kind of Safety-Critical System that the present invention proposes has security, and the distance namely arbitrarily between code word is all not less than 4, and the ratio of illegal code word and legal-code is far longer than 255:1; Convenience, namely for different variablees, can carry out Code And Decode easily; High efficiency, namely provide two kinds of coding means, the first means only consumes compilation time, expends any working time hardly, and the second means have extremely low constant working time.Provide a kind of decoding means, it runs the twice being approximately the second coding means consuming time, and efficiency is very high.The operation time space complexity of Code And Decode is all O (1); There is provided coding constant: the code word that the first coding means provides can be used as constant to use, to evade C language compiler, the constant of array size is limited; Applied widely, namely provide 169 basic code words and abundant expansion code word, be applicable to the variable-value scope in most industrial software; Not easily make mistakes, i.e. the Code And Decode means of robotization, eliminate the time-consuming fallibility feature of manual coding; Algorithm packaging, has carried out object encapsulation by coding function and decoding functions, the algorithm instance that client only need use an overall situation read-only, namely may have access to all algorithms, alleviates the memory burden of programmer.The invention also discloses the safe coding generating apparatus in a kind of Safety-Critical System.
Accompanying drawing explanation
Can understanding the features and advantages of the present invention clearly by reference to accompanying drawing, accompanying drawing is schematic and should not be construed as and carry out any restriction to the present invention, in the accompanying drawings:
Fig. 1 shows the flow chart of steps of the safe coding generation method in a kind of Safety-Critical System in the embodiment of the present invention;
Fig. 2 shows the structured flowchart of the safe coding generating apparatus in a kind of Safety-Critical System in the embodiment of the present invention;
Fig. 3 shows in the safe coding generation method in a kind of Safety-Critical System in the embodiment of the present invention flow chart of steps of grand definition procedure of encoding;
Fig. 4 shows in the safe coding generation method in a kind of Safety-Critical System in the embodiment of the present invention flow chart of steps of grand use procedure of encoding;
Fig. 5 shows the flow chart of steps of the definition procedure of coding function in the safe coding generation method in a kind of Safety-Critical System in the embodiment of the present invention;
Fig. 6 shows the flow chart of steps of the use procedure of coding function in the safe coding generation method in a kind of Safety-Critical System in the embodiment of the present invention;
Fig. 7 shows the flow chart of steps of the definition procedure of decoding functions in the safe coding generation method in a kind of Safety-Critical System in the embodiment of the present invention;
Fig. 8 shows the flow chart of steps of the use procedure of decoding functions in the safe coding generation method in a kind of Safety-Critical System in the embodiment of the present invention.
Embodiment
In order to ensure that the program code in security critical software follows safe coding regulation, avoid the shortcoming of prior art simultaneously, the present invention proposes a kind of modified coded system, safe coding fast generator, namely the present invention proposes the safe coding maker in a kind of Safety-Critical System and generation method.
Below in conjunction with accompanying drawing, embodiments of the present invention is described in detail.
Generate method and apparatus in order to better understand with the safe coding in a kind of Safety-Critical System of proposing of application the present invention, be described in detail with following accompanying drawing example.
As shown in Figure 1, the present invention proposes a kind of safe coding generation method in Safety-Critical System, comprising:
Step S1: carry out scale-of-two inversion operation to pre-generatmg information code, generates original code word.
Step S2: original code word is encoded by binary math calculating.
Particularly, step S2 comprises further: provided by the grand mode of C language precompile; Precompile is grand resolved before compiling, carried out macro expansion and constant folding at compile duration.Therefore, the constant when coding result that this means generate will be operation, need not be operationally the new internal memory of cataloged procedure application, time complexity when therefore running and space complexity be all O (1).This coding means is suitable for C language has throughput requirement occasion to array size and switch-case statement, is also applicable to occasion operational efficiency being had to rigors.
Further, step S2 comprises further: provided by C language function fashion; The mode mapped by static array returns coding result.Operational efficiency is high, and time complexity is O (1), only needs a group address skew to obtain result.Static array belongs to the heap memory in module, and be that compile duration distributes, without the need to applying for new internal memory, space complexity during operation is O (1).This coding means provides dirigibility when running greatly, conveniently carries out safe coding to dynamically inputting.Thered is provided by the grand mode of C language precompile.
Further, the present invention propose a kind of Safety-Critical System in the safe coding method of generationing also comprise: to encode after code word decode.Particularly, provided by the mode of C language function; Dichotomy is used to carry out searching for and decoding.
The present invention proposes a kind of safe coding generation method in Safety-Critical System, by carrying out scale-of-two inversion operation to pre-generatmg information code, generating original code word; Original code word is encoded by binary math calculating.Safe coding generation method in a kind of Safety-Critical System that the present invention proposes has security, and the distance namely arbitrarily between code word is all not less than 4, and the ratio of illegal code word and legal-code is far longer than 255:1; Convenience, namely for different variablees, can carry out Code And Decode easily; High efficiency, namely provide two kinds of coding means, the first means only consumes compilation time, expends any working time hardly, and the second means have extremely low constant working time.Provide a kind of decoding means, it runs the twice being approximately the second coding means consuming time, and efficiency is very high.The operation time space complexity of Code And Decode is all O (1); There is provided coding constant: the code word that the first coding means provides can be used as constant to use, to evade C language compiler, the constant of array size is limited; Applied widely, namely provide 169 basic code words and abundant expansion code word, be applicable to the variable-value scope in most industrial software; Not easily make mistakes, i.e. the Code And Decode means of robotization, eliminate the time-consuming fallibility feature of manual coding; Algorithm packaging, has carried out object encapsulation by coding function and decoding functions, the algorithm instance that client only need use an overall situation read-only, namely may have access to all algorithms, alleviates the memory burden of programmer.
As shown in Figure 2, the invention allows for the safe coding generating apparatus 10 in a kind of Safety-Critical System, comprising: original code word generation module 101 and coding module 102.
Particularly, original code word generation module 101, for carrying out scale-of-two inversion operation to pre-generatmg information code, generates original code word; Coding module 102 is for encoding by binary math calculating to original code word.
Further, coding module 102 also comprises: first method providing unit (not shown) is used for being provided by the grand mode of C language precompile; Resolution unit (not shown) was resolved before compiling for precompile is grand; Macro operation unit (not shown) is used for carrying out macro expansion and constant folding at compile duration.
Further, coding module 102 also comprises: second method providing unit (not shown) is used for being provided by C language function fashion; Coding result is returned unit (not shown) and returns coding result for the mode mapped by static array.
Further, the present invention propose a kind of Safety-Critical System in safe coding generating apparatus also comprise: decoder module 103 for coding after code word decode.Particularly, decoder module 103 also comprises: Third Way providing unit (not shown) is used for being provided by the mode of C language function; Search and decoding unit (not shown) carry out searching for and decoding for using dichotomy.
The present invention proposes the safe coding generating apparatus in a kind of Safety-Critical System, by original code word generation module, scale-of-two inversion operation is carried out to pre-generatmg information code, generate original code word; Eventually through coding module, original code word is encoded by binary math calculating.Safe coding generating apparatus in a kind of Safety-Critical System that the present invention proposes has security, and the distance namely arbitrarily between code word is all not less than 4, and the ratio of illegal code word and legal-code is far longer than 255:1; Convenience, namely for different variablees, can carry out Code And Decode easily; High efficiency, namely provide two kinds of coding means, the first means only consumes compilation time, expends any working time hardly, and the second means have extremely low constant working time.Provide a kind of decoding means, it runs the twice being approximately the second coding means consuming time, and efficiency is very high.The operation time space complexity of Code And Decode is all O (1); There is provided coding constant: the code word that the first coding means provides can be used as constant to use, to evade C language compiler, the constant of array size is limited; Applied widely, namely provide 169 basic code words and abundant expansion code word, be applicable to the variable-value scope in most industrial software; Not easily make mistakes, i.e. the Code And Decode means of robotization, eliminate the time-consuming fallibility feature of manual coding; Algorithm packaging, has carried out object encapsulation by coding function and decoding functions, the algorithm instance that client only need use an overall situation read-only, namely may have access to all algorithms, alleviates the memory burden of programmer.
Generating and device with the safe coding in a kind of Safety-Critical System of proposing of application the present invention to understand better, carry out following example, and the present invention not limiting to following example.
Particularly, in the present invention, use information-theoretical means, utilize seven code words of generator polynomial pre-generatmg information code 1,2,3,4,5,6,7 correspondence, scale-of-two negate is applied to these seven code words, obtains other seven code words.These 14 code words are called original code word.On the basis of original code word, by binary math computing, can obtain 169 code words, be called basic code word, easily verify, the Hamming distance between any two basic code words is all not less than 4, therefore meets above-mentioned Article 1 safe coding regulation.
Further, use 4 byte signless integers to represent basic code word, then the code collection at 169 code word places is [0,2 32-1].Concentrate legal-code to have 169 at this code, illegal code word has (2 32-1-169) individual, the ratio of illegal code word and legal-code is (2 32-1-169)/169 ≈ 25414006:1, be far longer than 255:1.Therefore, this encoding scheme meets above-mentioned Article 2 safe coding regulation completely.
Further, in order to expand the expression scope of safe coding, combination expansion can be carried out to 169 code words if desired.Such as, once combine the code word (basic code word A, basic code word B) that will be expanded, will obtain 169 × 169=28561 expansion code word, further combination will obtain more expansion code words.The Hamming distance of any two expansion code words is still not less than 4.After expansion, the ratio of illegal code word and legal-code increases further, improves security.Such as, the ratio after once combining is ((2 32-1) 2-28561)/28561 ≈ 645871785480886:1, are obviously far longer than 255:1.
Further, the invention provides two kinds of coding means.The first means provides in the mode that C language precompile is grand, and precompile is grand resolved before compiling, carried out macro expansion and constant folding at compile duration.Therefore, the constant when coding result that this means generate will be operation, it need not be operationally the new internal memory of cataloged procedure application, time complexity when therefore running and space complexity are all O (1), this coding means is suitable for C language has throughput requirement occasion to array size and switch-case statement, is also applicable to occasion operational efficiency being had to rigors; The second means provide in the mode of C language function, the mode that it is mapped by static array returns coding result, operational efficiency is high, time complexity is O (1), only need a group address skew to obtain result, static array belongs to the heap memory in module, is that compile duration distributes, without the need to applying for new internal memory, space complexity during operation is O (1).Therefore, this coding means provides dirigibility when running greatly, conveniently carries out safe coding to dynamically inputting.
Further, the invention provides decoding means when one is run, provide in the mode of C language function.Particularly, it uses dichotomy to carry out fast search and decoding, time complexity 7.4O (1) (the 7.4 ≈ log of the decoding of 169 code words 2169), be constant time complexity, ultrahigh in efficiency.Memory headroom used during decoding is the heap memory that compile duration distributes, and without the need to applying for new internal memory, space complexity during operation is O (1).The time complexity of one extension codeword decoding is O (i)=log 228561 ≈ 14.8 are still constant time complexity, and space complexity when running is O (1).
In sum, wherein, encode grand, coding function and decoding functions conceal loaded down with trivial details cataloged procedure completely, and client only need use the mode of similar Func (input) to conduct interviews, and it is very convenient therefore to use, and pole is not easy to make mistakes.
Particularly, as shown in Figure 3, be grand definition procedure of encoding, in step sl, define 169 basic code word constant _ Haming_0 to _ Haming_168, respectively corresponding 0x00,0x17,0x2E ..., 0xFFFFD1,0xFFFFE8.It should be noted that the leading underscore of these identifiers, it is intended to the programmer reminding client, and these identifiers are privately owned identifiers, and external module should not conduct interviews to it; In step s 2, define one and piece grand _ HamingPaste (n) together, its definition content is:
#define_HamingPaste(n)(_Haming_##n)
Such as, _ HamingPaste (168) will obtain _ Haming_168, also namely obtain constant 0xFFFFE8.
In step s3, define the grand Haming (n) of coding, there is no underscore before this identifier, show that it is grand disclosed in one, can be called by external module.Grand Haming (n) of encoding is defined as follows:
#define((n)<0?0:((n)>168?168:_HamingPaste(n)))
Wherein, Haming (n) is mainly used for the input outside process range [0,168], to improve the robustness of coding.
Further, encode grand use procedure as shown in Figure 4, particularly, client only needs to use Haming (n) can obtain safe coding result corresponding to parameter n, and without the need to knowing other grand internal implementation, therefore use very convenient, not easily make mistakes, and in C language, what Haming (n) returned is a compiler constant and constant when running, and during operation, efficiency is very high, and time complexity and space complexity are all O (1).Especially, Haming (n) can as the branch labels in the array size of C language and switch-case statement, and therefore Haming (n) can bring good additional function to programmer.
As shown in Figure 5, be the definition procedure of coding function, particularly, in step s 4 which, define static array D1 and a kind of structure type A1.Wherein, array D1 is made up of according to ascending order 169 code words, with fast and easy access and.Structure type A1 contains two function pointers, is respectively used to point to coding function and decoding functions, can add new function pointer easily whenever necessary; In step s 5, defining coding function F1 (n), for returning the coding result of unique parameters n, having protected illegal parameter value simultaneously.The inside of function F 1 (n) realizes very simple, carries out simple address offset operation exactly, namely carries out array value computing D1 [n].Because the computing of array value only expends the memory access time of a unit, and need not apply for new internal memory, therefore function F 1 (n) time complexity operationally and space complexity are all O (1); In step s 6, define unique overall read-only algorithm object A2, its type is A1, real function F1 is tied to the coding function pointer of A2 initialized time simultaneously.
Coding function is packaged into structure type A1, has two benefits: one is add new algorithm after being convenient to, and without the need to revising existing code.Such as, if will be that A1 adds decoding functions F2 (n), Hamming distance computing function F3 (n1 later, n2), Hamming weight computing function F4 (n), so only need increase by three function pointers in A1, then three real functions are defined, finally carry out initialization to bind, and without the need to the definition procedure of revising coding function F1 and binding procedure.Two is the memory pressures reducing client-side program person, so that the service that fast access algorithm instance provides, also namely programmer only need remember the name of unique overall read-only object A2, and without the need to remembeing the name of each concrete function.Should be noted that structured programming requirement reduces the use of global variable as far as possible, but global variable A2 is here read-only, therefore while offering convenience property, does not bring negative effect.
Further, as shown in Figure 6, for the use procedure of coding function, the internal processes being specially F1 (n) employs the content of D1, therefore can ensure that the Hamming distance of F1 (n1) and F1 (n2) (n1 is not equal to n2) is not less than 4.The use-pattern of coding function F1 (n) is very simple, and programmer only need remember the name of A2, uses period operational symbol ". " can know concrete function name F1.
As shown in Figure 7, be the definition procedure of decoding functions, particularly, in the step s 7, define decoding functions F2 (n), for returning the decoded result of unique parameters n.If parameter n is improper code word, so will return an irrational decode value (such as-1), so that client carries out judging and processing.
Further, as shown in Figure 8, for the use procedure of decoding functions, particularly, for two different n1 and n2, only when it two Hamming distance be not less than 4 and it two be all legal-code time, F2 just returns two different efficient solution code values, significantly can reduce the string code possibility between n1 and n2 like this, improve the error detection rate of communication data, thus improve antijamming capability, raising security.
Further, make use of static array D1 during decoding, without the need to applying for new internal memory, space complexity when therefore running is O (1).Because the element inside static array D1 is ordered arrangement, therefore can carry out dichotomizing search during decoding, time complexity is 7.4O (1) (7.4 ≈ log 2169).Dichotomizing search process is, any given code word x (x may be improper code word), and first judge the magnitude relationship of the neutral element a of x and D1, if equal, then x is legal-code, returns the subscript of a as decoded result simultaneously; If x is greater than (or being less than) neutral element, then the neutral element of right-hand part (or left side) element of x and D1 is compared, so only need once comparing of x and a, just hunting zone is reduced half.So go down, until find x or can not find x.Obviously, the mode of this Binary searches, at most only needs log 2169 ≈ 7.4 times are operation by half, and just can obtain a result, therefore speed is very fast.For 28561 one extension code words, only need log 228561 ≈ 14.8 times are operation by half, and speed is still very fast.
All parts embodiment of the present invention with hardware implementing, or can realize with the software module run on one or more processor, or realizes with their combination.It will be understood by those of skill in the art that the some or all functions that microprocessor or digital signal processor (DSP) can be used in practice to realize according to the some or all parts in embodiment of the present invention equipment.The present invention can also be embodied as part or all equipment for performing method as described herein or device program (such as, computer program and computer program).Realizing program of the present invention and can store on a computer-readable medium like this, or the form of one or more signal can be had.Such signal can be downloaded from internet website and obtain, or provides on carrier signal, or provides with any other form.
Alleged herein " embodiment ", " embodiment " or " one or more embodiment " means, the special characteristic in conjunction with the embodiments described, structure or characteristic comprise at least one embodiment of the present invention.In addition, note that the word example of " in one embodiment " here not necessarily refers to same embodiment entirely.
In instructions provided herein, describe a large amount of detail.But can understand, embodiments of the invention can be put into practice when not having these details.In some instances, be not shown specifically known method, structure and technology, so that not fuzzy understanding of this description.
The present invention will be described instead of limit the invention to it should be noted above-described embodiment, and those skilled in the art can design alternative embodiment when not departing from the scope of claims.In the claims, any reference symbol between bracket should be configured to limitations on claims.Word " comprises " not to be got rid of existence and does not arrange element in the claims or step.Word "a" or "an" before being positioned at element is not got rid of and be there is multiple such element.The present invention can by means of including the hardware of some different elements and realizing by means of the computing machine of suitably programming.In the unit claim listing some devices, several in these devices can be carry out imbody by same hardware branch.Word first, second and third-class use do not represent any order.Can be title by these word explanations.
In addition, shall also be noted that the language used in this instructions is mainly in order to object that is readable and instruction is selected, instead of select to explain or limiting theme of the present invention.Therefore, when not departing from the scope and spirit of appended claims, many modifications and changes are all apparent for those skilled in the art.For scope of the present invention, be illustrative to disclosing of doing of the present invention, and nonrestrictive, and scope of the present invention is defined by the appended claims.
Although describe embodiments of the present invention by reference to the accompanying drawings, but those skilled in the art can make various modifications and variations without departing from the spirit and scope of the present invention, such amendment and modification all fall into by within claims limited range.

Claims (10)

1. the safe coding generation method in a Safety-Critical System, is characterized in that, comprise following concrete steps:
S1: carry out scale-of-two inversion operation to pre-generatmg information code, generates original code word;
S2: described original code word is encoded by binary math calculating.
2. the method for claim 1, is characterized in that, described step S2 comprises further: provided by the grand mode of C language precompile; Precompile is grand resolved before compiling, carried out macro expansion and constant folding at compile duration.
3. method as claimed in claim 2, it is characterized in that, described step S2 comprises further: provided by C language function fashion; The mode mapped by static array returns coding result.
4. the method for claim 1, is characterized in that, also comprises: decode to the code word after coding.
5. method as claimed in claim 4, is characterized in that, describedly decodes to the code word after coding, specifically comprises: provided by the mode of C language function; Dichotomy is used to carry out searching for and decoding.
6. the safe coding generating apparatus in Safety-Critical System, is characterized in that, comprising:
Original code word generation module, for carrying out scale-of-two inversion operation to pre-generatmg information code, generates original code word;
Coding module, for encoding by binary math calculating to described original code word.
7. device as claimed in claim 6, it is characterized in that, described coding module, also comprises:
First method providing unit, for providing by the grand mode of C language precompile;
Resolution unit, resolved before compiling for precompile is grand;
Macro operation unit, for carrying out macro expansion and constant folding at compile duration.
8. device as claimed in claim 6, it is characterized in that, described coding module, also comprises:
Second method providing unit, for providing by C language function fashion;
Coding result returns unit, returns coding result for the mode mapped by static array.
9. device as claimed in claim 6, is characterized in that, also comprise: decoder module, for decoding to the code word after coding.
10. device as claimed in claim 9, it is characterized in that, described decoder module, also comprises:
Third Way providing unit, for providing by the mode of C language function;
Search and decoding unit, carry out for using dichotomy searching for and decoding.
CN201510064871.4A 2015-02-06 2015-02-06 Safe coding generation method in Safety-Critical System and device Active CN104615475B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510064871.4A CN104615475B (en) 2015-02-06 2015-02-06 Safe coding generation method in Safety-Critical System and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510064871.4A CN104615475B (en) 2015-02-06 2015-02-06 Safe coding generation method in Safety-Critical System and device

Publications (2)

Publication Number Publication Date
CN104615475A true CN104615475A (en) 2015-05-13
CN104615475B CN104615475B (en) 2018-08-21

Family

ID=53149933

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510064871.4A Active CN104615475B (en) 2015-02-06 2015-02-06 Safe coding generation method in Safety-Critical System and device

Country Status (1)

Country Link
CN (1) CN104615475B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115039083A (en) * 2019-12-16 2022-09-09 根来文生 Validity verification enabling method for asynchronous algorithm generated during execution of logic connection program

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101848390A (en) * 2010-05-10 2010-09-29 西南交通大学 Image compression secure coding method based on multidirectional sparse representation
CN103269256A (en) * 2013-05-10 2013-08-28 卡斯柯信号有限公司 Information timeliness safety judgment method in safety coding communication system
CN103475462A (en) * 2012-06-07 2013-12-25 中国科学院研究生院 Random modulation-based combined channel and secure coding and decoding design method

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101848390A (en) * 2010-05-10 2010-09-29 西南交通大学 Image compression secure coding method based on multidirectional sparse representation
CN103475462A (en) * 2012-06-07 2013-12-25 中国科学院研究生院 Random modulation-based combined channel and secure coding and decoding design method
CN103269256A (en) * 2013-05-10 2013-08-28 卡斯柯信号有限公司 Information timeliness safety judgment method in safety coding communication system

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
李刚 等: ""安全编码预编译器的设计与实现"", 《计算机工程》 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115039083A (en) * 2019-12-16 2022-09-09 根来文生 Validity verification enabling method for asynchronous algorithm generated during execution of logic connection program

Also Published As

Publication number Publication date
CN104615475B (en) 2018-08-21

Similar Documents

Publication Publication Date Title
US9525435B2 (en) Computing device storing look-up tables for computation of a function
US8874928B2 (en) System and method for obfuscating constants in a computer program
CN104823161A (en) Compiler generating operator free code
US8381199B2 (en) Modular and/or demand-driven string analysis of a computer program
CN105391514B (en) Character encoding and decoding method and device
Spataru et al. A high-performance native approach to adaptive blockchain smart-contract transmission and execution
US20130219231A1 (en) Method for Storing and Propagating Error Information in Computer Programs
Blaudeau et al. A verified packrat parser interpreter for parsing expression grammars
CN106250252A (en) Method, computer program and data handling equipment in computer systems
EP3065060A1 (en) Grammar generation for simple datatypes
CN104615475A (en) Safe code generating method and device in safety key system
Hong et al. TinyVM: an energy‐efficient execution infrastructure for sensor networks
CN113449330A (en) Method for transmitting Javascript encrypted file
Veanes Symbolic string transformations with regular lookahead and rollback
US10311137B2 (en) Grammar generation for augmented datatypes for efficient extensible markup language interchange
Toyofuku et al. Program obfuscation scheme using random numbers to complicate control flow
CN114637988B (en) A Binary-Oriented Function-Level Software Randomization Method
Sridhar et al. Hippocratic binary instrumentation: First do no harm
US10019418B2 (en) Efficient XML interchange profile stream decoding
Ben-Aroya et al. A note on subspace evasive sets
US9547758B2 (en) Program cable obfuscation based upon recently executed program code
JP5277825B2 (en) Program obfuscation device and obfuscation program
Bangert et al. Nail: A practical interface generator for data formats
Wang The finite model property for semilinear substructural logics
CN108804883A (en) A kind of operation method and device of obfuscated codes

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant