crypto1.h 514 B

1234567891011121314151617181920212223
  1. #pragma once
  2. #include <stdint.h>
  3. #include <stdbool.h>
  4. typedef struct {
  5. uint32_t odd;
  6. uint32_t even;
  7. } Crypto1;
  8. void crypto1_reset(Crypto1* crypto1);
  9. void crypto1_init(Crypto1* crypto1, uint64_t key);
  10. uint8_t crypto1_bit(Crypto1* crypto1, uint8_t in, int is_encrypted);
  11. uint8_t crypto1_byte(Crypto1* crypto1, uint8_t in, int is_encrypted);
  12. uint8_t crypto1_word(Crypto1* crypto1, uint32_t in, int is_encrypted);
  13. uint32_t crypto1_filter(uint32_t in);
  14. uint32_t prng_successor(uint32_t x, uint32_t n);