Independent Submission V. Dolmatov, Ed. Request for Comments: 7091 A. Degtyarev Updates: 5832 Cryptocom, Ltd. Category: Informational December 2013 ISSN: 2070-1721 GOST R 34.10-2012: Digital Signature Algorithm
AbstractThis document provides information about the Russian Federal standard for digital signatures (GOST R 34.10-2012), which is one of the Russian cryptographic standard algorithms (called GOST algorithms). Recently, Russian cryptography is being used in Internet applications, and this document provides information for developers and users of GOST R 34.10-2012 regarding digital signature generation and verification. This document updates RFC 5832. Status of This Memo This document is not an Internet Standards Track specification; it is published for informational purposes. This is a contribution to the RFC Series, independently of any other RFC stream. The RFC Editor has chosen to publish this document at its discretion and makes no statement about its value for implementation or deployment. Documents approved for publication by the RFC Editor are not a candidate for any level of Internet Standard; see Section 2 of RFC 5741. Information about the current status of this document, any errata, and how to provide feedback on it may be obtained at http://www.rfc-editor.org/info/rfc7091. Copyright Notice Copyright (c) 2013 IETF Trust and the persons identified as the document authors. All rights reserved. This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (http://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document.
1. Introduction ....................................................2 1.1. General Information ........................................2 1.2. The Purpose of GOST R 34.10-2012 ...........................3 1.3. Requirements Language ......................................3 2. Scope ...........................................................3 3. Definitions and Notations .......................................4 3.1. Definitions ................................................4 3.2. Notations ..................................................6 4. General Statements ..............................................7 5. Mathematical Conventions ........................................8 5.1. Mathematical Definitions ...................................9 5.2. Digital Signature Parameters ..............................10 5.3. Binary Vectors ............................................12 6. Main Processes .................................................12 6.1. Digital Signature Generation Process ......................13 6.2. Digital Signature Verification ............................13 7. Test Examples (Appendix to GOST R 34.10-2012) ..................14 7.1. The Digital Signature Scheme Parameters ...................15 7.2. Digital Signature Process (Algorithm I) ...................17 7.3. Verification Process of Digital Signature (Algorithm II) ..18 8. Security Considerations ........................................19 9. References .....................................................19 9.1. Normative References ......................................19 9.2. Informative References ....................................20 GOST3410-2012] was developed by the Center for Information Protection and Special Communications of the Federal Security Service of the Russian Federation with participation of the open joint-stock company "Information Technologies and Communication Systems" (InfoTeCS JSC). 2. GOST R 34.10-2012 was approved and introduced by Decree #215 of the Federal Agency on Technical Regulating and Metrology on 07.08.2012. 3. GOST R 34.10-2012 replaces GOST R 34.10-2001 [GOST3410-2001], a national standard of the Russian Federation. GOST R 34.10-2001 is superseded by GOST R 34.10-2012 from 1 January 2013. That means that all new systems that are presented for certification MUST use GOST R 34.10-2012 and MAY use
GOST R 34.10-2001 also for maintaining compatibility with existing systems. Usage of GOST R 34.10-2001 in current systems is allowed at least for a 5-year period. This document updates RFC 5832 [RFC5832]. This document is an English translation of GOST R 34.10-2012; [RFC6986] is an English translation of GOST R 34.11-2012; and [RFC5832] is an English translation of GOST R 34.10-2001. Terms and conceptions of this standard comply with the following international standards: o ISO 2382-2 [ISO2382-2], o ISO/IEC 9796 [ISO9796-2][ISO9796-3], o series of standards ISO/IEC 14888 [ISO14888-1] [ISO14888-2] [ISO14888-3] [ISO14888-4], and o series of standards ISO/IEC 10118 [ISO10118-1] [ISO10118-2] [ISO10118-3] [ISO10118-4]. GOST3411-2012]). RFC2119].
Use of a digital signature based on GOST R 34.10-2012 makes transmitted messages more resistant to forgery and loss of integrity, in comparison with the digital signature scheme prescribed by the previous standard. GOST R 34.10-2012 is recommended for the creation, operation, and modernization of data processing systems of various purposes. ISO14888-1]. signature key: element of secret data that is specific to the subject and used only by this subject during the signature generation process [ISO14888-1]. verification key: element of data mathematically linked to the signature key data element that is used by the verifier during the digital signature verification process [ISO14888-1]. domain parameter: element of data that is common for all the subjects of the digital signature scheme, known or accessible to all the subjects [ISO14888-1]. signed message: a set of data elements that consists of the message and the appendix, which is a part of the message [ISO14888-1]. pseudorandom number sequence: a sequence of numbers that is obtained during some arithmetic (calculation) process, used in a specific case instead of a true random number sequence. random number sequence: a sequence of numbers of which none can be predicted (calculated) using only the preceding numbers of the same sequence. verification process: a process that uses the signed message, the verification key, and the digital signature scheme parameters as initial data and that gives the conclusion about digital signature validity or invalidity as a result [ISO14888-1].
signature generation process: a process that uses the message, the signature key, and the digital signature scheme parameters as initial data and that generates the digital signature as the result [ISO14888-1]. witness: element of data that states to the verifier whether the digital signature is valid or invalid. random number: a number chosen from the definite number set in such a way that every number from the set can be chosen with equal probability. message: string of bits of a limited length [ISO14888-1]. hash code: string of bits that is a result of the hash function [ISO14888-1]. hash function: the function that maps bit strings onto bit strings of fixed length observing the following properties: 1. it is difficult to calculate the input data that is the pre- image of the given function value; 2. it is difficult to find another input data that is the pre- image of the same function value as is the given input data; and 3. it is difficult to find a pair of different input data that produces the same hash function value. [ISO14888-1] Notes: 1. Property 1 in the context of the digital signature area means that it is impossible to recover the initial message using the digital signature; property 2 means that it is difficult to find another (falsified) message that produces the same digital signature as a given message; property 3 means that it is difficult to find a pair of different messages that both produce the same signature. 2. In this standard, the terms "hash function", "cryptographic hash function", "hashing function", and "cryptographic hashing function" are synonymous to provide terminological succession to native legal documents currently in force and scientific publications.
(electronic) digital signature: string of bits that are obtained as a result of the signature generation process [ISO14888-1]. Notes: 1. A string of bits that is a signature may have an internal structure depending on the specific signature generation mechanism. 2. In this standard, the terms "electronic signature", "digital signature", and "electronic digital signature" are synonymous to provide terminological succession to native legal documents currently in force and scientific publications.
zeta digital signature for the message M ^ the power operator /= non-equality sqrt square root Section 6): - signature generation (Section 6.1), and - signature verification (Section 6.2). The digital signature is meant for the authentication of the signatory of the electronic message. Besides, digital signature usage gives an opportunity to provide the following properties during signed message transmission: - realization of control of the transmitted signed message integrity, - proof of the authorship of the signatory of the message, and - protection of the message against possible forgery. A schematic representation of the signed message is shown in Figure 1.
appendix | +-------------------------------+ | | +-----------+ +------------------------+- - - + | message M |---| digital signature zeta | text | +-----------+ +------------------------+- - - + Figure 1: Signed Message Scheme The field "digital signature" is supplemented by the field "text" that can contain, for example, identifiers of the signatory of the message and/or time label. The digital signature scheme defined in GOST R 34.10-2012 must be implemented using operations of the elliptic curve points group, defined over a finite prime field, and also with the use of the hash function. The cryptographic security of the digital signature scheme is based on the complexity of solving the problem of the calculation of the discrete logarithm in the elliptic curve points group and also on the security of the hash function used. The hash function calculation algorithm is defined in GOST R 34.11-2012 [GOST3411-2012]. The digital signature scheme parameters needed for signature generation and verification are defined in Section 5.2. This standard provides the opportunity to select one of two options for parameter requirements. GOST R 34.10-2012 does not determine the process for generating the parameters needed for the digital signature scheme. Possible sets of these parameters are defined, for example, in [RFC4357]. The digital signature represented as a binary vector of a 512- or 1024-bit length must be calculated using a definite set of rules, as stated in Section 6.1. The digital signature of the received message is accepted or denied in accordance with the set of rules, as stated in Section 6.2.
| x3 = lambda^2 - x1 - x2 (mod p), | (4) | y3 = lambda * (x1 - x3) - y1 (mod p), y1 - y2 where lambda = -------- (mod p). x1 - x2 If x1 = x2 and y1 = y2 /= 0, then we will define point Q3 coordinates in the following way: | x3 = lambda^2 - x1 * 2 (mod p), | (5) | y3 = lambda * (x1 - x3) - y1 (mod p), 3 * x1^2 + a where lambda = ------------ (mod p) y1 * 2 If x1 = x2 and y1 = -y2 (mod p), then the sum of points Q1 and Q2 is called a zero point O, without determination of its x- and y- coordinates. In this case, point Q2 is called a negative of point Q1. For the zero point, the equalities hold: O + Q = Q + O = Q, (6) where Q is an arbitrary point of elliptic curve E. A set of all points of elliptic curve E, including the zero point, forms a finite abelian (commutative) group of order m regarding the introduced addition operation. For m, the following inequalities hold: p + 1 - 2 * sqrt(p) =< m =< p + 1 + 2 * sqrt(p) (7) The point Q is called "a point of multiplicity k", or just "a multiple point of the elliptic curve E", if for some point P, the following equality holds: Q = P + ... + P = k * P (8) -----+----- k
- elliptic curve E, defined by its invariant J(E) or by coefficients a, b belonging to GF(p). - integer m is an elliptic curve E points group order. - prime number q is an order of a cyclic subgroup of the elliptic curve E points group, which satisfies the following conditions: | m = nq, n belongs to Z, n >= 1 | (9) | 2^254 < q < 2^256 or 2^508 < q < 2^512 - point P /= O of an elliptic curve E, with coordinates (x_p, y_p), satisfying the equality q * P = O. - hash function h(.):V_all -> V_l, which maps the messages represented as binary vectors of arbitrary finite length onto binary vectors of an l-bit length. The hash function is defined in GOST R 34.11-2012 [GOST3411-2012]. If 2^254 < q < 2^256, then l = 256. If 2^508 < q < 2^512, then l = 512. Every user of the digital signature scheme must have its personal keys: - signature key, which is an integer d, satisfying the inequality 0 < d < q; - verification key, which is an elliptic curve point Q with coordinates (x_q, y_q), satisfying the equality d * P = Q. The previously introduced digital signature parameters must satisfy the following requirements: - it is necessary that the condition p^t /= 1 (mod q) holds for all integers t = 1, 2, ..., B, where B = 31 if 2^254 < q < 2^256, or B = 131 if 2^508 < q < 2^512; - it is necessary that the inequality m /= p holds; - the curve invariant must satisfy the condition J(E) /= 0, 1728.
Section 5.2. Besides, every user must have the signature key d and the verification key Q(x_q, y_q), which also must satisfy the requirements of Section 5.2.
Step 1. Calculate the integers r and s using the received signature zeta. If the inequalities 0 < r < q, 0 < s < q hold, go to the next step. Otherwise, the signature is invalid. Step 2. Calculate the hash code of the received message M: H = h(M) (19) Step 3. Calculate the integer alpha, the binary representation of which is the vector H, and determine if: e = alpha (mod q) (20) If e = 0, then assign e = 1. Step 4. Calculate the value: v = e^(-1) (mod q) (21) Step 5. Calculate the values: z1 = s * v (mod q), z2 = -r * v (mod q) (22) Step 6. Calculate the elliptic curve point C = z1 * P + z2 * Q and determine: R = x_C (mod q), (23) where x_C is x-coordinate of the point. Step 7. If the equality R = r holds, then the signature is accepted. Otherwise, the signature is invalid. The input data of the process are the signed message M, the digital signature zeta, and the verification key Q. The output result is the witness of the signature validity or invalidity.
All numerical values are introduced in decimal and hexadecimal notations. The numbers beginning with 0x are in hexadecimal notation. The symbol "\\" denotes that the number continues on the next line. For example, the notation: 12345\\ 67890 0x499602D2 represents 1234567890 in decimal and hexadecimal number systems, respectively. Section 5.2).
m = 0x80000000000000000000000000000\\ 00150FE8A1892976154C59CFC193ACCF5B3
y_q = 17614944419213781543809391949654080\\ 031942662045363639260709847859438286763994 y_q = 0x26F1B489D6701DD185C8413A977B3\\ CBBAF64D1C593D26627DFFB101A87FF77DA Section 6.1) are performed, the following numerical values are obtained: e = 2079889367447645201713406156150827013\\ 0637142515379653289952617252661468872421 e = 0x2DFBC1B372D89A1188C09C52E0EE\\ C61FCE52032AB1022E8E67ECE6672B043EE5 k = 538541376773484637314038411479966192\\ 41504003434302020712960838528893196233395 k = 0x77105C9B20BCD3122823C8CF6FCC\\ 7B956DE33814E95B7FE64FED924594DCEAB3 And the multiple point C = k * P has the coordinates: x_C = 297009809158179528743712049839382569\\ 90422752107994319651632687982059210933395 x_C = 0x41AA28D2F1AB148280CD9ED56FED\\ A41974053554A42767B83AD043FD39DC0493 y[C] = 328425352786846634770946653225170845\\ 06804721032454543268132854556539274060910 y[C] = 0x489C375A9941A3049E33B34361DD\\ 204172AD98C3E5916DE27695D22A61FAE46E Parameter r = x_C (mod q) takes the value: r = 297009809158179528743712049839382569\\ 90422752107994319651632687982059210933395 r = 0x41AA28D2F1AB148280CD9ED56FED\\ A41974053554A42767B83AD043FD39DC0493
Parameter s = (r * d + k * e)(mod q) takes the value: s = 57497340027008465417892531001914703\\ 8455227042649098563933718999175515839552 s = 0x1456C64BA4642A1653C235A98A602\\ 49BCD6D3F746B631DF928014F6C5BF9C40 Section 6.2) are performed, the following numerical value is obtained: e = 2079889367447645201713406156150827013\\ 0637142515379653289952617252661468872421 e = 0x2DFBC1B372D89A1188C09C52E0EE\\ C61FCE52032AB1022E8E67ECE6672B043EE5 And the parameter v = e^(-1) (mod q) takes the value: v = 176866836059344686773017138249002685\\ 62746883080675496715288036572431145718978 v = 0x271A4EE429F84EBC423E388964555BB\\ 29D3BA53C7BF945E5FAC8F381706354C2 The parameters z1 = s * v (mod q) and z2 = -r * v (mod q) take the values: z1 = 376991675009019385568410572935126561\\ 08841345190491942619304532412743720999759 z1 = 0x5358F8FFB38F7C09ABC782A2DF2A\\ 3927DA4077D07205F763682F3A76C9019B4F z2 = 141719984273434721125159179695007657\\ 6924665583897286211449993265333367109221 z2 = 0x3221B4FBBF6D101074EC14AFAC2D4F7\\ EFAC4CF9FEC1ED11BAE336D27D527665 The point C = z1 * P + z2 * Q has the coordinates: x_C = 2970098091581795287437120498393825699\\ 0422752107994319651632687982059210933395
x_C = 0x41AA28D2F1AB148280CD9ED56FED\\ A41974053554A42767B83AD043FD39DC0493 y[C] = 3284253527868466347709466532251708450\\ 6804721032454543268132854556539274060910 y[C] = 0x489C375A9941A3049E33B34361DD\\ 204172AD98C3E5916DE27695D22A61FAE46E Then the parameter R = x_C (mod q) takes the value: R = 2970098091581795287437120498393825699\\ 0422752107994319651632687982059210933395 R = 0x41AA28D2F1AB148280CD9ED56FED\\ A41974053554A42767B83AD043FD39DC0493 Since the equality R = r holds, the digital signature is accepted. [GOST3410-2001] "Information technology. Cryptographic data security. Signature and verification processes of [electronic] digital signature", GOST R 34.10-2001, Gosudarstvennyi Standard of Russian Federation, Government Committee of Russia for Standards, 2001. (In Russian) [GOST3410-2012] "Information technology. Cryptographic data security. Signature and verification processes of [electronic] digital signature", GOST R 34.10-2012, Federal Agency on Technical Regulating and Metrology, 2012. [GOST3411-2012] "Information technology. Cryptographic Data Security. Hashing function", GOST R 34.11-2012, Federal Agency on Technical Regulating and Metrology, 2012. [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, March 1997.
[RFC4357] Popov, V., Kurepkin, I., and S. Leontiev, "Additional Cryptographic Algorithms for Use with GOST 28147-89, GOST R 34.10-94, GOST R 34.10-2001, and GOST R 34.11-94 Algorithms", RFC 4357, January 2006. [ISO2382-2] ISO, "Data processing - Vocabulary - Part 2: Arithmetic and logic operations", ISO 2382-2, 1976. [ISO9796-2] ISO/IEC, "Information technology - Security techniques - Digital signatures giving message recovery - Part 2: Integer factorization based mechanisms", ISO/IEC 9796-2, 2010. [ISO9796-3] ISO/IEC, "Information technology - Security techniques - Digital signature schemes giving message recovery - Part 3: Discrete logarithm based mechanisms", ISO/IEC 9796-3, 2006. [ISO14888-1] ISO/IEC, "Information technology - Security techniques - Digital signatures with appendix - Part 1: General", ISO/IEC 14888-1, 2008. [ISO14888-2] ISO/IEC, "Information technology - Security techniques - Digital signatures with appendix - Part 2: Integer factorization based mechanisms", ISO/IEC 14888-2, 2008. [ISO14888-3] ISO/IEC, "Information technology - Security techniques - Digital signatures with appendix - Part 3: Discrete logarithm based mechanisms", ISO/IEC 14888-3,2006. [ISO14888-4] ISO/IEC, "Information technology - Security techniques - Digital signatures with appendix - Part 3: Discrete logarithm based mechanisms. Amendment 1. Elliptic Curve Russian Digital Signature Algorithm, Schnorr Digital Signature Algorithm, Elliptic Curve Schnorr Digital Signature Algorithm, and Elliptic Curve Full Schnorr Digital Signature Algorithm", ISO/IEC 14888-3:2006/Amd 1, 2010. [ISO10118-1] ISO/IEC, "Information technology - Security techniques - Hash-functions - Part 1: General", ISO/IEC 10118-1, 2000.
[ISO10118-2] ISO/IEC, "Information technology - Security techniques - Hash-functions - Part 2: Hash- functions using an n-bit block cipher algorithm", ISO/IEC 10118-2, 2010. [ISO10118-3] ISO/IEC, "Information technology - Security techniques - Hash-functions - Part 3: Dedicated hash-functions", ISO/IEC 10118-3, 2004. [ISO10118-4] ISO/IEC, "Information technology - Security techniques - Hash-functions - Part 4: Hash- functions using modular arithmetic", ISO/IEC 10118-4, 1998. [RFC5832] Dolmatov, V., Ed., "GOST R 34.10-2001: Digital Signature Algorithm", RFC 5832, March 2010. [RFC6986] Dolmatov, V., Ed., and A. Degtyarev, "GOST R 34.11-2012: Hash Function", RFC 6986, August 2013.