NVbit : Accessing Bitlocker volumes from linux.
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.

70 lines
1.6KB

  1. /**
  2. * \file padlock.h
  3. */
  4. #ifndef XYSSL_PADLOCK_H
  5. #define XYSSL_PADLOCK_H
  6. #include "aes.h"
  7. #if (defined(__GNUC__) && defined(__i386__))
  8. #ifndef XYSSL_HAVE_X86
  9. #define XYSSL_HAVE_X86
  10. #endif
  11. #define PADLOCK_RNG 0x000C
  12. #define PADLOCK_ACE 0x00C0
  13. #define PADLOCK_PHE 0x0C00
  14. #define PADLOCK_PMM 0x3000
  15. #define PADLOCK_ALIGN16(x) (unsigned long *) (16 + ((long) x & ~15))
  16. #ifdef __cplusplus
  17. extern "C" {
  18. #endif
  19. /**
  20. * \brief PadLock detection routine
  21. *
  22. * \return 1 if CPU has support for the feature, 0 otherwise
  23. */
  24. int padlock_supports( int feature );
  25. /**
  26. * \brief PadLock AES-ECB block en(de)cryption
  27. *
  28. * \param ctx AES context
  29. * \param mode AES_ENCRYPT or AES_DECRYPT
  30. * \param input 16-byte input block
  31. * \param output 16-byte output block
  32. */
  33. void padlock_xcryptecb( aes_context *ctx,
  34. int mode,
  35. unsigned char input[16],
  36. unsigned char output[16] );
  37. /**
  38. * \brief PadLock AES-CBC buffer en(de)cryption
  39. *
  40. * \param ctx AES context
  41. * \param mode AES_ENCRYPT or AES_DECRYPT
  42. * \param length length of the input data
  43. * \param iv initialization vector (updated after use)
  44. * \param input buffer holding the input data
  45. * \param output buffer holding the output data
  46. */
  47. void padlock_xcryptcbc( aes_context *ctx,
  48. int mode,
  49. int length,
  50. unsigned char iv[16],
  51. unsigned char *input,
  52. unsigned char *output );
  53. #ifdef __cplusplus
  54. }
  55. #endif
  56. #endif /* HAVE_X86 */
  57. #endif /* padlock.h */