-/* $OpenBSD: crypto.c,v 1.33 2021/02/04 19:59:15 tobhe Exp $ */
+/* $OpenBSD: crypto.c,v 1.34 2021/02/25 20:13:24 tobhe Exp $ */
/*
* Copyright (c) 2010-2013 Reyk Floeter <reyk@openbsd.org>
}
struct ibuf *
-cipher_setkey(struct iked_cipher *encr, void *key, size_t keylen)
+cipher_setkey(struct iked_cipher *encr, const void *key, size_t keylen)
{
ibuf_release(encr->encr_key);
if ((encr->encr_key = ibuf_new(key, keylen)) == NULL) {
}
struct ibuf *
-cipher_setiv(struct iked_cipher *encr, void *iv, size_t len)
+cipher_setiv(struct iked_cipher *encr, const void *iv, size_t len)
{
ibuf_release(encr->encr_iv);
encr->encr_iv = NULL;
}
void
-cipher_aad(struct iked_cipher *encr, void *in, size_t inlen,
+cipher_aad(struct iked_cipher *encr, const void *in, size_t inlen,
size_t *outlen)
{
int olen = 0;
}
int
-cipher_update(struct iked_cipher *encr, void *in, size_t inlen,
+cipher_update(struct iked_cipher *encr, const void *in, size_t inlen,
void *out, size_t *outlen)
{
int olen;
-/* $OpenBSD: iked.h,v 1.186 2021/02/22 21:58:12 tobhe Exp $ */
+/* $OpenBSD: iked.h,v 1.187 2021/02/25 20:13:24 tobhe Exp $ */
/*
* Copyright (c) 2019 Tobias Heider <tobias.heider@stusta.de>
struct iked_cipher *
cipher_new(uint8_t, uint16_t, uint16_t);
struct ibuf *
- cipher_setkey(struct iked_cipher *, void *, size_t);
+ cipher_setkey(struct iked_cipher *, const void *, size_t);
struct ibuf *
- cipher_setiv(struct iked_cipher *, void *, size_t);
+ cipher_setiv(struct iked_cipher *, const void *, size_t);
int cipher_settag(struct iked_cipher *, uint8_t *, size_t);
int cipher_gettag(struct iked_cipher *, uint8_t *, size_t);
void cipher_free(struct iked_cipher *);
int cipher_init(struct iked_cipher *, int);
int cipher_init_encrypt(struct iked_cipher *);
int cipher_init_decrypt(struct iked_cipher *);
-void cipher_aad(struct iked_cipher *, void *, size_t, size_t *);
-int cipher_update(struct iked_cipher *, void *, size_t, void *, size_t *);
+void cipher_aad(struct iked_cipher *, const void *, size_t, size_t *);
+int cipher_update(struct iked_cipher *, const void *, size_t, void *, size_t *);
int cipher_final(struct iked_cipher *);
size_t cipher_length(struct iked_cipher *);
size_t cipher_keylength(struct iked_cipher *);