Advertisement
Guest User

Nettle VAPI

a guest
Dec 22nd, 2014
228
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Vala 0.99 KB | None | 0 0
  1.  
  2. namespace Nettle
  3. {
  4.     [CCode (has_target = false)]
  5.     public delegate void CryptFunc(void* ctx, uint length, uint8* dst, uint8* src);
  6.    
  7.     [CCode (cname = "struct aes_ctx", cprefix = "aes_", cheader_filename = "nettle/aes.h")]
  8.     public struct AES
  9.     {
  10.         public void set_encrypt_key(uint length, uint8* key);
  11.         public void set_decrypt_key(uint length, uint8* key);
  12.         public void invert_key(AES *src);
  13.         public void encrypt(uint length, uint8* dst, uint8* src);
  14.         public void decrypt(uint length, uint8* dst, uint8* src);
  15.     }
  16.    
  17.     [CCode (cname = "cbc_encrypt", cheader_filename = "nettle/cbc.h")]
  18.     public void cbc_encrypt(void* ctx, CryptFunc f, uint block_size, uint8* iv, uint length, uint8* dst, uint8* src);
  19.  
  20.     [CCode (cname = "cbc_decrypt", cheader_filename = "nettle/cbc.h")]
  21.     public void cbc_decrypt(void* ctx, CryptFunc f, uint block_size, uint8* iv, uint length, uint8* dst, uint8* src);
  22.    
  23.     [CCode (cname = "AES_BLOCK_SIZE", cheader_filename = "nettle/aes.h")]
  24.     public const int AES_BLOCK_SIZE;
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement