1 module sodium.crypto_aead_aes256gcm; 2 3 extern (C) 4 { 5 int crypto_aead_aes256gcm_is_available() pure @nogc @safe; 6 7 enum crypto_aead_aes256gcm_KEYBYTES = 32u; 8 size_t crypto_aead_aes256gcm_keybytes() pure @nogc @safe; 9 10 enum crypto_aead_aes256gcm_NSECBYTES = 0u; 11 size_t crypto_aead_aes256gcm_nsecbytes() pure @nogc @safe; 12 13 enum crypto_aead_aes256gcm_NPUBBYTES = 12u; 14 size_t crypto_aead_aes256gcm_npubbytes() pure @nogc @safe; 15 16 enum crypto_aead_aes256gcm_ABYTES = 16u; 17 size_t crypto_aead_aes256gcm_abytes() pure @nogc @safe; 18 19 alias crypto_aead_aes256gcm_state = align(16) ubyte[512]; 20 size_t crypto_aead_aes256gcm_statebytes() pure @nogc @safe; 21 22 int crypto_aead_aes256gcm_encrypt(ubyte* c, ulong* clen_p, const(ubyte)* m, ulong mlen, const(ubyte)* ad, ulong adlen, const(ubyte)* nsec, const(ubyte)* npub, const(ubyte)* k) pure @nogc @safe; 23 24 int crypto_aead_aes256gcm_decrypt(ubyte* m, ulong* mlen_p, ubyte* nsec, const(ubyte)* c, ulong clen, const(ubyte)* ad, ulong adlen, const(ubyte)* npub, const(ubyte)* k) pure nothrow @nogc @safe; 25 26 27 int crypto_aead_aes256gcm_encrypt_detached(ubyte* c, 28 ubyte* mac, 29 ulong* maclen_p, 30 const(ubyte)* m, 31 ulong mlen, 32 const(ubyte)* ad, 33 ulong adlen, 34 const(ubyte)* nsec, 35 const(ubyte)* npub, 36 const(ubyte)* k) pure @nogc @safe; 37 38 int crypto_aead_aes256gcm_decrypt_detached(ubyte *m, 39 ubyte *nsec, 40 const(ubyte)* c, 41 ulong clen, 42 const(ubyte)* mac, 43 const(ubyte)* ad, 44 ulong adlen, 45 const(ubyte)* npub, 46 const(ubyte)* k) pure nothrow @nogc @safe; 47 48 /* -- Precomputation interface -- */ 49 50 int crypto_aead_aes256gcm_beforenm(crypto_aead_aes256gcm_state* ctx_, const(ubyte)* k) pure @nogc @safe; 51 52 int crypto_aead_aes256gcm_encrypt_afternm(ubyte* c, ulong* clen_p, const(ubyte)* m, ulong mlen, const(ubyte)* ad, ulong adlen, const(ubyte)* nsec, const(ubyte)* npub, const(crypto_aead_aes256gcm_state)* ctx_) pure @nogc @safe; 53 54 int crypto_aead_aes256gcm_decrypt_afternm(ubyte* m, ulong* mlen_p, ubyte* nsec, const(ubyte)* c, ulong clen, const(ubyte)* ad, ulong adlen, const(ubyte)* npub, const(crypto_aead_aes256gcm_state)* ctx_) pure nothrow @nogc @safe; 55 56 int crypto_aead_aes256gcm_encrypt_detached_afternm(ubyte* c, 57 ubyte* mac, 58 ulong* maclen_p, 59 const(ubyte)* m, 60 ulong mlen, 61 const(ubyte)* ad, 62 ulong adlen, 63 const(ubyte)* nsec, 64 const(ubyte)* npub, 65 const(crypto_aead_aes256gcm_state)* ctx_) pure @nogc @safe; 66 67 int crypto_aead_aes256gcm_decrypt_detached_afternm(ubyte* m, 68 ubyte* nsec, 69 const(ubyte)* c, 70 ulong clen, 71 const(ubyte)* mac, 72 const(ubyte)* ad, 73 ulong adlen, 74 const(ubyte)* npub, 75 const(crypto_aead_aes256gcm_state)* ctx_) pure nothrow @nogc @safe; 76 77 }