Lines Matching refs:alice

124 func setupConversation(t *testing.T) (alice, bob *Conversation) {
128 alice, bob = new(Conversation), new(Conversation)
130 alice.PrivateKey = new(PrivateKey)
132 alice.PrivateKey.Parse(alicePrivateKey)
134 alice.FragmentSize = 100
137 if alice.IsEncrypted() {
144 performHandshake(t, alice, bob)
145 return alice, bob
148 func performHandshake(t *testing.T, alice, bob *Conversation) { argument
172 out, _, aliceChange, alicesMessage, err = alice.Receive(msg)
192 if !bytes.Equal(alice.SSID[:], bob.SSID[:]) {
193 t.Errorf("Session identifiers don't match. Alice has %x, Bob has %x", alice.SSID[:], bob.SSID[:])
196 if !alice.IsEncrypted() {
210 func roundTrip(t *testing.T, alice, bob *Conversation, message []byte, macKeyCheck int) { argument
211 alicesMessage, err := alice.Send(message)
216 if len(alice.oldMACs) != 0 {
260 out, encrypted, _, _, err := alice.Receive(msg)
280 if len(alice.oldMACs) != 20 {
281 t.Errorf("Alice has %d bytes of MAC keys to reveal, but should have 20", len(alice.oldMACs))
284 if len(alice.oldMACs) != 40 {
285 t.Errorf("Alice has %d bytes of MAC keys to reveal, but should have 40", len(alice.oldMACs))
291 alice, bob := setupConversation(t)
300 roundTrip(t, alice, bob, testMessage, roundTripType)
306 var alice, bob Conversation
308 alice.smp.secret = new(big.Int).SetInt64(42)
309 bob.smp.secret = alice.smp.secret
316 alicesMessages = alice.startSMP("")
334 out, aliceComplete, err = alice.processSMP(msg)
353 var alice, bob Conversation
355 alice.smp.secret = new(big.Int).SetInt64(42)
360 alicesMessages = alice.startSMP("")
375 out, complete, _ := alice.processSMP(msg)
387 alice, bob := setupConversation(t)
388 roundTrip(t, alice, bob, []byte("test"), firstRoundTrip)
389 roundTrip(t, alice, bob, []byte("test 2"), subsequentRoundTrip)
390 roundTrip(t, alice, bob, []byte("test 3"), subsequentRoundTrip)
391 roundTrip(t, alice, bob, []byte("test 4"), subsequentRoundTrip)
392 roundTrip(t, alice, bob, []byte("test 5"), subsequentRoundTrip)
393 roundTrip(t, alice, bob, []byte("test 6"), subsequentRoundTrip)
394 roundTrip(t, alice, bob, []byte("test 7"), subsequentRoundTrip)
395 roundTrip(t, alice, bob, []byte("test 8"), subsequentRoundTrip)
396 performHandshake(t, alice, bob)
397 roundTrip(t, alice, bob, []byte("test"), noMACKeyCheck)
398 roundTrip(t, alice, bob, []byte("test 2"), noMACKeyCheck)
408 var alice Conversation
409 alice.PrivateKey = new(PrivateKey)
410 alice.PrivateKey.Parse(alicePrivateKey)
442 text, encrypted, change, alicesMessage, err := alice.Receive(line)
451 alicesMessage, err := alice.Send([]byte("Go -> libotr test message"))