Git Product home page Git Product logo

noise's Introduction

noise's People

Contributors

aidantwoods-1p avatar david415 avatar gedigi avatar mimoo avatar nbrownus avatar nsmith5 avatar rawdigits avatar titanous avatar zx2c4 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

noise's Issues

Psk2 handshakes

Hi,

psk2 adds the psk after receiving the first message.
would you accept a PR that adds SetPresharedKey() to HandshakeState ?
or alternatively makes Config accessible via Config() *Config

Wrong XX pattern

Hello,

Looking at the XX pattern here

var HandshakeXX = HandshakePattern{
	Name: "XX",
	Messages: [][]MessagePattern{
		{MessagePatternE},
		{MessagePatternE, MessagePatternDHEE, MessagePatternS, MessagePatternDHSE},
		{MessagePatternS, MessagePatternDHSE},
	},
}

The second message pattern is incorrect, it should end with MessagePatternDHES instead as seen here

no example

İf you could write some basic example how to use, read and send data from socket it will be nice.

fatal error: found bad pointer in Go heap when building on armhfp

Hi there,

I am trying to build this on armhfp and I am seeing the following error with the tests.

Executing(%check): /bin/sh -e /var/tmp/rpm-tmp.QHC1OF
+ umask 022
+ cd /builddir/build/BUILD
+ cd noise-2492fe189ae688d7edbeae0fd575de2f1c5fec8e
+ LDFLAGS='-X github.com/flynn/noise/version=0 -X github.com/flynn/noise/version.commit=2492fe189ae688d7edbeae0fd575de2f1c5fec8e'
+ GO_TEST_FLAGS='-buildmode pie -compiler gc'
+ GO_TEST_EXT_LD_FLAGS='-Wl,-z,relro -Wl,--as-needed  -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld '
+ go-rpm-integration check -i github.com/flynn/noise -b /builddir/build/BUILD/noise-2492fe189ae688d7edbeae0fd575de2f1c5fec8e/_build/bin -s /builddir/build/BUILD/noise-2492fe189ae688d7edbeae0fd575de2f1c5fec8e/_build -V 0-0.1.20200202git2492fe1.fc31 -C 2492fe189ae688d7edbeae0fd575de2f1c5fec8e -p /builddir/build/BUILDROOT/golang-github-flynn-noise-0-0.1.20200202git2492fe1.fc31.arm -g /usr/share/gocode -r '.*example.*'
Testing    in: /builddir/build/BUILD/noise-2492fe189ae688d7edbeae0fd575de2f1c5fec8e/_build/src
         PATH: /builddir/build/BUILD/noise-2492fe189ae688d7edbeae0fd575de2f1c5fec8e/_build/bin:/builddir/.local/bin:/builddir/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin
       GOPATH: /builddir/build/BUILD/noise-2492fe189ae688d7edbeae0fd575de2f1c5fec8e/_build:/usr/share/gocode
  GO111MODULE: off
      command: go test -buildmode pie -compiler gc -ldflags "-X github.com/flynn/noise/version=0 -X github.com/flynn/noise/version.commit=2492fe189ae688d7edbeae0fd575de2f1c5fec8e -extldflags '-Wl,-z,relro -Wl,--as-needed  -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld '"
      testing: github.com/flynn/noise
github.com/flynn/noise
runtime: pointer 0x890b05 to unallocated span span.base()=0x890000 span.limit=0x0 span.state=3
runtime: found in object at *(0xfffc2008+0xa538)
object=0xfffc2008 s=nil
fatal error: found bad pointer in Go heap (incorrect use of unsafe or cgo?)

runtime stack:
runtime.throw(0xffdd16a8, 0x3e)
	/usr/lib/golang/src/runtime/panic.go:774 +0x60 fp=0xedafecf8 sp=0xedafece4 pc=0xffc371d4
runtime.findObject(0x890b05, 0xfffc2008, 0xa538, 0x0, 0x0, 0x0)
	/usr/lib/golang/src/runtime/mbitmap.go:397 +0x358 fp=0xedafed1c sp=0xedafecf8 pc=0xffc1802c
runtime.scanblock(0xfffc2008, 0x40000, 0xff1c5c20, 0x425c60, 0x0)
	/usr/lib/golang/src/runtime/mgcmark.go:1086 +0x9c fp=0xedafed48 sp=0xedafed1c pc=0xffc26384
runtime.markrootBlock(0xfffc2008, 0x4848, 0xff1c5c20, 0x425c60, 0x0)
	/usr/lib/golang/src/runtime/mgcmark.go:251 +0x68 fp=0xedafed60 sp=0xedafed48 pc=0xffc23e40
runtime.markroot(0x425c60, 0x2)
	/usr/lib/golang/src/runtime/mgcmark.go:161 +0x370 fp=0xedafeda4 sp=0xedafed60 pc=0xffc23d30
runtime.gcDrain(0x425c60, 0x7)
	/usr/lib/golang/src/runtime/mgcmark.go:915 +0x11c fp=0xedafedec sp=0xedafeda4 pc=0xffc25a9c
runtime.gcBgMarkWorker.func2()
	/usr/lib/golang/src/runtime/mgc.go:1936 +0x17c fp=0xedafee08 sp=0xedafedec pc=0xffc63828
runtime.systemstack(0xedaff450)
	/usr/lib/golang/src/runtime/asm_arm.s:354 +0x90 fp=0xedafee0c sp=0xedafee08 pc=0xffc666a0
runtime.mstart()
	/usr/lib/golang/src/runtime/proc.go:1146 fp=0xedafee0c sp=0xedafee0c pc=0xffc3bfa0

goroutine 27 [GC worker (idle)]:
runtime.systemstack_switch()
	/usr/lib/golang/src/runtime/asm_arm.s:298 +0x4 fp=0x42ff98 sp=0x42ff94 pc=0xffc66604
runtime.gcBgMarkWorker(0x425300)
	/usr/lib/golang/src/runtime/mgc.go:1900 +0x1cc fp=0x42ffe4 sp=0x42ff98 pc=0xffc20d9c
runtime.goexit()
	/usr/lib/golang/src/runtime/asm_arm.s:868 +0x4 fp=0x42ffe4 sp=0x42ffe4 pc=0xffc684e4
created by runtime.gcBgMarkStartWorkers
	/usr/lib/golang/src/runtime/mgc.go:1794 +0x74

goroutine 1 [chan receive]:
runtime.gopark(0xffead380, 0x45c270, 0x170e, 0x3)
	/usr/lib/golang/src/runtime/proc.go:304 +0xe4 fp=0x43cd54 sp=0x43cd40 pc=0xffc3961c
runtime.goparkunlock(...)
	/usr/lib/golang/src/runtime/proc.go:310
runtime.chanrecv(0x45c240, 0x43cddc, 0x400001, 0xffcf15a8)
	/usr/lib/golang/src/runtime/chan.go:524 +0x31c fp=0x43cd9c sp=0x43cd54 pc=0xffc0a998
runtime.chanrecv1(0x45c240, 0x43cddc)
	/usr/lib/golang/src/runtime/chan.go:406 +0x20 fp=0x43cdb0 sp=0x43cd9c pc=0xffc0a678
testing.(*T).Run(0x4b20a0, 0xffdc5974, 0x4, 0xffead138, 0x349)
	/usr/lib/golang/src/testing/testing.go:961 +0x304 fp=0x43ce04 sp=0x43cdb0 pc=0xffcf15c8
testing.runTests.func1(0x4b2000)
	/usr/lib/golang/src/testing/testing.go:1202 +0x68 fp=0x43ce28 sp=0x43ce04 pc=0xffcf4da8
testing.tRunner(0x4b2000, 0x43ced0)
	/usr/lib/golang/src/testing/testing.go:909 +0xb4 fp=0x43ce78 sp=0x43ce28 pc=0xffcf1240
testing.runTests(0x484070, 0xfffc2698, 0x1, 0x1, 0x0)
	/usr/lib/golang/src/testing/testing.go:1200 +0x288 fp=0x43cee0 sp=0x43ce78 pc=0xffcf28b4
testing.(*M).Run(0x462100, 0x0)
	/usr/lib/golang/src/testing/testing.go:1117 +0x15c fp=0x43cf70 sp=0x43cee0 pc=0xffcf19a4
main.main()
	_testmain.go:44 +0x15c fp=0x43cfa4 sp=0x43cf70 pc=0xffdc4f90
runtime.main()
	/usr/lib/golang/src/runtime/proc.go:203 +0x264 fp=0x43cfe4 sp=0x43cfa4 pc=0xffc3914c
runtime.goexit()
	/usr/lib/golang/src/runtime/asm_arm.s:868 +0x4 fp=0x43cfe4 sp=0x43cfe4 pc=0xffc684e4

goroutine 2 [force gc (idle)]:
runtime.gopark(0xffead380, 0xfffdb0f8, 0x1411, 0x1)
	/usr/lib/golang/src/runtime/proc.go:304 +0xe4 fp=0x42efd8 sp=0x42efc4 pc=0xffc3961c
runtime.goparkunlock(...)
	/usr/lib/golang/src/runtime/proc.go:310
runtime.forcegchelper()
	/usr/lib/golang/src/runtime/proc.go:253 +0xd0 fp=0x42efec sp=0x42efd8 pc=0xffc39494
runtime.goexit()
	/usr/lib/golang/src/runtime/asm_arm.s:868 +0x4 fp=0x42efec sp=0x42efec pc=0xffc684e4
created by runtime.init.4
	/usr/lib/golang/src/runtime/proc.go:242 +0x28

goroutine 18 [GC sweep wait]:
runtime.gopark(0xffead380, 0xfffdb238, 0x140c, 0x1)
	/usr/lib/golang/src/runtime/proc.go:304 +0xe4 fp=0x42a7d0 sp=0x42a7bc pc=0xffc3961c
runtime.goparkunlock(...)
	/usr/lib/golang/src/runtime/proc.go:310
runtime.bgsweep(0x45c000)
	/usr/lib/golang/src/runtime/mgcsweep.go:89 +0x184 fp=0x42a7e4 sp=0x42a7d0 pc=0xffc28abc
runtime.goexit()
	/usr/lib/golang/src/runtime/asm_arm.s:868 +0x4 fp=0x42a7e4 sp=0x42a7e4 pc=0xffc684e4
created by runtime.gcenable
	/usr/lib/golang/src/runtime/mgc.go:210 +0x48

goroutine 19 [GC scavenge wait]:
runtime.gopark(0xffead380, 0xfffdb280, 0x140d, 0x1)
	/usr/lib/golang/src/runtime/proc.go:304 +0xe4 fp=0x42af80 sp=0x42af6c pc=0xffc3961c
runtime.goparkunlock(...)
	/usr/lib/golang/src/runtime/proc.go:310
runtime.bgscavenge(0x45c000)
	/usr/lib/golang/src/runtime/mgcscavenge.go:374 +0x4ec fp=0x42afe4 sp=0x42af80 pc=0xffc28334
runtime.goexit()
	/usr/lib/golang/src/runtime/asm_arm.s:868 +0x4 fp=0x42afe4 sp=0x42afe4 pc=0xffc684e4
created by runtime.gcenable
	/usr/lib/golang/src/runtime/mgc.go:211 +0x68

goroutine 20 [finalizer wait]:
runtime.gopark(0xffead380, 0xfffea450, 0x1410, 0x1)
	/usr/lib/golang/src/runtime/proc.go:304 +0xe4 fp=0x42b7a0 sp=0x42b78c pc=0xffc3961c
runtime.goparkunlock(...)
	/usr/lib/golang/src/runtime/proc.go:310
runtime.runfinq()
	/usr/lib/golang/src/runtime/mfinal.go:175 +0xbc fp=0x42b7ec sp=0x42b7a0 pc=0xffc1bca4
runtime.goexit()
	/usr/lib/golang/src/runtime/asm_arm.s:868 +0x4 fp=0x42b7ec sp=0x42b7ec pc=0xffc684e4
created by runtime.createfing
	/usr/lib/golang/src/runtime/mfinal.go:156 +0x4c

goroutine 21 [syscall]:
runtime.notetsleepg(0xfffdce34, 0x3583b2ba, 0x8b, 0x0)
	/usr/lib/golang/src/runtime/lock_futex.go:227 +0x24 fp=0x42e790 sp=0x42e778 pc=0xffc0fadc
runtime.timerproc(0xfffdce20)
	/usr/lib/golang/src/runtime/time.go:311 +0x440 fp=0x42e7e4 sp=0x42e790 pc=0xffc57548
runtime.goexit()
	/usr/lib/golang/src/runtime/asm_arm.s:868 +0x4 fp=0x42e7e4 sp=0x42e7e4 pc=0xffc684e4
created by runtime.(*timersBucket).addtimerLocked
	/usr/lib/golang/src/runtime/time.go:169 +0x17c

goroutine 22 [chan receive]:
runtime.gopark(0xffead380, 0x462f70, 0x4b170e, 0x3)
	/usr/lib/golang/src/runtime/proc.go:304 +0xe4 fp=0x43de30 sp=0x43de1c pc=0xffc3961c
runtime.goparkunlock(...)
	/usr/lib/golang/src/runtime/proc.go:310
runtime.chanrecv(0x462f40, 0x0, 0x1, 0x4a9000)
	/usr/lib/golang/src/runtime/chan.go:524 +0x31c fp=0x43de78 sp=0x43de30 pc=0xffc0a998
runtime.chanrecv1(0x462f40, 0x0)
	/usr/lib/golang/src/runtime/chan.go:406 +0x20 fp=0x43de8c sp=0x43de78 pc=0xffc0a678
gopkg.in/check%2ev1.(*suiteRunner).runTest(...)
	/usr/share/gocode/src/gopkg.in/check.v1/check.go:819
gopkg.in/check%2ev1.(*suiteRunner).run(0x4aa0a0, 0xfffea4b8)
	/usr/share/gocode/src/gopkg.in/check.v1/check.go:624 +0x104 fp=0x43deb4 sp=0x43de8c pc=0xffda873c
gopkg.in/check%2ev1.Run(0xffea2108, 0xfffea4b8, 0x42bf68, 0x68)
	/usr/share/gocode/src/gopkg.in/check.v1/run.go:92 +0x38 fp=0x43dec8 sp=0x43deb4 pc=0xffdae358
gopkg.in/check%2ev1.RunAll(0x43df68, 0x0)
	/usr/share/gocode/src/gopkg.in/check.v1/run.go:84 +0x90 fp=0x43df04 sp=0x43dec8 pc=0xffdae1ac
gopkg.in/check%2ev1.TestingT(0x4b20a0)
	/usr/share/gocode/src/gopkg.in/check.v1/run.go:72 +0x348 fp=0x43df8c sp=0x43df04 pc=0xffdadf9c
github.com/flynn/noise.Test(0x4b20a0)
	/builddir/build/BUILD/noise-2492fe189ae688d7edbeae0fd575de2f1c5fec8e/_build/src/github.com/flynn/noise/noise_test.go:10 +0x1c fp=0x43df94 sp=0x43df8c pc=0xffdb904c
testing.tRunner(0x4b20a0, 0xffead138)
	/usr/lib/golang/src/testing/testing.go:909 +0xb4 fp=0x43dfe4 sp=0x43df94 pc=0xffcf1240
runtime.goexit()
	/usr/lib/golang/src/runtime/asm_arm.s:868 +0x4 fp=0x43dfe4 sp=0x43dfe4 pc=0xffc684e4
created by testing.(*T).Run
	/usr/lib/golang/src/testing/testing.go:960 +0x2e4

goroutine 23 [select]:
runtime.gopark(0xffead3a0, 0x0, 0x1809, 0x1)
	/usr/lib/golang/src/runtime/proc.go:304 +0xe4 fp=0x42be90 sp=0x42be7c pc=0xffc3961c
runtime.selectgo(0x42bf6c, 0x42bf50, 0x2, 0x1, 0x5e479601)
	/usr/lib/golang/src/runtime/select.go:313 +0xcc4 fp=0x42bf34 sp=0x42be90 pc=0xffc4ad40
gopkg.in/check%2ev1.(*resultTracker)._loopRoutine(0x4aa050)
	/usr/share/gocode/src/gopkg.in/check.v1/check.go:470 +0x8c fp=0x42bfe4 sp=0x42bf34 pc=0xffda7998
runtime.goexit()
	/usr/lib/golang/src/runtime/asm_arm.s:868 +0x4 fp=0x42bfe4 sp=0x42bfe4 pc=0xffc684e4
created by gopkg.in/check%2ev1.(*resultTracker).start
	/usr/share/gocode/src/gopkg.in/check.v1/check.go:450 +0x30

goroutine 5 [runnable]:
golang.org/x/crypto/curve25519.feMul121666(0x4dd6b8, 0x4dd780)
	/usr/share/gocode/src/golang.org/x/crypto/curve25519/curve25519.go:666 +0x37c fp=0x4dd67c sp=0x4dd67c pc=0xffd69694
golang.org/x/crypto/curve25519.scalarMult(0x87c560, 0x4dd7e0, 0x4dd800)
	/usr/share/gocode/src/golang.org/x/crypto/curve25519/curve25519.go:821 +0x2c4 fp=0x4dd7d0 sp=0x4dd67c pc=0xffd69d6c
golang.org/x/crypto/curve25519.ScalarMult(...)
	/usr/share/gocode/src/golang.org/x/crypto/curve25519/doc.go:15
github.com/flynn/noise.dh25519.DH(0x87c320, 0x20, 0x20, 0x87c540, 0x20, 0x20, 0x0, 0x0, 0x778f6af0)
	/builddir/build/BUILD/noise-2492fe189ae688d7edbeae0fd575de2f1c5fec8e/_build/src/github.com/flynn/noise/cipher_suite.go:123 +0xcc fp=0x4dd824 sp=0x4dd7d0 pc=0xffdb4fc4
github.com/flynn/noise.(*dh25519).DH(0xfffea3c0, 0x87c320, 0x20, 0x20, 0x87c540, 0x20, 0x20, 0xffdc41bc, 0xffeb20f0, 0x85eb10)
	<autogenerated>:1 +0x5c fp=0x4dd84c sp=0x4dd824 pc=0xffdc4ae8
github.com/flynn/noise.(*ciphersuite).DH(0x85eb10, 0x87c320, 0x20, 0x20, 0x87c540, 0x20, 0x20, 0x0, 0xffcd439c, 0x464000)
	<autogenerated>:1 +0x64 fp=0x4dd878 sp=0x4dd84c pc=0xffdc33c0
github.com/flynn/noise.(*HandshakeState).ReadMessage(0x8641c0, 0x0, 0x0, 0x0, 0x885750, 0x4a, 0x4a, 0x1, 0x6a, 0x6a, ...)
	/builddir/build/BUILD/noise-2492fe189ae688d7edbeae0fd575de2f1c5fec8e/_build/src/github.com/flynn/noise/state.go:450 +0x250 fp=0x4dd8d4 sp=0x4dd878 pc=0xffdb84d4
github.com/flynn/noise.NoiseSuite.TestVectors(0x4b2460)
	/builddir/build/BUILD/noise-2492fe189ae688d7edbeae0fd575de2f1c5fec8e/_build/src/github.com/flynn/noise/vector_test.go:219 +0xc90 fp=0x4ddd70 sp=0x4dd8d4 pc=0xffdc1b3c
github.com/flynn/noise.(*NoiseSuite).TestVectors(0xfffea4b8, 0x4b2460)
	<autogenerated>:1 +0x34 fp=0x4ddd78 sp=0x4ddd70 pc=0xffdc4618
runtime.call16(0x4608e0, 0x47a608, 0x47a4b0, 0x8, 0x8)
	/usr/lib/golang/src/runtime/asm_arm.s:516 +0x4c fp=0x4ddd8c sp=0x4ddd78 pc=0xffc66a58
reflect.Value.call(0xffea2108, 0xfffea4b8, 0x1613, 0xffdc5920, 0x4, 0x42cf98, 0x1, 0x1, 0xffdaf244, 0xffea2108, ...)
	/usr/lib/golang/src/reflect/value.go:460 +0x4c0 fp=0x4ddea0 sp=0x4ddd8c pc=0xffcbd824
reflect.Value.Call(0xffea2108, 0xfffea4b8, 0x1613, 0x42cf98, 0x1, 0x1, 0x0, 0x0, 0x0)
	/usr/lib/golang/src/reflect/value.go:321 +0x7c fp=0x4ddedc sp=0x4ddea0 pc=0xffcbd160
gopkg.in/check%2ev1.(*suiteRunner).forkTest.func1(0x4b2460)
	/usr/share/gocode/src/gopkg.in/check.v1/check.go:781 +0x5d8 fp=0x4ddfa4 sp=0x4ddedc pc=0xffdaf6ac
gopkg.in/check%2ev1.(*suiteRunner).forkCall.func1(0x4aa0a0, 0x4b2460, 0x484aa0)
	/usr/share/gocode/src/gopkg.in/check.v1/check.go:675 +0x88 fp=0x4ddfdc sp=0x4ddfa4 pc=0xffdaeee8
runtime.goexit()
	/usr/lib/golang/src/runtime/asm_arm.s:868 +0x4 fp=0x4ddfdc sp=0x4ddfdc pc=0xffc684e4
created by gopkg.in/check%2ev1.(*suiteRunner).forkCall
	/usr/share/gocode/src/gopkg.in/check.v1/check.go:672 +0x1b8

goroutine 6 [GC worker (idle)]:
runtime.gopark(0xffead2c8, 0x845190, 0xffc61418, 0x0)
	/usr/lib/golang/src/runtime/proc.go:304 +0xe4 fp=0x42cf98 sp=0x42cf84 pc=0xffc3961c
runtime.gcBgMarkWorker(0x424000)
	/usr/lib/golang/src/runtime/mgc.go:1846 +0xf0 fp=0x42cfe4 sp=0x42cf98 pc=0xffc20cc0
runtime.goexit()
	/usr/lib/golang/src/runtime/asm_arm.s:868 +0x4 fp=0x42cfe4 sp=0x42cfe4 pc=0xffc684e4
created by runtime.gcBgMarkStartWorkers
	/usr/lib/golang/src/runtime/mgc.go:1794 +0x74
exit status 2
FAIL	github.com/flynn/noise	4.163s

nonce byte array allocations

nonce preparation in Encrypt and Decrypt causes an allocation. In an application encrypting/decrypting at 200k+ times a second this becomes rather noticeable in the garbage collector.

One way I've been thinking of working around this is to provide a function similar to this:

func (c aeadCipher) EncryptNB(out []byte, n uint64, ad, plaintext []byte, nb []byte) []byte {
	nb[0] = 0
	nb[1] = 0
	nb[2] = 0
	nb[3] = 0
	binary.BigEndian.PutUint64(nb[4:], n)
	return c.Seal(out, nb, plaintext, ad)
}

Obviously there are a handful of issues here, is the byte array big enough, too big, being used by another thread? Adding (some of) those checks would still likely be less overhead though.

I can bring crypto into my part of the program, but this feels bad:

nb[0] = 0
nb[1] = 0
nb[2] = 0
nb[3] = 0
binary.BigEndian.PutUint64(nb[4:], n)
return s.c.(cipher.AEAD).Open(out, nb, ciphertext, ad)

Other thoughts would be to internalize a heap for storing nonce byte arrays.

Wanted to get your thoughts on the matter before I sent any PRs your way, thanks!

add PQ crypto HFS extention

Are you interested in this feature?
Here's the noise fork by Yawning Angel that has the HFS using NewHope-Simple:

https://github.com/katzenpost/noise

Here's the spec extension:

https://raw.githubusercontent.com/noiseprotocol/noise_spec/41d478d3dd97d77a6695f4d6cf6283e2830e9ca6/extensions/ext_hybrid_forward_secrecy.md

Go ahead and merge the code if you want it. We aren't going to do gpg signing with legal names as per your policy but you are welcome to merge the code without a pull-request from us. :)

Incorrect max handshake message payload size calculation

As stated in spec,

A Noise handshake message is also less than or equal to 65535 bytes.

It includes plain & encrypted public keys as well as authentication tag, provided by AEAD cipher.

So, this code

	if len(payload) > MaxMsgLen {
		panic("noise: message is too long")
	}

is incorrect. MaxMsgLen depends on DHLen & token/pattern

Unknown pattern `XR`

Hello,

What is this XR pattern?

var HandshakeXR = HandshakePattern{
	Name: "XR",
	Messages: [][]MessagePattern{
		{MessagePatternE},
		{MessagePatternE, MessagePatternDHEE},
		{MessagePatternS, MessagePatternDHSE},
		{MessagePatternS, MessagePatternDHSE},
	},
}

I do not see any mention of it in the specification of Noise.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.