aes 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. .TH AES 2
  2. .SH NAME
  3. setupAESstate, aesCBCencrypt, aesCBCdecrypt - advanced encryption standard (rijndael)
  4. .SH SYNOPSIS
  5. .B #include <u.h>
  6. .br
  7. .B #include <libc.h>
  8. .br
  9. .B #include <mp.h>
  10. .br
  11. .B #include <libsec.h>
  12. .PP
  13. .in +0.5i
  14. .ti -0.5i
  15. .B
  16. void setupAESstate(AESstate *s, uchar key[], int keybytes, uchar *ivec)
  17. .PP
  18. .B
  19. void aesCBCencrypt(uchar *p, int len, AESstate *s)
  20. .PP
  21. .B
  22. void aesCBCdecrypt(uchar *p, int len, AESstate *s)
  23. .SH DESCRIPTION
  24. DES is being replaced by Rijndael, also known as AES, as the preferred
  25. block cipher.
  26. .IR SetupAESstate ,
  27. .IR aesCBCencrypt ,
  28. and
  29. .I aesCBCdecrypt
  30. implement cipher block chaining encryption.
  31. All ciphering is performed in place.
  32. .I Keybytes
  33. should be 16, 24, or 32.
  34. The initialization vector
  35. .I ivec
  36. of
  37. .I AESbsize
  38. bytes should be random enough to be unlikely to be reused
  39. but does not need to be
  40. cryptographically strongly unpredictable.
  41. .SH SOURCE
  42. .B /sys/src/libsec
  43. .SH SEE ALSO
  44. .I aescbc
  45. in
  46. .IR secstore (1),
  47. .IR mp (2),
  48. .IR blowfish (2),
  49. .IR des (2),
  50. .IR dsa (2),
  51. .IR elgamal (2),
  52. .IR rc4 (2),
  53. .IR rsa (2),
  54. .IR sechash (2),
  55. .IR prime (2),
  56. .IR rand (2)
  57. .br
  58. .B http://csrc.nist.gov/encryption/aes/rijndael