auth_test.go 348 B

1234567891011121314151617181920212223
  1. package mtproto_test
  2. import (
  3. "crypto/rand"
  4. "testing"
  5. "v2ray.com/core/common"
  6. . "v2ray.com/core/proxy/mtproto"
  7. . "v2ray.com/ext/assert"
  8. )
  9. func TestInverse(t *testing.T) {
  10. assert := With(t)
  11. b := make([]byte, 64)
  12. common.Must2(rand.Read(b))
  13. bi := Inverse(b)
  14. assert(b[0], NotEquals, bi[0])
  15. bii := Inverse(bi)
  16. assert(bii, Equals, b)
  17. }