316cbe323513a0f20d1cf519fe9405e231d633e2Aki Tuomi#ifndef OSTREAM_ENCRYPT_H
316cbe323513a0f20d1cf519fe9405e231d633e2Aki Tuomi#define OSTREAM_ENCRYPT_H
316cbe323513a0f20d1cf519fe9405e231d633e2Aki Tuomi
316cbe323513a0f20d1cf519fe9405e231d633e2Aki Tuomistruct dcrypt_public_key;
316cbe323513a0f20d1cf519fe9405e231d633e2Aki Tuomistruct dcrypt_context_symmetric;
316cbe323513a0f20d1cf519fe9405e231d633e2Aki Tuomi
316cbe323513a0f20d1cf519fe9405e231d633e2Aki Tuomi/**
316cbe323513a0f20d1cf519fe9405e231d633e2Aki Tuomi * algorithm is in form AES-256-CBC-SHA1, recommended
316cbe323513a0f20d1cf519fe9405e231d633e2Aki Tuomi * AES-256-GCM-SHA256
316cbe323513a0f20d1cf519fe9405e231d633e2Aki Tuomi *
316cbe323513a0f20d1cf519fe9405e231d633e2Aki Tuomi * Algorithms (both crypto and digest) *MUST* have OID to use it.
316cbe323513a0f20d1cf519fe9405e231d633e2Aki Tuomi *
316cbe323513a0f20d1cf519fe9405e231d633e2Aki Tuomi */
316cbe323513a0f20d1cf519fe9405e231d633e2Aki Tuomi
316cbe323513a0f20d1cf519fe9405e231d633e2Aki Tuomistruct ostream *
316cbe323513a0f20d1cf519fe9405e231d633e2Aki Tuomio_stream_create_encrypt(struct ostream *output,
316cbe323513a0f20d1cf519fe9405e231d633e2Aki Tuomi const char *algorithm,
316cbe323513a0f20d1cf519fe9405e231d633e2Aki Tuomi struct dcrypt_public_key *box_pub,
316cbe323513a0f20d1cf519fe9405e231d633e2Aki Tuomi enum io_stream_encrypt_flags flags);
316cbe323513a0f20d1cf519fe9405e231d633e2Aki Tuomi
316cbe323513a0f20d1cf519fe9405e231d633e2Aki Tuomi/* create context for performing encryption with
316cbe323513a0f20d1cf519fe9405e231d633e2Aki Tuomi preset crypto context. do not call ctx_sym_init.
316cbe323513a0f20d1cf519fe9405e231d633e2Aki Tuomi
316cbe323513a0f20d1cf519fe9405e231d633e2Aki Tuomi no header or mac is written, just plain crypto
316cbe323513a0f20d1cf519fe9405e231d633e2Aki Tuomi data.
316cbe323513a0f20d1cf519fe9405e231d633e2Aki Tuomi */
316cbe323513a0f20d1cf519fe9405e231d633e2Aki Tuomistruct ostream *
316cbe323513a0f20d1cf519fe9405e231d633e2Aki Tuomio_stream_create_sym_encrypt(struct ostream *output,
316cbe323513a0f20d1cf519fe9405e231d633e2Aki Tuomi struct dcrypt_context_symmetric *ctx);
316cbe323513a0f20d1cf519fe9405e231d633e2Aki Tuomi
316cbe323513a0f20d1cf519fe9405e231d633e2Aki Tuomi#endif