ciphertwiddle.c 380 B

12345678910111213141516171819202122232425262728
  1. #include "ssh.h"
  2. static CipherState*
  3. inittwiddle(Conn *c, int)
  4. {
  5. /* must be non-nil */
  6. fprint(2, "twiddle key is %.*H\n", SESSKEYLEN, c->sesskey);
  7. return (CipherState*)~0;
  8. }
  9. static void
  10. twiddle(CipherState*, uchar *buf, int n)
  11. {
  12. int i;
  13. for(i=0; i<n; i++)
  14. buf[i] ^= 0xFF;
  15. }
  16. Cipher ciphertwiddle =
  17. {
  18. SSH_CIPHER_TWIDDLE,
  19. "twiddle",
  20. inittwiddle,
  21. twiddle,
  22. twiddle,
  23. };