Specification
Title of Invention:
MATRIX GENERATION APPARATUS, MATRIX GENERATION METHOD,
AND MATRIX GENERATION PROGRAM
Technical Field
[0001] The present invention relates to a matrix generation apparatus, a matrix generation method, and a matrix generation program. For example, the present invention relates to an apparatus, method, and program to generate a secret sharing matrix used for encryption and decryption. Background Art
[0002] With a secret sharing scheme, secret information is divided into several pieces of shared information. To restore the secret information, a specific combination of shared information need be collected. What combination of shared information should be collected can be defined by a logical formula employing a logical sum, a logical product, and the like. A secret sharing matrix is obtained by converting the logical formula into a matrix format. Elements included in the logical formula are assigned to the respective rows of the secret sharing matrix. The secret sharing matrix is designed such that the sum or product of rows of elements satisfying the logical formula has a desired value. No matter how rows of elements not satisfying the logical formula may be combined, the desired value cannot be obtained.
[0003] For example, assume that a logical formula F is a logical product of a variable P and a variable Q and that the variable P and the variable Q are respectively assigned to the 1st row and the 2nd row of a secret sharing matrix M. In this case, if both the variable P and the variable Q are true, then the logical formula F is true. That is, the combination of the variable P and the variable Q satisfies the logical formula F. Each
of the variable P and the variable Q alone does not satisfy the logical formula F.
Hence, the secret sharing matrix M is designed such that each of the 1st and 2nd rows
does not have the desired value but the sum or product of the 1 st and 2nd rows has the
desired value.
[0004] A secret sharing matrix is used in functional encryption (for example, see
Patent Literature 1).
[0005] Several methods for generating a secret sharing matrix have conventionally
been proposed (for example, see Non-patent Literatures 1 and 2).
Citation List
Patent Literature
[0006] Patent Literature 1: WO 2011/135895
Non-Patent Literature
[0007] Non-patent Literature 1: A. Lewko, B. Waters, "Decentralizing
Attribute-Based Encryption", Advances in Cryptology - EUROCRYPT 2011, Lecture
Notes in Computer Science Volume 6632, 2011, pp 568-588
Non-patent Literature 2: Z. Liu, Z. Cao, "On Efficiently Transferring the Linear Secret-Sharing Scheme Matrix in Ciphertext-Policy Attribute-Based Encryption' IACR Cryptology ePrint Archive, 374, 2010 Summary of Invention Technical Problem
[0008] With the method described in Non-patent Literature 1, three values of 1, -1, and 0 need be used as components of the matrix. Also with the method described in Non-patent Literature 2, many values are used. With the conventional methods, a secret sharing matrix cannot be generated efficiently. [0009] It is an object of the present invention, for example, to generate a matrix
efficiently from a logical formula. Solution to Problem
[0010] A matrix generation apparatus according to one aspect of the present invention includes:
a tree structure generation part that receives as input a logical formula and generates tree structure data expressing the logical formula;
a root processing part that determines a type of an element expressed by a root of the tree structure data generated by the tree structure generation part, among elements of the logical formula, and generates a matrix corresponding to the determined type; and
a node processing part that stores in a memory the matrix generated by the root processing part, the node processing part sequentially selecting nodes, other than the root, of the tree structure data generated by the tree structure generation part, if having selected a node having a child node, then performing an operation corresponding to a type of an element expressed by the selected node, among the elements of the logical formula, on the matrix stored in the memory, if having selected a node not having a child node, then associating a variable being the element expressed by the selected node, among the elements of the logical formula, with one row of the matrix stored in the memory, and after having selected the nodes of the tree structure data, outputting the matrix stored in the memory and information indicating variables associated with respective rows of the matrix. Advantageous Effects of Invention
[0011] In the present invention, first, a matrix corresponding to the type of the element expressed by the root of tree structure data is generated. Then, an operation corresponding to the type of the element expressed by each node of the tree structure data is performed on the matrix. With respect to a node expressing a variable, the
variable is associated with one row of the matrix. Finally, a matrix where variables are
mapped to the respective rows is obtained. In this manner, according to the present
invention, a matrix can be generated efficiently by tracing tree structure data that
expresses a logical formula.
Brief Description of Drawings
[0012] Fig. 1 is a diagram illustrating an example of a matrix which is generated
finally in Embodiment 1.
Fig. 2 is a block diagram illustrating a configuration of a matrix generation apparatus according to Embodiment 1.
Fig. 3 is a block diagram illustrating a configuration of a tree structure generation part of the matrix generation apparatus according to Embodiment 1.
Fig. 4 is a diagram illustrating an example of a binary tree generated in Embodiment 1.
Fig. 5 is a diagram illustrating a recursive structure of the binary tree of Fig. 4.
Fig. 6 is a block diagram illustrating a configuration of a root processing part of the matrix generation apparatus according to Embodiment 1.
Fig. 7 is a block diagram illustrating a configuration of a node processing part of the matrix generation apparatus according to Embodiment 1.
Fig. 8 is a flowchart illustrating a behavior of the root processing part of the matrix generation apparatus according to Embodiment 1.
Fig. 9 is a flowchart illustrating a behavior of the node processing part of the matrix generation apparatus according to Embodiment 1.
Fig. 10 is a diagram illustrating an example of generating a matrix in Embodiment 1.
Fig. 11 is a diagram illustrating an example of a hardware configuration of the
matrix generation apparatus according to the embodiment of the present invention.
Description of Embodiments
[0013] An embodiment of the present invention will be described hereinafter with
referring to drawings.
[0014] The description of the embodiment employs the following notation.
[0015] Where the content of a variable P of a logical formula F indicates an event that
a value of a certain type A is a, the variable P is expressed by the following formula:
A = a [0016] For example, if the type A indicates "sex", the value a represents "male" or "female".
[0017] Where the content of the variable P of the logical formula F indicates an event that a value of a certain type A is not a, the variable P is expressed by the following formula:
A!-a [0018] The rows of a matrix M are counted from high to low in ascending order (namely, ordinal numbers are assigned). For example, the highest row is the 1st row. The row immediately below the 1st row is the 2nd row.
[0019] The columns of the matrix M are counted from left to right in ascending order (namely, ordinal numbers are assigned). For example, the leftmost column is the 1st column. The column immediately on the right to the 1st column is the 2nd column. [0020] A mapping holds between a row number (that is, an ordinal number) of the matrix M and a variable of the logical formula F. That a mapping p holds between a row number ROW and the variable P is described by the following equation:
p(ROW) = P [0021] That the mapping p of p(l) = pi and p(2) = p2 is defined is described as
follows:
p:{ N), the binary tree T
has no more node to be selected, and accordingly the flow proceeds to S36.
[0078] In S34, the node determination part 131 selects a node corresponding to the
node number I. The node determination part 131 determines which one of a logical
product, a logical sum, and a variable, the selected node is. If the node (in this case, a
node having a child node) is a logical product, the flow proceeds to S35a. If the node
(in this case, a node having a child node) is a logical sum, the flow proceeds to S35b.
If the node (in this case, a leaf) is a variable, the flow proceeds to S35c.
[0079] In S35a, the logical product processing part 132a receives as input the binary
tree T, matrix M, process row number CR, node number I, and mapping p from the
node determination part 131 and executes a logical product process. In the logical
product process, the matrix M and node number I are updated. The logical product
process will be described later in detail. The flow returns to S33.
[0080] In S35b, the logical sum processing part 132b receives as input the binary tree
T, matrix M, process row number CR, node number I, and mapping p from the node
determination part 131 and executes a logical sum process. In the logical sum process,
the matrix M and node number I are updated. The logical sum process will be
described later in detail. The flow returns to S33.
[0081] In S35c, the variable processing part 132c receives as input the binary tree T,
matrix M, process row number CR, node number I, and mapping p from the node
determination part 131 and executes a variable process. In the variable process, the
matrix M, process row number CR, and node number I are updated. The variable
process will be described later in detail. The flow returns to S33.
[0082] When the flow returns to S33 and proceeds to S34 again, the process count
determination part 133 transfers to the node determination part 131, the matrix M and
node number 1 updated by one of the logical product processing part 132a, logical sum
processing part 132b, and variable processing part 132c. If the process row number
CR and mapping p are updated by the variable processing part 132c, the process count
detennination part 133 transfers the updated process row number CR and mapping p as
well to the node determination part 131.
[0083] In S36, the processing result output part 134 receives as input the matrix M
and mapping p from the process count determination part 133 and outputs the matrix M
and mapping p.
[0084] The logical product process executed in S35a will be described hereinafter in
detail.
[0085] The logical product processing part 132a receives as input the binary tree T,
the matrix M of L' x r', the process row number CR, the node number I, and the
mapping p.
[0086] In the matrix M of L' x rp, the logical product processing part 132a adds a row
in which every component is 0, as the (L' + l)th row. Since a row is added, the matrix
M becomes a matrix of (L' + 1) x r'.
[0087] In the matrix M of (L1 + 1) x r', the logical product processing part 132a adds a
column in which every component is 0, as the (r' + l)th column. Since a column is
added, the matrix M becomes a matrix of (L1 + 1) x (r' + 1).
[0088] In the matrix M of (L'+ 1) x (r'+ 1), the logical product processing part 132a
defines a column in which 1 is located the leftmost in the CRth row, as the CLth
column.
[0089] In the matrix M of (L' + 1) x (r* + 1), the logical product processing part 132a
overwrites the (i + l)th column with the ith column, where i is a value of r' to CL.
That is, the logical product processing part 132a copies the r'th column over the (r' +
l)th column, copies the (r' - l)th column over the r'th column,..., and finally copies the
CLth column over the (CL + l)th column.
[0090] In the matrix Mof(L' + l)x(r'+l), the logical product processing part 132a
overwrites the (j + l)th row with thejth row, where j is a value of L' to CR. That is,
the logical product processing part 132a copies the L'th row over the (L' + l)th row,
copies the (L' - l)th row over the L'th row, ..., and finally copies the CRth row over the
(CR+ l)throw.
[0091] In the matrix M of (L' + 1) x (r'+ 1), the logical product processing part 132a
rewrites the CRth-row, CLth-column component to 1, the CRth-row, (CL + l)th-column
component to 0, the (CR + l)th-row, CLth-column component to 0, and the (CR +
l)th-row, (CL + l)th-column component to 1.
[0092] The logical product processing part 132a adds 1 to the node number I.
[0093] The logical product processing part 132a outputs the binary tree T, the matrix
M of (L' + 1) x (r' + 1), the process row number CR, the node number I, and the
mapping p.
[0094] The logical sum process executed in S35b will be described hereinafter in
detail.
[0095] The logical sum processing part 132b receives as input the binary tree T, the
matrix M of L' x r', the process row number CR, the node number I, and the mapping p.
[0096] In the matrix M of L' x r', the logical sum processing part 132b adds a row in
which every component is 0, as the (L' + l)th row. Since a row is added, the matrix M
becomes a matrix of (L' + 1) x r'.
[0097] In the matrix M of (L' + 1) x r', the logical sum processing part 132b
overwrites the (j + 1 )th row with the jth row, where j is a value of L' to CR. That is,
the logical product processing part 132a copies the L'th row over the (L1 + l)th row,
copies the (L1 - l)th row over the L'th row, ..., and finally copies the CRth row over the
(CR+l)throw.
[0098] The logical sum processing part 132b adds 1 to the node number I.
[0099] The logical sum processing part 132b outputs the binary tree T, the matrix M
of (L' + 1) x r', the process row number CR, the node number I, and the mapping p.
[0100] The variable process executed in S35c will be described hereinafter in detail.
[0101] The variable processing part 132c receives as input the binary tree T, the
matrix M of L' x r', the process row number CR, the node number I, and the mapping p.
[0102] The variable processing part 132c defines the following mapping p between
the process row number CR and the variable pi< of the leaf of the node number I:
p(CR) = pk [0103] That is, the variable processing part 132c adds (CR, pk) to the mapping p. [0104] The variable processing part 132c adds 1 to the node number I. [0105] The variable processing part 132c adds 1 to the process row number CR. [0106] The variable processing part 132c outputs the binary tree T, the matrix M of of L' x r', the process row number CR, the node number I, and the mapping p. [0107] In this embodiment, with respect to a combination of rows for which the
addition results of adding the same-column components is 1 in every column, among the rows of the matrix M outputted from the node processing part 130, if variables associated with the respective rows are true, then the logical formula F is true. Conversely, with respect to a combination of rows for which the addition result of adding the same-column components is not 1 in at least one column, among the rows of the matrix M outputted from the node processing part 130, even if variables associated with the respective rows are true, the logical formula F is false. In this embodiment, the root process and node process described above are earned out in order to generate a matrix M having such a nature.
[0108] For example, if the type of the element expressed by the root of the binary tree T, among the elements of the logical formula F, is a logical product operator, the root processing part 120 performs the process of S24a. That is, the root processing part 120 generates a 2-row, 2-column matrix in which the lst-row, Ist-column component and the 2nd-row, 2nd-column component are each 1, and the lst-row, 2nd-column component and the 2nd-row, lst-column component are each 0, as a matrix M corresponding to the logical product operator.
[0109] For example, if the type of the element expressed by the root of the binary tree T, among the elements of the logical formula F, is a logical sum operator, the root processing part 120 performs the process of S24b. That is, the root processing part 120 generates a 2-row, 1-column matrix in which every component is 1, as a matrix M corresponding to the logical sum operator.
[0110] For example, if the type of the clement expressed by a node having a child node, among the elements of the logical formula F, is a logical product operator, the node processing part 130 performs the process of S35a. That is, the node processing part 130 performs an operation of adding a new row and a new column, and setting the
CRth-row, CLth-column component and the (CR + l)th-row, (CL + I)th-column component each to 1, and the CRth-row, (CL + l)th-column component and the (CR + l)th-row, CLth-column component each to 0, on the matrix M, as an operation corresponding to the logical product operator, where the CRth row is a row with which a variable is to be associated next, and the CLth column is a column having the smallest ordinal number among columns whose CRth-row components are each 1. [0111] In the process of S35a, substantially, the CRth row is extended to two rows, and the (CR + l)th and subsequent rows are shifted downward by one. Also, the CLth column is extended to 2 columns, and the (CL + l)th and subsequent columns are shifted to the right by one. Thus, while converting the CRth-row, CLth-column component of before the extension into a 2-row, 2-column submatrix which is the same as the matrix generated by the process of S24a, it is possible to prevent the extension (that is, the operation corresponding to the logical product operator) from affecting the other components. Hence, the logical product operator expressed by the selected node can be appropriately reflected in the matrix M.
[0112] For example, if the type of the element expressed by a node having a child node, among the elements of the logical formula F, is a logical sum operator, the node processing part 130 performs the process of S35b. That is, the node processing part 130 performs an operation of adding a new row and setting each component in the (CR + l)th row to the same value as a corresponding component in the CRth row, on the matrix M, as an operation corresponding to the logical sum operator, where the CRth row is the row with which a variable is to be associated next.
[0113] In the process of S35b, substantially, the CRth row is extended to two rows, and the (CR + l)th and subsequent rows are shifted downward by one. Thus, while converting the CRth-row components of before the extension whose values are each 1
into a 2-row, 1-column submatrix which is the same as the matrix generated by the process of S24b, it is possible to prevent the extension (that is, the operation corresponding to the logical sum operator) from affecting the other components. Hence, the logical sum operator expressed by the selected node can be appropriately reflected in the matrix M.
[0114] In this manner, according to this embodiment, the matrix M can be generated efficiently by tracing the binary tree T that expresses the logical formula F. [0115] In this embodiment, the node processing part 130 executes the process for each node of the binary tree T by recursive call. Hence, the matrix M can be generated more efficiently.
[0116] As has been described above, a matrix generation method according to this embodiment includes: a step of receiving as input the logical formula F; a step of generating a tree structure equivalent to the logical formula F; a step of performing a process for the root of the tree structure; a step of determining whether or not each node of the tree structure has a child node; a step of, if a node has a child node, performing a process for the child node by recursive call; and a step of, if a node does not have a child node, associating a variable with a row and returning to the parent node. [0117] In this matrix generation method, the components of the generated matrix M are each 0 or 1. By linearly combining the row vectors of a submatrix constituted of rows with which the logical formula F holds, a vector in which every component is 1 can be generated. When the row vectors of a submatrix constituted of rows with which the logical formula F does not hold are linearly combined, the vector in which every component is 1 cannot be generated.
[0118] In this matrix generation method, if a node is a logical product (and), a submatrix expressing the logical product (and) is generated in the matrix M. If a node
is a logical sum (or), a row that is the same as the row being processed is added in the
matrix M.
[0119] When this matrix generation method is used, the size of the matrix M can be
reduced. Also, the conversion process of from the logical formula F into the matrix M
can be performed efficiently. Furthermore, the program size in implementation can be
reduced.
[0120] Various modifications can be made to this embodiment as needed.
[0121] For example, in this embodiment, the following matrix (or submatrix) is
generated by the logical product processes of S24a and S35a.
[0122] Nevertheless, the following matrix (or submatrix) may be generated by the logical product processes of S24a and S35a.
[0123] In this embodiment, the matrix M is constituted of 0(s) and l(s). Alternatively, the matrix M may be constituted of integers other than 0(s) and 1 (s), or real numbers. [0124] Fig. 10 is a diagram illustrating an example of generating a matrix M in this
embodiment.
[0125] In the example of Fig. 10, the example of Fig. 4 is applied.
[0126] The behavior of each part of the root processing part 120 in the example of Fig.
10 will be described hereinafter with referring to Fig. 8.
[0127] In S21, the root determination part 121 receives as input a binary tree T which
expresses the following logical formula F, and a node count N.
A != 10 and ((B = 20 and C != 30) or D = 40) [0128] The node count N of having nodes is 7. The binary tree T has 7 nodes as follows:
node number 1 (root): logical product (and)
node number 2 (leaf): A != 10
node number 3: logical sum (or)
node number 4: logical product (and)
node number 5 (leaf): B = 20
node number 6 (leaf): C !— 30
node number 7 (leaf): D = 40 [0129] In S22, the root determination part 121 initializes a mapping p. [0130] In S23, the root determination part 121 determines that the root of the binary tree T is a logical product. The flow proceeds to S24a.
[0131] In S24a, the logical product processing part 122a generates the following matrix M. The flow proceeds to S25a. [Formula 5]
[0132] In S25a, the logical product processing part 122a updates a node number from
1 to 2. The flow proceeds to S26.
[0133] In S26, the processing result output part 123 outputs the matrix M, the node
number I, and the mapping p.
[0134] The behavior of each part of the node processing part 130 in the example of
Fig. 10 will be described hereinafter with referring to Fig. 9.
[0135] In S31, the node determination part 131 receives as input the binary tree T, the
node count N, the matrix M, the node number I, and the mapping p. The node count N
is 7. The node number I is 2.
[0136] In S32, the node determination part 131 sets the process row number CR to 1.
[0137] In S33, the process count determination part 133 determines that the node
number 1 is smaller than the node count N (that is, I < N since 1 = 2 and N = 7). The
flow proceeds to S34.
[0138] In S34, the node determination part 131 selects a node corresponding to the
node number I. The node determination part 131 determines that the selected node is a
variable (A != 10). The flow proceeds to S35c.
[0139] In S35c, the variable processing part 132c receives as input the binary tree T,
the matrix M of 2 x 2, the process row number CR, the node number I, and the mapping
p. The process row number CR is 1. The node number I is 2.
[0140] The variable processing part 132c defines the following mapping p between
the process row number CR and the variable (A !— 10) of the leaf of the node number I:
p(l) = (A!=IO) [0141] That is, the variable processing part 132c adds (1, (A != 10)) to the mapping p. [0142] The variable processing part 132c updates the node number I from 2 to 3. [0143] The variable processing part 132c updates the process row number CR from 1 to 2.
[0144] The variable processing part 132c outputs the binary tree T, the matrix M of 2 x 2, the process row number CR, the node number I, and the mapping p. The flow returns to S33.
[0145] In S33, the process count determination part 133 determines that the node number I is smaller than the node count N (that is, I < N since 1 = 3 and N = 7). The flow proceeds to S34.
[0146] In S34, the node determination part 131 selects anode corresponding to the node number I. The node determination part 131 determines that the selected node is a logical sum. The flow proceeds to S35b.
[0147] In S35b, the logical sum processing part 132b receives as input the binary tree T, the matrix M of 2 x 2, the process row number CR, the node number I, and the mapping p. The process row number CR is 2. The node number I is 3. The mapping p is {(1, (A != 10))}.
[0148] hi the matrix M of 2 x 2, the logical sum processing part 132b adds a row in which every component is 0, as the 3rd row. Since a row is added, the matrix M becomes the following matrix of 3 x 2: [Formula 6]
[0149] In the matrix Mof 3 x 2, the logical sum processing part 132b copies the 2nd row over the 3rd row. As a result, the matrix M becomes the following matrix:
[0150] The logical sum processing part 132b updates the node number I from 3 to 4.
[0151] The logical sum processing part 132b outputs the binary tree T, the matrix M
of 3 x 2, the process row number CR, the node number I, and the mapping p. The
flow returns to S33.
[0152] In S33, the process count determination part 133 determines that the node
number I is smaller than the node count N (that is, I < N since I = 4 and N = 7). The
flow proceeds to S34.
[0153] In S36, the processing result output part 134 receives as input the matrix M
and the mapping p from the process count determination part 133 and outputs the matrix
M and the mapping p.
[0154] In S34, the node determination part 131 selects a node corresponding to the
node number I. The node determination part 131 determines that the selected node is a
logical product. The flow proceeds to S35a.
[0155] In S35a, the logical product processing part 132a receives as input the binary
tree T, the matrix M of 3 x 2, the process row number CR, the node number I, and the
mapping p. The process row number CR is 2. The node number I is 4. The
mapping pis {(1, (A != 10))}.
[0156] In the matrix M of 3 x 2, the logical product processing part 132a adds a row
in which every component is 0, as the 4th row. Since a row is added, the matrix M
becomes the following matrix of 4 x 2:
[0157] In the matrix M of 4 x 2, the logical product processing part 132a adds a column in which every component is 0, as the 3rd column. Since a column is added, the matrix M becomes the following matrix of 4 x 3: [Formula 9]
[0158] In the matrix M of 4 x 3, the logical product processing part 132a defines a
column in which 1 is located the leftmost in the CRth row, as the CLth column. That
is, the logical product processing part 132a sets CL to 2.
[0159] In the matrix M of 4 x 3, the logical product processing part 132a copies the
2nd column over the 3rd column. As a result, the matrix M becomes the following
matrix:
[0160] In the matrix M of 4 x 3, the logical product processing part 132a copies the 3rd row over the 4th row and the 2nd row over the 3rd row. As a result, the matrix M
becomes the following matrix:
[0161] In the matrix M of 4 x 3, the logical product processing part 132a rewrites the i CRth-row, CLth-column component to 1, the CRth-row, (CL+ l)th-column component to 0, the (CR + l)th-row, CLth-column component to 0, and the (CR + l)th-row, (CL + l)th-column component to 1. That is, the logical product processing part 132asetsthe 2nd-row, 2nd-column component and the 3rd-row, 3rd-column component each to 1, and the 2nd-row, 3rd-column component and the 3rd-row, 2nd-column component each > to 0. As a result, the matrix M becomes the following matrix: [Formula 12]
[0162] The logical product processing part 132a updates the node number I from 4 to
5.
[0163] The logical product processing part 132a outputs the binary tree T, the matrix
M of 4 x 3, the process row number CR, the node number I, and the mapping p. The
flow returns to S33.
[0164] In S33, the process count determination part 133 determines that the node
number I is smaller than the node count N (that is, I < N since I = 5 and N = 7). The
flow proceeds to S34.
[0165] In S34, the node determination part 131 selects a node corresponding to the
node number I. The node determination part 131 determines that the selected node is a
variable (B = 20). The flow proceeds to S35c.
[0166] In S35c, the variable processing part 132c receives as input the binary tree T,
the matrix M of 4 x 3, the process row number CR, the node number I, and the mapping
p. The process row number CR is 2. The node number I is 5. The mapping pis {(1.
(A != 10))}.
[0167] The variable processing part 132c defines the following mapping p between
the process row number CR and the variable (B = 20) of the leaf of the node number I:
p(2)-(B-20) [0168] That is, the variable processing part 132c adds (2, (B ~ 20)) to the mapping p. [0169] The variable processing part 132c updates the node number I from 5 to 6. [0170] The variable processing part 132c updates the process row number CR from 2 to 3.
[0171] The variable processing part 132c outputs the binary tree T, the matrix M of 4 x 3, the process row number CR, the node number I, and the mapping p. The flow returns to S33.
[0172] In S33, the process count determination part 133 determines that the node number I is smaller than the node count N (that is, I < N since 1 = 6 and N = 7). The flow proceeds to S34.
[0173] In S34, the node determination part 131 selects a node corresponding to the node number I. The node determination part 131 determines that the selected node is a variable (C != 30). The flow proceeds to S35c.
[0174] In S35c, the variable processing part 132c receives as input the binary tree T, the matrix M of 4 x 3, the process row number CR, the node number I, and the mapping p. The process row number CR is 3. The node number I is 6. The mapping p is {(1. (A!=10)),(1,(B = 20))}.
[0175] The variable processing part 132c defines the following mapping p between the process row number CR and the variable (C !— 30) of the leaf of the node number I:
p(3) = (C != 30) [0176] That is, the variable processing part 132c adds (3, (C != 30)) to the mapping p. [0177] The variable processing part 132c updates the node number I from 6 to 7. [0178] The variable processing part 132c updates the process row number CR from 3 to 4.
[0179] The variable processing part 132c outputs the binary tree T, the matrix M of 4
x 3, the process row number CR, the node number 1, and the mapping p. The flow
returns to S33.
[0180] In S33, the process count determination part 133 determines that the node
number I is the same as the node count N (that is, I < N since 1 = 7 and N = 7). The
flow proceeds to S34.
[0181] In S34, the node determination part 131 selects a node corresponding to the
node number I. The node determination part 131 determines that the selected node is a
variable (D = 40). The flow proceeds to S35c.
[0182] In S35c, the variable processing part 132c receives as input the binary tree T,
the matrix M of 4 x 3, the process row number CR, the node number I, and the mapping
p. The process row number CR is 3. The node number I is 7. The mapping p is {(1.
(A!=10)),(1,(B = 20)),(3,(C!==30))}.
[0183] The variable processing part 132c defines the following mapping p between
the process row number CR and the variable (D — 40) of the leaf of the node number I:
p(4) = (D = 40) [0184] That is, the variable processing part 132c adds (4, (D = 40)) to the mapping p. [0185] The variable processing part 132c updates the node number I from 7 to 8. [0186] The variable processing part 132c updates the process row number CR from 4 to 5.
[0187] The variable processing part 132c outputs the binary tree T, the matrix M of 4 x 3, the process row number CR, the node number I, and the mapping p. The flow returns to S33.
[0188] In S33, the process count determination part 133 determines that the node number I is larger than node count N (that is, I > N since 1 = 8 and N = 7). The flow
proceeds to S36.
[0189] In S36, the processing result output part 134 outputs the matrix M of 4 x 3 and the mapping p. The mapping p is {(1, (A !- 10)), (1, (B = 20)), (3, (C != 30)), (4, (D = 40))}.
[0190] Fig. 11 is a diagram illustrating an example of a hardware configuration of the matrix generation apparatus 100 according to the embodiment of the present invention. [0191] Referring to Fig. 11, the matrix generation apparatus 100 is a computer and provided with hardware such as an output device 910, an input device 920, a storage device 930, and a processing device 940. The hardware is utilized by the parts (what are described as "parts" in the description of the embodiment of the present invention) of the matrix generation apparatus 100.
[0192] The output device 910 is, for example, a display unit such as an LCD (Liquid Crystal Display), printer, or communication module (communication circuit or the like). The output device 910 is used by what are described as "parts" in the description of the embodiment of the present invention for outputting (transmitting) data, information, and a signal.
[0193] The input device 920 is, for example, a keyboard, mouse, touch panel, or communication module (communication circuit or the like). The input device 920 is used by what are described as "parts" in the description of the embodiment of the present invention for taking (receiving) data, information, and a signal, as input. [0194] The storage device 930 is, for example, a ROM (Read Only Memory), RAM (Random Access Memory), HDD (Hard Disk Drive), or SSD (Solid State Drive). A program 931 and a file 932 are stored in the storage device 930. The program 931 includes a program that executes processes (functions) of what are described as "parts" in the description of the embodiment of the present invention. The file 932 includes
data, information, a signal (value), and so on each of which is, for example, computed, processed, read, written, used, inputted, or outputted by what are described as "parts" in the description of the embodiment of the present invention.
[0195] The processing device 940 is, for example, a CPU (Central Processing Unit). The processing device 940 is connected to other hardware devices via a bus or the like and controls those hardware devices. The processing device 940 reads the program 931 from the storage device 930 and executes the program 931. The processing device 940 is used by what are described as "parts" in the description of the embodiment of the present invention to perform computation, processing, reading, writing, using, inputting, outputting, or the like.
[0196] With respect to what are described as "parts" in the description of the embodiment of the present invention, "part" may be replaced by "circuit", "device", or "appliance". With respect to what are described as "parts" in the description of the embodiment of the present invention, "part" may be replaced by "step", "procedure", or "process". That is, what are described as "parts" in the description of the embodiment of the present invention is implemented by software alone, hardware alone, or a combination of software and hardware. The software is stored in the storage device 930 as the program 931. The program 931 causes the computer to function as what are described as "parts" in the description of the embodiment of the present invention. Alternatively, the program 931 causes the computer to execute the processes of what are described as "parts" in the description of the embodiment of the present invention. [0197] The embodiment of the present invention is described so far. The embodiment may be practiced partly. For example, out of what are described as "parts" in the description of the embodiment, only one may be adopted, or an arbitrary combination of some may be adopted. The present invention is not limited to this
embodiment, but various changes can be made in the present invention as needed. Reference Signs List
[0198] 100: matrix generation apparatus; 110: tree structure generation part; 111: logical formula input part; 112: binary tree generation part; 113: binary tree output part; 120: root processing part; 121: root determination part; 122a: logical product processing part; 122b: logical sum processing part; 122c: variable processing part; 123: processing result output part; 130: node processing part; 131: node determination part; 132a: logical product processing part; 132b: logical sum processing part; 132c: variable processing part; 133: process count determination part; 134: processing result output part; 910: output device; 920: input device; 930: storage device; 931: program; 932: file; 940: processing device
Claims
[Claim 1] A matrix generation apparatus comprising:
a tree structure generation part that receives as input a logical formula and generates tree structure data expressing the logical formula;
a root processing part that determines a type of an element expressed by a root of the tree structure data generated by the tree structure generation part, among elements of the logical formula, and generates a matrix corresponding to the determined type; and
a node processing part that stores in a memory the matrix generated by the root processing part, the node processing part sequentially selecting nodes, other than the root, of the tree structure data generated by the tree structure generation part, if having selected a node having a child node, then performing an operation corresponding to a type of an element expressed by the selected node, among the elements of the logical formula, on the matrix stored in the memory, if having selected a node not having a child node, then associating a variable being the element expressed by the selected node, among the elements of the logical formula, with one row of the matrix stored in the memory, and after having selected the nodes of the tree structure data, outputting the matrix stored in the memory and information indicating variables associated with respective rows of the matrix.
[Claim 2] The matrix generation apparatus according to claim 1, wherein the root processing part, if the determined type is a logical sum operator, generates a 2-row, 1-column matrix in which every component is 1, as a matrix corresponding to the logical sum operator.
[Claim 3] The matrix generation apparatus according to claim 2, wherein the node processing part, if the type of the element expressed by the selected node is a logical sum operator, performs an operation of adding a new row and setting each component
in a (CR + l)th row to a same value as a corresponding component in a CRth row, as an operation corresponding to the logical sum operator, where the CRth row is a row with which a variable is to be associated next.
[Claim 4] The matrix generation apparatus according to any one of claims 1 to 3, wherein the root processing part, if the determined type is a logical product operator, generates a 2-row, 2-column matrix in which a lst-row, Ist-column component and a 2nd-row, 2nd-column component are each 1, and a lst-row, 2nd-column component and a 2nd-row, lst-column component are each 0, as a matrix corresponding to the logical product operator.
[Claim 5] The matrix generation apparatus according to claim 4, wherein the node processing part, if the type of the element expressed by the selected node is a logical product operator, performs an operation of adding a new row and a new column, and setting a CRth-row, CLth-column component and a (CR + l)th-row, (CL + l)th-column component each to 1, and a CRth-row, (CL + l)th-column component and a (CR + l)th-row, CLth-column component each to 0, as an operation corresponding to the logical product operator, where the CRth row is a row with which a variable is to be associated next, and the CLth column is a column having a smallest ordinal number among columns whose CRth-row components are each 1. [Claim 6] The matrix generation apparatus according to any one of claims 1 to 3, wherein the root processing part, if the determined type is a logical product operator, generates a 2-row, 2-column matrix in which a lst-row, lst-column component and a 2nd-row, 2nd-column component are each 0, and a lst-row, 2nd-column component and a 2nd-row, lst-column component are each 1, as a matrix corresponding to the logical product operator. [Claim 7] The matrix generation apparatus according to claim 6, wherein the node
processing part, if the type of the element expressed by the selected node is a logical product operator, performs an operation of adding a new row and a new column, and setting a CRth-row, CLth-column component and a (CR + l)th-row, (CL + l)th-column component each to 0, and a CRth-row, (CL + l)th-column component and a (CR + l)th-row, CLth-column component each to 1, as an operation corresponding to the logical product operator, where the CRth row is a row with which a variable is to be associated next, and the CLth column is a column having a smallest ordinal number among columns whose CRth-row components are each 1. [Claim 8] The matrix generation apparatus according to any one of claims 1 to 7, wherein
with respect to a combination of rows for which an addition result of adding same-column components is 1 in every column, among the rows of the matrix outputted by the node processing part, if variables associated with respective rows are true, then the logical formula is true, and
with respect to a combination of rows for which an addition result of adding the same-column components is not 1 in at least one column, among the rows of the matrix outputted by the node processing part, even if variables associated with respective rows are true, the logical formula is false.
[Claim 9] The matrix generation apparatus according to any one of claims 1 to 8, wherein the node processing part executes a process for each node of the tree structure data by recursive call.
[Claim 10] The matrix generation apparatus according to any one of claims 1 to 9, wherein the logical formula is a logical formula that defines a combination of pieces of information that are shared by a secret sharing scheme. [Claim 11] A matrix generation method comprising:
by a computer, receiving as input a logical formula and generating tree structure data expressing the logical formula;
by the computer, determining a type of an element expressed by a root of the tree structure data, among elements of the logical formula, and generating a matrix corresponding to the determined type; and
by the computer, storing in a memory the generated matrix, sequentially selecting nodes, other than the root, of the tree structure data, if having selected a node having a child node, then performing an operation corresponding to a type of an element expressed by the selected node, among the elements of the logical formula, on the matrix stored in the memory, if having selected a node not having a child node, then associating a variable being the element expressed by the selected node, among the elements of the logical formula, with one row of the matrix stored in the memory, and after having selected the nodes of the tree structure data, outputting the matrix stored in the memory and information indicating variables associated with respective rows of the matrix. [Claim 12] A matrix generation program that causes a computer to execute:
a tree structure generation process of receiving as input a logical formula and generating tree structure data expressing the logical formula;
a root process of determining a type of an element expressed by a root of the tree structure data generated by the tree structure generation process, among elements of the logical formula, and generating a matrix corresponding to the determined type; and
a node process of storing in a memory the matrix generated by the root process, the node process sequentially selecting nodes, other than the root, of the tree structure data generated by the tree structure generation process, if having selected a node having a child node, then performing an operation corresponding to a type of an element
expressed by the selected node, among the elements of the logical formula, on the matrix stored in the memory, if having selected a node not having a child node, then associating a variable being the element expressed by the selected node, among the elements of the logical formula, with one row of the matrix stored in the memory, and after having selected the nodes of the tree structure data, outputting the matrix stored in the memory and information indicating variables associated with respective rows of the matrix.