freebsd-nq/sys/opencrypto/xform_poly1305.h
John Baldwin 9b6b2f8608 Adjust crypto_apply function callbacks for OCF.
- crypto_apply() is only used for reading a buffer to compute a
  digest, so change the data pointer to a const pointer.

- To better match m_apply(), change the data pointer type to void *
  and the length from uint16_t to u_int.  The length field in
  particular matters as none of the apply logic was splitting requests
  larger than UINT16_MAX.

- Adjust the auth_xform Update callback to match the function
  prototype passed to crypto_apply() and crypto_apply_buf().  This
  removes the needs for casts when using the Update callback.

- Change the Reinit and Setkey callbacks to also use a u_int length
  instead of uint16_t.

- Update auth transforms for the changes.  While here, use C99
  initializers for auth_hash structures and avoid casts on callbacks.

Reviewed by:	cem
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D25171
2020-06-10 21:18:19 +00:00

17 lines
397 B
C

/* This file is in the public domain. */
/* $FreeBSD$ */
#pragma once
#include <sys/types.h>
struct poly1305_xform_ctx;
void Poly1305_Init(void *);
void Poly1305_Setkey(struct poly1305_xform_ctx *,
const uint8_t [__min_size(32)], size_t);
int Poly1305_Update(struct poly1305_xform_ctx *, const void *, size_t);
void Poly1305_Final(uint8_t [__min_size(16)], struct poly1305_xform_ctx *);