Home | History | Annotate | Download | only in rsa

Lines Matching refs:hLen

22 	hLen := hash.Size()
30 // 2. Let mHash = Hash(M), an octet string of length hLen.
32 if len(mHash) != hLen {
36 // 3. If emLen < hLen + sLen + 2, output "encoding error" and stop.
38 if emLen < hLen+sLen+2 {
43 db := em[:emLen-sLen-hLen-2+1+sLen]
44 h := em[emLen-sLen-hLen-2+1+sLen : emLen-1]
52 // M' is an octet string of length 8 + hLen + sLen with eight
55 // 6. Let H = Hash(M'), an octet string of length hLen.
66 // 7. Generate an octet string PS consisting of emLen - sLen - hLen - 2
70 // emLen - hLen - 1.
72 db[emLen-sLen-hLen-2] = 0x01
73 copy(db[emLen-sLen-hLen-1:], salt)
75 // 9. Let dbMask = MGF(H, emLen - hLen - 1).
98 // 2. Let mHash = Hash(M), an octet string of length hLen.
99 hLen := hash.Size()
100 if hLen != len(mHash) {
104 // 3. If emLen < hLen + sLen + 2, output "inconsistent" and stop.
106 if emLen < hLen+sLen+2 {
116 // 5. Let maskedDB be the leftmost emLen - hLen - 1 octets of EM, and
117 // let H be the next hLen octets.
118 db := em[:emLen-hLen-1]
119 h := em[emLen-hLen-1 : len(em)-1]
128 // 7. Let dbMask = MGF(H, emLen - hLen - 1).
139 for sLen = emLen - (hLen + 2); sLen >= 0; sLen-- {
140 switch db[emLen-hLen-sLen-2] {
153 // 10. If the emLen - hLen - sLen - 2 leftmost octets of DB are not zero
154 // or if the octet at position emLen - hLen - sLen - 1 (the leftmost
157 for _, e := range db[:emLen-hLen-sLen-2] {
162 if db[emLen-hLen-sLen-2] != 0x01 {
172 // M' is an octet string of length 8 + hLen + sLen with eight
175 // 13. Let H' = Hash(M'), an octet string of length hLen.