1
0

aes 997 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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. .B
  14. void setupAESstate(AESstate *s, uchar key[], int keybytes, uchar *ivec)
  15. .PP
  16. .B
  17. void aesCBCencrypt(uchar*, int, AESstate*)
  18. .PP
  19. .B
  20. void aesCBCdecrypt(uchar*, int, AESstate*)
  21. .PP
  22. .SH DESCRIPTION
  23. .PP
  24. DES is being replaced by Rijndael, also known as AES, as the preferred
  25. block ciper.
  26. .IR setupAESstate ,
  27. .IR aesCBCencrypt ,
  28. and
  29. .I aesCBCdecrypt
  30. implement cipher block chaining encryption.
  31. .I Keybytes
  32. should be 16, 24, or 32.
  33. The initialization vector
  34. .I ivec
  35. of
  36. .I AESbsize
  37. bytes should random enough to be unlikely to be reused but does not need to be
  38. cryptographically strongly unpredictable.
  39. .SH SOURCE
  40. .B /sys/src/libsec
  41. .SH SEE ALSO
  42. .IR mp (2),
  43. .IR blowfish (2),
  44. .IR des (2),
  45. .IR dsa (2),
  46. .IR elgamal (2),
  47. .IR rc4 (2),
  48. .IR rsa (2),
  49. .IR sechash (2),
  50. .IR prime (2),
  51. .IR rand (2)