Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 25th, 2012  |  syntax: None  |  size: 0.33 KB  |  hits: 26  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Can someone give an encryption/decryption example with OpenSSL AES CCM?
  2. // Tell the alg we will encrypt Psize bytes
  3. int outl = 0;
  4. EVP_EncryptUpdate(ctx, 0, &outl, 0, Psize);
  5.  
  6. // Add the AAD
  7. EVP_EncryptUpdate(ctx, 0, &outl, A, Asize);
  8.  
  9. // Now we encrypt the data in P, placing the output in CT
  10. EVP_EncryptUpdate(ctx, CT, &outl, P, Psize);