Highly-opinionated (ex-bullshit-free) MTPROTO proxy for Telegram. If you use v1.0 or upgrade broke you proxy, please read the chapter Version 2
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

utils.go 332B

1234567891011121314151617181920212223
  1. package obfuscated2
  2. import (
  3. "crypto/aes"
  4. "crypto/cipher"
  5. )
  6. func makeAesCtr(key, iv []byte) cipher.Stream {
  7. block, err := aes.NewCipher(key)
  8. if err != nil {
  9. panic(err)
  10. }
  11. return cipher.NewCTR(block, iv)
  12. }
  13. func invertByteSlices(dst, src []byte) {
  14. lenDst := len(dst) - 1
  15. for i, v := range src {
  16. dst[lenDst-i] = v
  17. }
  18. }