Data processing system and method for protecting data in a data memory against an undetected change
10725936 ยท 2020-07-28
Assignee
Inventors
Cpc classification
G06F21/6218
PHYSICS
International classification
G06F12/14
PHYSICS
H03M7/02
ELECTRICITY
H03M7/40
ELECTRICITY
G06F21/62
PHYSICS
Abstract
A method for protecting data in a data memory against an undetected change, wherein a functional variable x is encoded via a value, an input constant, an input signature and a timestamp D into a coded variable, where the functional variable is normalized relative to a base to form the integer value from the functional variable.
Claims
1. A method for protecting data in a data memory against an undetected change, comprising: encoding a functional variable x via a value value.sub.x, an input constant A, an input signature B.sub.x and a timestamp D into a coded variable x.sub.c in accordance with the relationship:
x.sub.c:=value.sub.x*A+B.sub.x+D; and normalizing the functional variable x relative to a base Base.sub.x to form the integer value value.sub.x from said functional variable x to protect the data in the data memory against the undetected change; wherein the value value.sub.x is calculated in accordance with the following relationship:
value.sub.x:=(x/Base.sub.x)mod 2.sup.Sizex, where Sizex is a size of an available memory.
2. The method as claimed in claim 1, wherein the functional variable x is encoded during a compilation operation to yield the coded variable x.sub.c.
3. The method as claimed in claim 1, wherein the data is provided for a control program and the base Base.sub.x is set to a value greater than or equal to a difference between a greatest attainable value max.sub.x predefined according to the control program for the value x and a smallest attainable value min.sub.x predefined according to the control program, divided by the size of the available memory Size.sub.x, such that Base.sub.x(max.sub.xmin.sub.x)/Size.sub.x.
4. The method as claimed in claim 1, wherein a coded addition +.sub.c of two coded variables x.sub.1c and x.sub.2c is performed in accordance with the relationship:
value.sub.x3:=(value.sub.x1*k.sub.1+value.sub.x2*k.sub.2+k.sub.3)/Size.sub.x3, where Base.sub.x3(max.sub.x3min.sub.x3)/Size.sub.x3 max.sub.x3=max.sub.x1+max.sub.x2 min.sub.x3=min.sub.x1+min.sub.x2 k.sub.2/k.sub.1Base.sub.x1/Base.sub.x2 k.sub.1+Base.sub.x1/2.sup.nBase.sub.x3 k.sub.2+Base.sub.x2/2.sup.nBase.sub.x3.
5. The method as claimed in claim 1, wherein a coded multiplication *.sub.c of two coded variables x.sub.1c and x.sub.2c is performed in accordance with the relationship:
value.sub.x3:=(value.sub.x1*value.sub.x2+k)/2.sup.n, where Base.sub.x3(max.sub.x3min.sub.x3)/Size.sub.x3 Base.sub.x3(Base.sub.x1*Base.sub.x2)/Size.sub.x3 max.sub.x3=MAX(min.sub.x1*min.sub.x2,min.sub.x1*max.sub.x2, max.sub.x1*min.sub.x2, max.sub.x1*max.sub.x2) min.sub.x3=MIN(min.sub.x1*min.sub.x2,min.sub.x1*max.sub.x2, max.sub.x1*min.sub.x2, max.sub.x1*max.sub.x2) k.sub.2/k.sub.1Base.sub.x1/Base.sub.x2 k.sub.1+Base.sub.x1/2.sup.nBase.sub.x3 k.sub.2+Base.sub.x2/2.sup.nBase.sub.x3.
6. The method as claimed in claim 1, wherein a recoding from a Base.sub.x to a base Base.sub.x is performed in accordance with the following relationship:
value.sub.x1=(((value.sub.x1+k.sub.1)/2.sup.n)*k.sub.2+k.sub.3)/2.sup.n, where k.sub.2/(2n+n)Base.sub.x/Base.sub.x.
7. A data processing system comprising: a processor; and data memory: wherein the processor is configured to: encode a functional variable x via a value value.sub.x, an input constant A, an input signature B.sub.x and a timestamp D into a coded variable x.sub.c in accordance with the relationship:
x.sub.c:=value.sub.x*A+B.sub.x+D; and normalize the functional variable x relative to a base Base.sub.x to form the integer value value.sub.x from said functional variable x to protect the data in the data memory against the undetected change; wherein the value value.sub.x is calculated in accordance with the following relationship:
value.sub.x:=(x/Base.sub.x)mod 2.sup.Sizex, where Sizex is a size of an available memory.
8. A method for protecting data in a data memory against an undetected change, comprising: encoding a functional variable x via a value value.sub.x, an input constant A, an input signature B.sub.x and a timestamp D into a coded variable x.sub.c in accordance with the relationship:
x.sub.c:=value.sub.x*A+B.sub.x+D; and normalizing the functional variable x relative to a base Base.sub.x to form the integer value value.sub.x from said functional variable x to protect the data in the data memory against the undetected change; wherein the value value.sub.x is calculated in accordance with the following relationship:
value.sub.x:=(xmin.sub.x/Base.sub.x)mod 2.sup.Sizex, where min.sub.x is a predefined minimum value of x.
Description
BRIEF DESCRIPTION OF THE DRAWINGS
(1) An exemplary embodiment of the invention is described below, in which:
(2)
(3)
DETAILED DESCRIPTION OF THE EXEMPLARY EMBODIMENTS
(4) The sine value of a functional variable x in degrees may be calculated numerically in a range of 0 inclusive up to and including 45 by means of the following function:
(5) TABLE-US-00001 static float sin7pi4(float x){ float a = 9.99999989793669848536e1; float b = 1.66666423796176028737e1; float c = 8.33179571459221545387e3; float d = 1.94842039748219288187e4; float square = x*x; float tmp1 = square*d; float tmp2 = c + tmp1; float tmp3 = square*tmp2; float tmp4 = (b + tmp3); float tmp5 = square*tmp4; float tmp6 = (a + tmp5); float tmp7 = tmp6*x; return tmp7; }
(6) The function concerns a power series using the constants a, b, c and d. Intermediate steps may be combined here under tmp1-tmp7. The power series may be concluded with tmp7, which can be output at the end of a program (return tmp7). The value square may be the square of the functional variable x. All of the values may be a floating-point number (float).
(7) The above-cited function may be performed in coded form via the method in accordance with the invention. Here, a bit count n of e.g. 49 bits may be made available. The precision of the input may be specified to a thousandth, for example.
(8) With reference to
(9) Size.sub.x:=2.sup.49
(10) min.sub.x:=0
(11) max.sub.x:=45000
(12) In a second step P2, the square of x is calculated, where a bit count of n=49 bits can be available. The base for calculating a square of x given a bit count of n=49, Base.sub.x.sub.
max.sub.x.sub.
min.sub.x.sub.
Base.sub.x.sub.
value.sub.x.sub.
=value.sub.x*value.sub.x*277999.
(13) In a third step P3, the value value.sub.x.sub.
value.sub.x.sub.
(14) In a fourth step P4, the temporary value value.sub.tmp1 is calculated:
value.sub.tmp1:=(value.sub.x.sub.
(15) In a fifth step P5, the temporary value value.sub.tmp2 is calculated:
value.sub.tmp2:=(value.sub.c,n=49*k.sub.1+value.sub.tmp1,n=49*k.sub.2+k)/2.sup.24
(16) In a sixth step P6, the temporary value value.sub.tmp3 is calculated:
value.sub.tmp3:=(value.sub.x.sub.
(17) In a seventh step P7, the temporary value value.sub.tmp4 is calculated:
value.sub.tmp4:=(value.sub.b,n=24*k.sub.1+value.sub.tmp3,n=24*k.sub.2+k)/2.sup.24
(18) In an eighth step P8, the temporary value value.sub.tmp5 is calculated:
value.sub.tmp5:=(value.sub.x2,n=24*value.sub.tmp4,n=24+k)/2.sup.24
(19) In a ninth step P9, the temporary value value.sub.tmp6 is calculated:
value.sub.tmp6:=(value.sub.a,n=24*k.sub.1+value.sub.tmp5,n=24*k.sub.2+k)/2.sup.24
(20) In a tenth step P10, the temporary value value.sub.tmp7 is calculated:
value.sub.tmp7:=(value.sub.x,n=24*value.sub.tmp6,n=24+k)/2.sup.24
(21) In an eleventh step P11, the value z is calculated from the temporary value value.sub.tmp7 and its base Base.sub.tmp7:
z:=sin(x):=value.sub.tmp7,n=24*Base.sub.tmp7
(22) In a twelfth step P12, the value value.sub.z having a base 2.sup.49 specified for a return value is calculated from the temporary value value.sub.tmp7 and its base Base.sub.tmp7:
value.sub.z:=Base.sub.tmp7*Base.sub.tmp7/2.sup.49
(23) In a thirteenth step P13, the value value.sub.z is converted into a floating-point number Float.sub.z. This is advantageous owing to the fact that the base of the value value.sub.z is a 2nd power.
(24) A program code could be written in the following manner, for example:
(25) Size:=2.sup.49
(26) Minimum:=0
(27) Maximum:=45000
square.sub.val49:=277999*X.sub.val*X.sub.val
square.sub.val24:=(square.sub.val49+2.sup.24)/2.sup.25
tmp2.sub.val:=18172496+(1378477226squareval49)/2.sup.31
tmp4.sub.val:=(square.sub.val24*tmp2.sub.val+111040616)/218415894
tmp6.sub.val:=(square.sub.va124*tmp4.sub.val197673)/2.sup.18+11464190094
tmp7.sub.val:=(tmp6.sub.val*x.sub.val+2.sup.22)/2.sup.23
tmp7.sub.bas:=1.277097000028899636e8
z:=SIN(x):=tmp7.sub.val*1.277097000028899636e8
Desired base for z: 2.sup.49
Z.sub.val:=tmp7.sub.bas*7189417
(28) Overall, the example demonstrates how, via the invention, a representation of data is provided that allows a flexible and efficient processing of ANBD-encoded data.
(29)