Zcash 백서

Zcash

원문

bitpro가 원문에서 글자만 모은 내용이에요. 표·그림·수식은 빠지거나 깨질 수 있어요. 전체 35쪽 중 13쪽

e this, consider the ElGamal encryption scheme [ElGamal1985] on thisprime-order subgroup, re- stricted to encrypting plaintexts encoded as the group identity𝒪J. (ElGamal was originally defined for F*𝑝 but works in anyprime-order group.) ElGamalpublic keysthen have the same form asdiversified payment addresses. If we make the assumption above on GroupHashJ(𝑟)*, then generating a newdiversified payment addressfrom a given address pk, gives the same distribution of (gd′,pk d′) pairs as the distribution of ElGamal ciphertexts obtained by encrypting𝒪J under pk.{TODO: check whether this is justified.} Then, the defini- tion ofkey privacy(IK-CPA as defined in [BBDP2001, Definition 1]) for ElGamal corresponds to the definition of Unlinkability for DiversifyHashSapling. (IK-CCA corresponds to the potentially stronger requirement that DiversifyHashSapling remains Unlinkable when given Diffie–Hellman key agreement oracles for each of the candidatediversified payment addresses.) So if ElGamal iskey-private, then DiversifyHashSapling is Unlinkable under the same conditions. [BBDP2001, Appendix A] gives a security proof forkey privacy(both IK-CPA and IK-CCA) of ElGamal under theDecisional Diffie–Hellman assumptionon the relevant group. (In fact the proof needed is the “small modification” described in the last paragraph in which the generator is chosen at random for each key.) 81 • It is assumed (also for the security of other uses of the group hash, such as Pedersen hashes and commitments) that the discrete logarithm of the output group element with respect to any other generator is unknown. This assumption is justified if the group hash acts as arandom oracle. Essentially,diversifiersact as handles to unknown random numbers. (The group hash inputs used with different personalizations are in different “namespaces” .) • Informally, the random self-reducibility property of DDH implies that an adversary would gain no advantage from being able to query an oracle for additional(gd,pk d) pairs with the samespending authorityas an existing shielded payment address, since they could also create such pairs on their own. This justifies only considering twoshielded payment addressesin the security definition. {TODO: FIXME This is not correct, because additional pairs don’t quite follow the same distribution as an address with a valid diversifier. The security definition may need to be more complex to model this properly.} • An 88-bit diversifier cannot be considered cryptographically unguessable at a 128-bit security level; also, randomly chosen diversifiers are likely to suffer birthday collisions when the number of choices approaches 244. If most users are choosing diversifiers randomly (as recommended in §4.2.2 ‘Sapling Key Components’ on p. 38), then the fact that they may accidentally choose diversifiers that collide (and therefore reveal the fact that they are not derived from the sameincoming viewing key) does not appreciably reduce the anonymity set. In [ZIP-32] and §4.2.3 ‘Orchard Key Components’ on p. 40 an 88-bitPseudo Random Permutation, keyed differently for each node of the derivation tree, is used to select newdiversifiers. This resolves the potential problem, provided that the input to thePseudo Random Permutationdoes not repeat for a given node. • If the holder of anincoming viewing keypermits an adversary to ask for a new address for thatincoming viewing keywith a givendiversifier, then it can trivially break Unlinkability for the otherdiversified payment addressesassociated with theincoming viewing key(this does not compromise other privacy properties). ImplementationsSHOULDavoid providing such a “chosendiversifier” oracle. 5.4.1.7 Pedersen Hash Function #concretepedersenhash PedersenHash is an algebraichash functionwithcollision resistance(for fixed input length) derived from assumed hardness of theDiscrete Logarithm Problemon theJubjub curve. It is based on the work of David Chaum, Ivan Damgård, Jeroen van de Graaf, Jurgen Bos, George Purdy, Eugène van Heijst and Birgit Pfitzmann in[CDvdG1987], [BCP1988] and [CvHP1991], and of Mihir Bellare, Oded Goldreich, and Shafi Goldwasser in [BGG1995], with optimiza- tions for efficient instantiation inzk-SNARK circuitsby Sean Bowe and Daira-Emma Hopwood. PedersenHash is used in the definitions ofPedersen commitments( §5.4.8.2 ‘Windowed Pedersen commitments’ on p. 99), and of thePedersen hashfor the Saplingincremental Merkle tree( §5.4.1.3 ‘MerkleCRHSapling Hash Function’ on p.79). LetJ,J (𝑟),𝒪 J,𝑞 J,𝑟 J,𝑎 J, and𝑑 J be as defined in §5.4.9.3 ‘Jubjub’ on p.105. LetExtract J(𝑟) J(𝑟)→B [ℓSaplingMerkle ] be as defined in §5.4.9.4 ‘Coordinate Extractor for Jubjub’ on p.107. LetFindGroupHash J(𝑟)* be as defined in §5.4.9.5 ‘Group Hash into Jubjub’ on p.107. LetUncommitted Sapling be as defined in §5.3 ‘Constants’ on p.77. Let𝑐be the largest integer such that4· 24·𝑐−115 ≤ 𝑟J−12 , i.e.𝑐:= 63. Defineℐ BY Y[8]×N→J (𝑟)* by: ℐ(𝐷, 𝑖) :=FindGroupHashJ(𝑟)*(︁𝐷, 32-bit𝑖−1 )︁. 82 DefinePedersenHashToPoint(𝐷 BY Y[8], 𝑀 B[N+])→J (𝑟) as follows: Pad𝑀to a multiple of3bits by appending zero bits, giving𝑀 ′. Let𝑛=ceiling (︁length(𝑀′) 3·𝑐 )︁ . Split 𝑀′ into 𝑛 segments 𝑀1.. 𝑛so that 𝑀′ =concat B(𝑀1.. 𝑛), and each of 𝑀1.. 𝑛−1is of length 3·𝑐 bits. (𝑀𝑛 may be shorter.) Return ∑︀𝑛 𝑖=1[⟨𝑀𝑖⟩]ℐ(𝐷, 𝑖) J(𝑟). where⟨∙⟩ B[3·{1.. 𝑐}]→ {︀− 𝑟J−12 .. 𝑟J−12 }︀∖{0}is defined as: Let𝑘 𝑖 =length(𝑀 𝑖)/3. Split𝑀 𝑖 into3-bitchunks𝑚 1.. 𝑘𝑖 so that𝑀 𝑖 =concat B(𝑚1.. 𝑘𝑖). Write each𝑚 𝑗 as[𝑠 𝑗0, 𝑠𝑗1, 𝑠𝑗2], and letenc(𝑚 𝑗) = (1−2·𝑠 𝑗2)·(1 +𝑠 𝑗0 + 2·𝑠 𝑗1) Z. Let⟨𝑀 𝑖⟩= ∑︀𝑘𝑖 𝑗=1enc(𝑚𝑗)·2 4·(𝑗−1). Finally, definePedersenHash BY Y[8]×B [N+]→B [ℓSaplingMerkle ] by: PedersenHash(𝐷, 𝑀) :=ExtractJ(𝑟) (︀ PedersenHashToPoint(𝐷, 𝑀) )︀ . See §A.3.3.9 ‘Pedersen hash’ on p.217 for rationale and efficient circuit implementation of these functions. Security requirement: PedersenHash and PedersenHashToPoint are required to becollision-resistantbetween inputs of fixed length, for a given personalization input 𝐷. No other security properties commonly associated with hash functionsare needed. Non-normative note:Thesehash functionsare not collision-resistantfor variable-length inputs. Theorem 5.4.1.The encoding function⟨ ∙⟩is injective. #thmpedersenencodeinjective Proof. We first check that the range of 𝑘𝑖∑︁ 𝑗=1 enc(𝑚𝑗)·2 4·(𝑗−1) is a subset of the allowable range {︀− 𝑟J−12 .. 𝑟J−12 }︀∖{0} . The range of this expression is a subset of{−Δ..Δ}∖{0}whereΔ= 4· 𝑐∑︁ 𝑖=1 24·(𝑖−1) = 4· 24·𝑐−115 . When𝑐= 63, we have 4· 24·𝑐−115 = 0x444444444444444444444444444444444444444444444444444444444444444 𝑟J−1 2 = 0x73EDA753299D7D483339D80809A1D8053341049E6640841684B872F6B7B965B so the required condition is met. This implies that there is no “wrap around” and so ∑︀𝑘𝑖 𝑗=1enc(𝑚𝑗)·2 4·(𝑗−1) may be treated as an integer expression. enc is injective. In order to prove that⟨∙⟩ is injective, consider⟨∙⟩Δ B[3·{1.. 𝑐}]→{0..2·Δ} such that⟨𝑀𝑖⟩Δ =⟨𝑀 𝑖⟩+Δ. With 𝑘𝑖 and 𝑚𝑗 defined as above, we have⟨𝑀𝑖⟩Δ = ∑︀𝑘𝑖𝑗=1enc′(𝑚𝑗)·2 4·(𝑗−1) where enc′(𝑚𝑗) =enc(𝑚 𝑗) + 4 is in {0..8} and enc′ is injective. Express this sum in hexadecimal; then each 𝑚𝑗 affects only one hex digit, and it is easy to see that⟨∙⟩Δ is injective. Therefore so is⟨∙⟩. Since the security proof from[BGG1995, Appendix A] depends only on the encoding being injective and its range not including zero, the proof can be adapted straightforwardly to show that PedersenHashToPointiscollision-resistant under the same assumptions and security bounds. Because ExtractJ(𝑟) is injective, it follows that PedersenHash is equallycollision-resistant. 83 5.4.1.8 Mixing Pedersen Hash Function #concretemixinghash A mixingPedersen hashis used to compute ρ from cm and pos in §4.16 ‘Computingρvalues and Nullifiers’ on p.60. It takes as input aPedersen commitment𝑃, and hashes it with another input𝑥. Define𝒥 Sapling :=FindGroupHash J(𝑟)*(“Zcash_J_”,“ ”). We defineMixingPedersenHash J×{0.. 𝑟 J−1}→Jby: MixingPedersenHash(𝑃, 𝑥) :=𝑃+[𝑥]𝒥 Sapling. Security requirement:The function (𝑟, 𝑀, 𝑥){0.. 𝑟J−1}×B [N+]×{0.. 𝑟J−1}↦→MixingPedersenHash(WindowedPedersenCommit 𝑟(𝑀), 𝑥) J must becollision-resistanton(𝑟, 𝑀, 𝑥). See §A.3.3.10 ‘Mixing Pedersen hash’ on p.219 for efficient circuit implementation of this function. 5.4.1.9 Sinsemilla Hash Function #concretesinsemillahash SinsemillaHash is an algebraichash functionwithcollision resistance(for fixed input length) derived from assumed hardness of theDiscrete Logarithm Problem. It is designed by Sean Bowe and Daira-Emma Hopwood. The motivation for introducing a new discrete-logarithm-based hash function (rather than usingPedersenHash) is to make efficient use of the lookups available in recent proof systems includingHalo 2. SinsemillaHash is used in the definition of SinsemillaCommit ( §5.4.8.4 ‘Sinsemilla commitments’ on p. 101), and for theOrchard-poolincremental Merkle tree( §5.4.1.3 ‘MerkleCRHOrchard Hash Function’ on p.80). LetP,𝒪 P,𝑞 P,𝑟 P, and𝑏 P be as defined in §5.4.9.6 ‘Pallas and Vesta’ on p.108. LetExtract⊥P P∪{⊥}→{0.. 𝑞 P−1}∪{⊥}be as defined in §5.4.9.7 ‘Coordinate Extractor for Pallas’ on p.109. LetGroupHash P be as defined in §5.4.9.8 ‘Group Hash into Pallas and Vesta’ on p.110. LetUncommitted Orchard be as defined in §5.3 ‘Constants’ on p.77. Let I2LEOSP (ℓ N)×{0..2 ℓ−1}→B Y Y[ceiling(ℓ/8)] and LEBS2IP (ℓ N)×B [ℓ]→{0..2 ℓ−1} be as defined in §5.1 ‘Integers, Bit Sequences, and Endianness’ on p.76. Let𝑘:= 10. Let𝑐be the largest integer such that2 𝑐≤ 𝑟P−12 , i.e.𝑐:= 253. Define𝒬 BY Y[N]→P* and𝒮 {0..2 𝑘−1}→P * by: 𝒬(𝐷) :=GroupHash P(︀“z.cash:SinsemillaQ”, 𝐷)︀ 𝒮(𝑗) :=GroupHash P(︀“z.cash:SinsemillaS”,I2LEOSP 32(𝑗))︀. Define/⍟◾⊡⊛d◇⊞⧅ P∪{⊥}×P∪{⊥}→P∪{⊥}as incomplete addition on thePallascurve: ⊥/⍟◾⊡⊛d◇⊞⧅⊥=⊥ ⊥/⍟◾⊡⊛d◇⊞⧅𝑃=⊥ 𝑃/⍟◾⊡⊛d◇⊞⧅⊥=⊥ 𝒪P /⍟◾⊡⊛d◇⊞⧅𝒪 P =⊥ 𝒪P /⍟◾⊡⊛d◇⊞⧅(𝑥 ′, 𝑦′) =⊥ (𝑥, 𝑦)/⍟◾⊡⊛d◇⊞⧅𝒪 P =⊥ (𝑥, 𝑦)/⍟◾⊡⊛d◇⊞⧅(𝑥 ′, 𝑦′) = {︃ ⊥,if𝑥=𝑥 ′ (𝑥, 𝑦) + (𝑥′, 𝑦′),otherwise. 84 Definepad(𝑛 {0.. 𝑐}, 𝑀 B[{𝑛·(𝑘−1)+1.. 𝑛·𝑘}])→{0..2 𝑘−1}[𝑛] as follows: pad𝑀to𝑛·𝑘bits by appending zero bits, giving𝑀 padded. split𝑀 padded into𝑛pieces𝑀 pieces1.. 𝑛, each of length𝑘bits, so that𝑀 padded =concat B(𝑀 pieces1.. 𝑛). return[ [LEBS2IP𝑘(𝑀 pieces𝑖 )for𝑖from1up to𝑛] ]. DefineSinsemillaHashToPoint(𝐷 BY Y[N], 𝑀 B[{0.. 𝑘·𝑐}])→P∪{⊥}as follows: let𝑛 {0.. 𝑐}=ceiling (︁length(𝑀) 𝑘 )︁ let𝑚=pad 𝑛(𝑀) let mutableAcc←𝒬(𝐷) for𝑖from1up to𝑛: setAcc← (︀ Acc/⍟◾⊡⊛d◇⊞⧅𝒮(𝑚 𝑖) )︀ /⍟◾⊡⊛d◇⊞⧅Acc returnAcc. Finally, defineSinsemillaHash BY Y[N]×B [{0.. 𝑘·𝑐}]→{0.. 𝑞P−1}∪{⊥}by: SinsemillaHash(𝐷, 𝑀) :=Extract⊥P(︀SinsemillaHashToPoint(𝐷, 𝑀))︀. See [Zcash-Orchard, section “Sinsemilla”] for rationale and efficient circuit implementation of these functions. Security requirement: SinsemillaHash and SinsemillaHashToPoint are required to becollision-resistantbetween inputs of fixed length, for a given personalization input 𝐷. It must also be infeasible to find inputs (𝐷, 𝑀)such that SinsemillaHashToPoint(𝐷, 𝑀) =⊥. No other security properties commonly associated withhash functionsare needed. Non-normative notes: • Thesehash functionsare not collision-resistantacross variable-length inputs for the same 𝐷 (that is, it is assumed that a single input length will be used for any given𝐷). • The intermediate value [2]GroupHash P(︀“z.cash:SinsemillaQ”, 𝐷)︀ for the first iteration of the loop can be precomputed, if𝐷is known in advance. Security argument #sinsemillasecurity We show a correspondence between Sinsemilla and a vector Pedersen hash, which allows using the security argument from [BGG1995] to show that collision-resistance can be tightly reduced to theDiscrete Logarithm ProbleminP. Define𝛿(𝑎, 𝑏) = {︃ 0,if𝑎̸=𝑏 1,if𝑎=𝑏. Lemma 5.4.2.An injectivity property for Sinsemilla. #lemmasinsemillaonetoone Let 𝑛 {0.. 𝑐}, and consider a sequence of message pieces 𝑚 {0..2 𝑘−1}[𝑛]. Collect the scalars by which each generator𝒮(𝑗)is multiplied in the algorithm forSinsemillaHashToPoint: Define𝜒(𝑚) = [︂ [︂ 𝑛∑︁ 𝑖=1 (︀ 2𝑛−𝑖·𝛿(𝑚 𝑖, 𝑗))︀ (mod𝑟 P)for𝑗from0up to2 𝑘−1 ]︂ ]︂. The mapping𝑚 {0..2 𝑘−1}[𝑛]↦→𝜒(𝑚) F𝑟P[2𝑘] is injective. Proof. There is an injective mapping from 𝑚 to the matrix of bits with 2𝑘 columns and 𝑛 rows, such that the bit at (1-based) column 𝑗+ 1 and row 𝑖 is set if and only if 𝑚𝑖 =𝑗 . Then the binary representations of the elements of 𝜒(𝑚) are given by the columns of this matrix, and they do not overflow due to the requirement that2𝑛≤2 𝑐≤ 𝑟P−12 . The claim follows. 85 Theorem 5.4.3.Collision resistance ofSinsemillaHashandSinsemillaHashToPoint. #thmsinsemillacr Let 𝐷 BY Y[N] be a personalization input, and let ℓ {0.. 𝑘·𝑐} . Finding a collision 𝑀, 𝑀′ B[ℓ] with 𝑀̸=𝑀 ′ such that SinsemillaHashToPoint(𝐷, 𝑀) =SinsemillaHashToPoint(𝐷, 𝑀′)̸=⊥ efficiently yields a nontrivial discrete logarithm relation, and similarly forSinsemillaHash(𝐷, 𝑀) =SinsemillaHash(𝐷, 𝑀′)̸=⊥. Proof. Without loss of generality we can restrict to the case where ℓ is a multiple of 𝑘: since pad𝑛 is injective on inputs of a given bit length,collision resistancefor ℓ=𝑛·𝑘 bits impliescollision resistancefor each length that pads to𝑛·𝑘bits. Sinceℓ∈{0.. 𝑘·𝑐}we have𝑛∈{0.. 𝑐}. Then wheneverSinsemillaHashToPoint(𝐷, 𝑀)̸=⊥, SinsemillaHashToPoint(𝐷, 𝑀) =[2𝑛]𝒬(𝐷) + ∑︀2𝑘−1𝑗=0 [𝜒(𝑚)𝑗+1]𝒮(𝑗), where𝑚=pad 𝑛(𝑀). (The𝑗+ 1is just because sequence indices are1-based.) This is a Pedersen vector hash of the 𝜒(𝑚) elements, with a fixed offset [2𝑛]𝒬(𝐷) . The fixed offset does not affectcollision resistancein this context. (See below for why it cannot be eliminated for SinsemillaHash, or when using incomplete addition.) Theorem 5.4.4 on p. 87 will prove that a⊥ output from SinsemillaHashToPoint yields a nontrivialdiscrete logarithmrelation. It follows that thecollision resistanceof SinsemillaHashToPoint can be tightly reduced, via the proof in [BGG1995, Appendix A], to theDiscrete Logarithm ProblemoverP. Note that [BGG1995] requires for their main scheme that the scalars are nonzero, which is not necessarily the case in our context. However, their proof in Appendix A does not depend on this, given that𝑛 is fixed. The restriction that scalars are nonzero appears to have been motivated by wanting to support variable-length messages and incremental hashing, which we do not. Now we consider SinsemillaHash. We want to prove that, for given 𝐷, if we can find two distinct messages 𝑀 and 𝑀′ such that Extract⊥P(︀SinsemillaHashToPoint(𝐷, 𝑀))︀ =Extract⊥P(︀SinsemillaHashToPoint(𝐷, 𝑀′))︀̸=⊥ then we can efficiently extract adiscrete logarithm. The inputs to Extract⊥P are not⊥, therefore they are in P. Extract⊥P maps 𝑃, 𝑄∈P to the same output if and only if 𝑃=±𝑄 . So either SinsemillaHashToPoint(𝐷, 𝑀) =SinsemillaHashToPoint(𝐷, 𝑀′) (in which case use the original Pedersen hash proof) or SinsemillaHashToPoint(𝐷, 𝑀) =−SinsemillaHashToPoint(𝐷, 𝑀′). In the latter case, let𝑚=pad 𝑛(𝑀)and𝑚 ′ =pad 𝑛(𝑀′), then we have [2𝑛]𝒬(𝐷) + ∑︀2𝑘−1𝑗=0 [𝜒(𝑚)𝑗+1]𝒮(𝑗) =− (︁[2𝑛]𝒬(𝐷) + ∑︀2𝑘−1𝑗′=0 [𝜒(𝑚′)𝑗′+1]𝒮(𝑗′))︁ [2𝑛+1]𝒬(𝐷) + ∑︀2𝑘−1𝑗=0 [𝜒(𝑚)𝑗+1 +𝜒(𝑚′)𝑗+1]𝒮(𝑗) = 0 Because 2𝑛+1≤𝑟 P−1 , the coefficients (mod𝑟 P) are not all zero, and therefore this is a nontrivialdiscrete logarithm relation between independent bases. Non-normative notes: •[JT2020, Lemma 3] proves a tight reduction from finding a nontrivialdiscrete logarithmrelation in aprime- order groupto solving theDiscrete Logarithm Problemin that group. • The above theorem easily extends to the case where additional scalar multiplication terms with independent bases may be added to the SinsemillaHashToPoint output before applying Extract⊥P. This is needed to show security of the SinsemillaShortCommit commitment schemedefined in §5.4.8.4 ‘Sinsemilla commitments’ on p. 101. It is also needed to show security ofnullifierderivation defined in §4.16 on p. 60 against Faerie Gold attacks, as described in §8.4 ‘Faerie Gold attack and fix’ on p.149. • Assuming that GroupHashG acts as arandom oracle, it can also be proven that SinsemillaHashToPoint and SinsemillaHasharecollision-resistantacross different personalization inputs (regardless of input length). 86 Theorem 5.4.4. SinsemillaHashToPoint(. . .) =⊥yields a nontrivial discrete logarithm relation. #thmsinsemillaex Proof. For convenience of reference, we repeat the algorithm forSinsemillaHashToPoint in terms of the message pieces𝑚 {0..2 𝑘−1}[𝑛], with indexing of the intermediate values ofAcc: letAcc 0←𝒬(𝐷) for𝑖from1up to𝑛: letAcc 𝑖← (︀ Acc𝑖−1 /⍟◾⊡⊛d◇⊞⧅𝒮(𝑚 𝑖) )︀ /⍟◾⊡⊛d◇⊞⧅Acc 𝑖−1 returnAcc 𝑛. We have an exceptional case if and only if Acc𝑖−1 =±𝒮(𝑚 𝑖) or Acc𝑖−1 +𝒮(𝑚 𝑖) =±Acc 𝑖−1. (Since none of𝒬(𝐷) or{︀ 𝒮(𝑗)|𝑗∈{0..2 𝑘−1} }︀ are𝒪P, no intermediate results can be𝒪P unless one of the preceding conditions occurs.) If Acc𝑖−1 +𝒮(𝑚 𝑖) =Acc 𝑖−1, then we have 𝒮(𝑚 𝑖) =𝒪 P contrary to assumption. So exceptional cases occur only if [𝛼]Acc 𝑖−1 +𝒮(𝑚 𝑖) =𝒪 P for some 𝑖∈{1.. 𝑛} , and 𝛼=−1 (for the case Acc𝑖−1 =𝒮(𝑚 𝑖)) or 𝛼= 1 (for Acc𝑖−1 =−𝒮(𝑚 𝑖)) or𝛼= 2(forAcc 𝑖−1 +𝒮(𝑚 𝑖) =−Acc 𝑖−1). Acc𝑖 has a representation [2𝑖]𝒬(𝐷) + ∑︀2𝑘−1𝑗=0 [𝑋𝑖,𝑗+1]𝒮(𝑗) for some 𝑋𝑖 {0..2 𝑖−1}[2𝑗]. So given 𝑚 that results in an exceptional case, the nontrivialdiscrete logarithmrelation [𝛼·2 𝑖]𝒬(𝐷) + (︁∑︀2𝑘−1𝑗=0 [𝛼·𝑋 𝑖,𝑗+1]𝒮(𝑗) )︁ +𝒮(𝑚 𝑖) =𝒪 P is easily computable from 𝑚. The coefficients in this representation do not overflow since 𝑋𝑖,𝑗+1 <2 𝑖 for all 𝑖∈{1.. 𝑛}and𝑗∈{0..2 𝑘−1}; and|𝛼·2 𝑖|≤𝑟 P−1for all𝑖∈{1.. 𝑛}and𝛼∈{−1,1,2}. Similarly, a⊥ output from SinsemillaHash yields a nontrivialdiscrete logarithmrelation, because Extract⊥P only returns⊥when its input is⊥. Since by assumption it is hard to find a nontrivialdiscrete logarithmrelation, we can argue that it is safe to use incomplete additions when computing Sinsemilla inside a circuit. 5.4.1.10PoseidonHashFunction #poseidonhash Poseidon is a cryptographic permutation described in [GKRRS2019]. It operates over a sequence of finite field elements, which we instantiate asF 𝑞P [3]. The following specification is intended to follow [GKRRS2019] and Version 1.1 of the Poseidon reference implemen- tation [Poseidon-1.1].8 The S-box function is𝑥↦→𝑥 5. The number of full rounds𝑅 𝐹 is8, and the number of partial rounds𝑅 𝑃 is56. We use Poseidon in a sponge configuration [BDPA2011] (with elementwise addition in F𝑞P replacing exclusive-or of bit strings9) to construct ahash function. The sponge capacity is one field element, the rate is two field elements, and the output is one field element. We use the “Constant-Input-Length” mode described in [GKRRS2019, section 4.2]: for a 2-element input, the initial value of the capacity element is265, and no padding of the input message is needed. That is, if 𝑓 F𝑞P [3]→F 𝑞P[3] is the Poseidon permutation, then thehash function PoseidonHash F𝑞P×F 𝑞P→F 𝑞P is specified as: PoseidonHash(𝑥, 𝑦) =𝑓([𝑥, 𝑦,265])1 (using1-based indexing). The MDS matrix and round constants are generated by generate_parameters_grain.sage in Version 1.1 of the reference implementation. The number of full and partial rounds are as calculated by calc_round_numbers.py in that implementation, for a128-bit security level “with margin” . 8 Previous versions of the reference implementation were inconsistent with the paper. For verifying the parameters used in Zcash, we recommend the fork [Poseidon-Zc1.1] which avoids use of the obsolete PyCrypto library. 9 The sponge construction was originally proposed as operating on an arbitrary group. [BDPA2007] 87 Non-normative notes: • The choice of MDS matrix and the number of rounds take into account cryptanalytic results in [KR2020] and [BCD+2020]. A detailed analysis of related matrix properties is given in [GRS2020]. •[BCD+2020] says that “ ... finite fieldsF𝑞 with a limited number of multiplicative subgroups might be preferable, i.e. one might want to avoid𝑞−1 being smooth. This implies that the fields which are suitable for implementing FFT may be more vulnerable to integral attacks. ”F𝑞P is such a field; the factorization of 𝑞P−1 is 232·3·463· 539204044132271846773·8999194758858563409123804352480028797519453. Furthermore, previous cryptanalysis ofPoseidon has focussed mainly on the case of S-box𝑥↦→𝑥 3. That variant cannot be used in F𝑞P becaus
프로젝트로 돌아가기