mirror of
https://github.com/markqvist/Reticulum.git
synced 2026-07-08 09:38:11 -07:00
Before Identity restructure
This commit is contained in:
@@ -0,0 +1,47 @@
|
||||
# from FPE.Destination import *
|
||||
# from FPE.Packet import *
|
||||
# from FPE import FlexPE
|
||||
from FPE import *
|
||||
# from FPE import Destination
|
||||
import time
|
||||
|
||||
def testCallback(message, receiver):
|
||||
print("Got message from "+str(receiver)+": ")
|
||||
print(message)
|
||||
print("----------")
|
||||
|
||||
|
||||
fpe = FlexPE()
|
||||
d1=Destination(Destination.IN, Destination.SINGLE, "messenger", "markqvist")
|
||||
d1.createKey()
|
||||
d1.setCallback(testCallback)
|
||||
|
||||
d2=Destination(Destination.IN, Destination.PLAIN, "plainchat", "markqvist")
|
||||
d2.setCallback(testCallback)
|
||||
|
||||
print d1.name
|
||||
print d1.hexhash
|
||||
print d1.pub
|
||||
print "---"
|
||||
print
|
||||
|
||||
# p1=Packet(d1, "testmessage")
|
||||
# p1.send()
|
||||
msg=""
|
||||
for x in range(300):
|
||||
msg += "a"
|
||||
signed = d1.sign(msg)
|
||||
sl = len(signed)
|
||||
pl = len(d1.pub_bytes)
|
||||
print("Signature length is "+str(sl))
|
||||
print("Minimum announce is "+str(pl+sl+8))
|
||||
|
||||
|
||||
p2=Packet(d1, msg)
|
||||
p2.send()
|
||||
|
||||
# p2=Packet(d2, "something else")
|
||||
# p2.send()
|
||||
|
||||
raw_input()
|
||||
|
||||
Reference in New Issue
Block a user