diff options
author | Christian Pointner <equinox@anytun.org> | 2017-09-09 03:38:19 +0200 |
---|---|---|
committer | Christian Pointner <equinox@anytun.org> | 2017-09-09 03:38:19 +0200 |
commit | 4ad22ebe0be45d794921e68178c4885f9134ddab (patch) | |
tree | 89f73cfade882936df24dd8fe5e8716c90cd2244 /NOTES | |
parent | fix some typos (diff) |
improved wording for handling of encrypted/plain packet
Diffstat (limited to 'NOTES')
-rw-r--r-- | NOTES | 13 |
1 files changed, 7 insertions, 6 deletions
@@ -94,17 +94,18 @@ Packet Handling (Marshal/Unmarshal): encode/decode using BigEndian.(Put)?Uint(16|32). All of this shouldn't need any mallocs and would therefor be pretty fast. - EncryptedPacket has function DecryptAndVerify() which returns a PlainPacket. - PlainPacket has a EncryptAndAuthenticate() which returns an EncryptedPacket. - The implicit copy operations of the crypto functions are free because the - encrypt/decrypt process needs to read and write the memory anyway and it makes - no difference whether the destination is the same or some other memory area. + EncryptedPacket has function VerifyAndDecrypt() which takes a PlainPacket to + store the result. PlainPacket has a EncryptAndAuthenticate() which takes an + EncryptedPacket to store the result. The implicit copy operations of that + crypto functions are free because the encrypt/decrypt process needs to read + and write the memory anyway and it makes no difference whether the destination + is the same or some other memory area. Conclusion: Any packet handling goroutine holds one EncryptedPacket and one PlainPacket. Idea: Have NumCPU goroutines for receving and NumCPU goroutines for sending. - Receiving: UPD --> decrypt&verify --> tun/tap + Receiving: UPD --> verify&decrypt --> tun/tap Sendung: tun/tap --> encrypt&auth --> UDP |