DRM decrypting tool for Samsung TVs PVR
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.

aes.h 1.1KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /* drmdecrypt -- DRM decrypting tool for Samsung TVs
  2. *
  3. * Copyright (C) 2014 - Bernhard Froehlich <decke@bluelife.at>
  4. * All rights reserved.
  5. *
  6. * This software may be modified and distributed under the terms
  7. * of the GPL v2 license. See the LICENSE file for details.
  8. */
  9. #ifndef __AES_H
  10. #define __AES_H
  11. #define MAXKC (256/32)
  12. #define MAXKB (256/8)
  13. #define MAXNR 14
  14. #define BLOCK_SIZE 16
  15. typedef unsigned char u8;
  16. typedef unsigned short u16;
  17. typedef unsigned int u32;
  18. typedef struct {
  19. u32 ek[ 4*(MAXNR+1) ];
  20. u32 dk[ 4*(MAXNR+1) ];
  21. int rounds;
  22. } block_state;
  23. /* AES */
  24. extern void block_init_aes(block_state *state, unsigned char *key, int keylen);
  25. extern void block_finalize_aes(block_state* self);
  26. extern void block_encrypt_aes(block_state *self, u8 *in, u8 *out);
  27. extern void block_decrypt_aes(block_state *self, u8 *in, u8 *out);
  28. /* AES-NI */
  29. extern void block_init_aesni(block_state *state, unsigned char *key, int keylen);
  30. extern void block_finalize_aesni(block_state* self);
  31. extern void block_encrypt_aesni(block_state *self, u8 *in, u8 *out);
  32. extern void block_decrypt_aesni(block_state *self, u8 *in, u8 *out);
  33. #endif /* __AES_H */