Lines Matching refs:nonce
23 void SetNonce(uint8 nonce[32], unsigned time, const uint8 orbit[8]) {
24 nonce[0] = time >> 24;
25 nonce[1] = time >> 16;
26 nonce[2] = time >> 8;
27 nonce[3] = time;
28 memcpy(nonce + 4, orbit, 8);
29 memset(nonce + 12, 0, 20);
37 uint8 nonce[32];
38 SetNonce(nonce, 999, kOrbit);
39 ASSERT_FALSE(set.Insert(nonce, 1000));
40 SetNonce(nonce, 1000, kOrbit);
41 ASSERT_FALSE(set.Insert(nonce, 1000));
50 uint8 nonce[32];
51 SetNonce(nonce, 0, kOrbit);
52 ASSERT_TRUE(set.Insert(nonce, 0));
53 ASSERT_FALSE(set.Insert(nonce, 0));
61 uint8 nonce[32];
62 SetNonce(nonce, 1101, kOrbit);
63 ASSERT_FALSE(set.Insert(nonce, 1000));
64 SetNonce(nonce, 999, kOrbit);
65 ASSERT_FALSE(set.Insert(nonce, 1100));
73 uint8 nonce[32];
75 SetNonce(nonce, 1101, kBadOrbit);
76 ASSERT_FALSE(set.Insert(nonce, 1100));
83 uint8 nonce[32];
84 SetNonce(nonce, 1101, kOrbit);
85 ASSERT_TRUE(set.Insert(nonce, 1100));
93 uint8 nonce[32];
94 SetNonce(nonce, 1101, kOrbit);
95 ASSERT_TRUE(set.Insert(nonce, 1100));
96 ASSERT_FALSE(set.Insert(nonce, 1100));
103 uint8 nonce[6][32];
105 SetNonce(nonce[i], 1101, kOrbit);
106 nonce[i][31] = i;
107 ASSERT_TRUE(set.Insert(nonce[i], 1100));
111 SetNonce(nonce[5], 1102, kOrbit);
112 ASSERT_TRUE(set.Insert(nonce[5], 1100));
115 SetNonce(nonce[5], 1101, kOrbit);
116 nonce[5][31] = 10;
117 ASSERT_FALSE(set.Insert(nonce[5], 1100));
125 uint8 nonce[32];
126 SetNonce(nonce, 1101, kOrbit);
128 SetNonce(nonce, 1101 + i/500, kOrbit);
129 memcpy(nonce + 12, &i, sizeof(i));
130 set.Insert(nonce, 1100);
176 string nonce;
177 nonce.reserve(32);
178 nonce +=
180 nonce +=
184 set<string>::const_iterator it = nonces_.find(nonce);
193 nonces_.insert(nonce);
278 uint8 nonce[32];
279 SetNonce(nonce, time, kOrbit);
281 // There are 2048 possible nonce values:
283 nonce[30] = v >> 8;
284 nonce[31] = v;
286 const bool r2 = s2->Insert(nonce, time);
287 const bool r1 = s1->Insert(nonce, time);