function vr() {
this.BYTE_LENGTH
=
64
,
this.xBuf
=
[],
this.xBufOff
=
0
,
this.byteCount
=
0
,
this.DIGEST_LENGTH
=
32
,
this.v0
=
[
1937774191
,
1226093241
,
388252375
,
-
628488704
,
-
1452330820
,
372324522
,
-
477237683
,
-
1325724082
],
this.v
=
[
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
],
this.v_
=
[
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
],
this.X0
=
[
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
],
this.X
=
[
68
],
this.xOff
=
0
,
this.T_00_15
=
2043430169
,
this.T_16_63
=
2055708042
,
arguments.length >
0
? this.InitDigest(arguments[
0
]) : this.Init()
}
vr.prototype
=
{
Init: function () {
this.xBuf
=
[
0
,
0
,
0
,
0
],
this.Reset()
},
InitDigest: function (e) {
this.xBuf
=
[e.xBuf.length],
Array.Copy(e.xBuf,
0
, this.xBuf,
0
, e.xBuf.length),
this.xBufOff
=
e.xBufOff,
this.byteCount
=
e.byteCount,
Array.Copy(e.X,
0
, this.X,
0
, e.X.length),
this.xOff
=
e.xOff,
Array.Copy(e.v,
0
, this.v,
0
, e.v.length)
},
GetDigestSize: function () {
return
this.DIGEST_LENGTH
},
Reset: function () {
this.byteCount
=
0
,
this.xBufOff
=
0
,
Array.Clear(this.xBuf,
0
, this.xBuf.length),
Array.Copy(this.v0,
0
, this.v,
0
, this.v0.length),
this.xOff
=
0
,
Array.Copy(this.X0,
0
, this.X,
0
, this.X0.length)
},
GetByteLength: function () {
return
this.BYTE_LENGTH
},
ProcessBlock: function () {
var e, t
=
this.X, r
=
[
64
];
for
(e
=
16
; e <
68
; e
+
=
1
)
t[e]
=
this.P1(t[e
-
16
] ^ t[e
-
9
] ^ Fr(t[e
-
3
],
15
)) ^ Fr(t[e
-
13
],
7
) ^ t[e
-
6
];
for
(e
=
0
; e <
64
; e
+
=
1
)
r[e]
=
t[e] ^ t[e
+
4
];
var o, n, i, s, a, u
=
this.v, c
=
this.v_;
for
(Array.Copy(u,
0
, c,
0
, this.v0.length),
e
=
0
; e <
16
; e
+
=
1
)
a
=
Fr(c[
0
],
12
),
o
=
a
+
c[
4
]
+
Fr(this.T_00_15, e),
o
=
Fr(o,
7
),
n
=
o ^ a,
i
=
this.FF_00_15(c[
0
], c[
1
], c[
2
])
+
c[
3
]
+
n
+
r[e],
s
=
this.GG_00_15(c[
4
], c[
5
], c[
6
])
+
c[
7
]
+
o
+
t[e],
c[
3
]
=
c[
2
],
c[
2
]
=
Fr(c[
1
],
9
),
c[
1
]
=
c[
0
],
c[
0
]
=
i,
c[
7
]
=
c[
6
],
c[
6
]
=
Fr(c[
5
],
19
),
c[
5
]
=
c[
4
],
c[
4
]
=
this.P0(s);
for
(e
=
16
; e <
64
; e
+
=
1
)
a
=
Fr(c[
0
],
12
),
o
=
a
+
c[
4
]
+
Fr(this.T_16_63, e),
o
=
Fr(o,
7
),
n
=
o ^ a,
i
=
this.FF_16_63(c[
0
], c[
1
], c[
2
])
+
c[
3
]
+
n
+
r[e],
s
=
this.GG_16_63(c[
4
], c[
5
], c[
6
])
+
c[
7
]
+
o
+
t[e],
c[
3
]
=
c[
2
],
c[
2
]
=
Fr(c[
1
],
9
),
c[
1
]
=
c[
0
],
c[
0
]
=
i,
c[
7
]
=
c[
6
],
c[
6
]
=
Fr(c[
5
],
19
),
c[
5
]
=
c[
4
],
c[
4
]
=
this.P0(s);
for
(e
=
0
; e <
8
; e
+
=
1
)
u[e] ^
=
c[e];
this.xOff
=
0
,
Array.Copy(this.X0,
0
, this.X,
0
, this.X0.length)
},
ProcessWord: function (e, t) {
var r
=
e[t] <<
24
;
r |
=
(
255
& e[t
+
=
1
]) <<
16
,
r |
=
(
255
& e[t
+
=
1
]) <<
8
,
r |
=
255
& e[t
+
=
1
],
this.X[this.xOff]
=
r,
16
=
=
+
+
this.xOff && this.ProcessBlock()
},
ProcessLength: function (e) {
this.xOff >
14
&& this.ProcessBlock(),
this.X[
14
]
=
this.URShiftLong(e,
32
),
this.X[
15
]
=
4294967295
& e
},
IntToBigEndian: function (e, t, r) {
t[r]
=
e >>>
24
&
255
,
t[r
+
=
1
]
=
e >>>
16
&
255
,
t[r
+
=
1
]
=
e >>>
8
&
255
,
t[r
+
=
1
]
=
255
& e
},
DoFinal: function (e, t) {
this.Finish();
for
(var r
=
0
; r <
8
; r
+
=
1
)
this.IntToBigEndian(this.v[r], e, t
+
4
*
r);
return
this.Reset(),
this.DIGEST_LENGTH
},
Update: function (e) {
this.xBuf[this.xBufOff
+
+
]
=
e,
this.xBufOff
=
=
this.xBuf.length && (this.ProcessWord(this.xBuf,
0
),
this.xBufOff
=
0
),
this.byteCount
+
+
},
BlockUpdate: function (e, t, r) {
while
(
0
!
=
this.xBufOff && r >
0
)
this.Update(e[t]),
t
+
=
1
,
r
-
=
1
;
while
(r > this.xBuf.length)
this.ProcessWord(e, t),
t
+
=
this.xBuf.length,
r
-
=
this.xBuf.length,
this.byteCount
+
=
this.xBuf.length;
while
(r >
0
)
this.Update(e[t]),
t
+
=
1
,
r
-
=
1
},
Finish: function () {
var e
=
this.byteCount <<
3
;
this.Update(
128
);
while
(
0
!
=
this.xBufOff)
this.Update(
0
);
this.ProcessLength(e),
this.ProcessBlock()
},
ROTATE: function (e, t) {
return
e << t | this.URShift(e,
32
-
t)
},
P0: function (e) {
return
e ^ Fr(e,
9
) ^ Fr(e,
17
)
},
P1: function (e) {
return
e ^ Fr(e,
15
) ^ Fr(e,
23
)
},
FF_00_15: function (e, t, r) {
return
e ^ t ^ r
},
FF_16_63: function (e, t, r) {
return
e & t | e & r | t & r
},
GG_00_15: function (e, t, r) {
return
e ^ t ^ r
},
GG_16_63: function (e, t, r) {
return
e & t | ~e & r
},
URShift: function (e, t) {
return
console.error(e),
(e > Int32.maxValue || e < Int32.minValue) && (console.error(e),
e
=
Cr(e)),
e >
=
0
? e >> t : (e >> t)
+
(
2
<< ~t)
},
URShiftLong: function (e, t) {
var r, o
=
new E;
if
(o.fromInt(e),
o.signum() >
=
0
)
r
=
o.shiftRight(t).intValue();
else
{
var n
=
new E;
n.fromInt(
2
);
var i
=
~t
, s
=
"";
if
(i <
0
) {
for
(var a
=
64
+
i, u
=
0
; u < a; u
+
=
1
)
s
+
=
"0"
;
var c
=
new E;
c.fromInt(e >> t);
var l
=
new E(
"10"
+
s,
2
);
s
=
l.toRadix(
10
);
var f
=
l.add(c);
r
=
f.toRadix(
10
)
}
else
s
=
n.shiftLeft(~t).intValue(),
r
=
(e >> t)
+
s
}
return
r
},
GetZ: function (e, t, r) {
var o
=
S.enc.Utf8.parse(r)
, n
=
4
*
o.words.length
*
8
;
this.Update(n >>
8
&
255
),
this.Update(
255
& n);
var i
=
this.GetWords(o.toString());
this.BlockUpdate(i,
0
, i.length);
var s
=
this.GetWords(e.curve.a.toBigInteger().toRadix(
16
))
, a
=
this.GetWords(e.curve.b.toBigInteger().toRadix(
16
))
, u
=
this.GetWords(e.getX().toBigInteger().toRadix(
16
))
, c
=
this.GetWords(e.getY().toBigInteger().toRadix(
16
))
, l
=
this.GetWords(t.substr(
0
,
64
))
, f
=
this.GetWords(t.substr(
64
,
64
));
this.BlockUpdate(s,
0
, s.length),
this.BlockUpdate(a,
0
, a.length),
this.BlockUpdate(u,
0
, u.length),
this.BlockUpdate(c,
0
, c.length),
this.BlockUpdate(l,
0
, l.length),
this.BlockUpdate(f,
0
, f.length);
var h
=
[this.GetDigestSize()];
return
this.DoFinal(h,
0
),
h
},
GetWords: function (e) {
for
(var t
=
[], r
=
e.length, o
=
0
; o < r; o
+
=
2
)
t[t.length]
=
parseInt(e.substr(o,
2
),
16
);
return
t
},
GetHex: function (e) {
for
(var t
=
[], r
=
0
, o
=
0
; o <
2
*
e.length; o
+
=
2
)
t[o >>>
3
] |
=
parseInt(e[r]) <<
24
-
o
%
8
*
4
,
r
+
=
1
;
var n
=
new S.lib.WordArray.init(t, e.length);
return
n
}
}