diff options
author | David Gwynne <dlg@cvs.openbsd.org> | 2014-12-30 11:09:00 +0000 |
---|---|---|
committer | David Gwynne <dlg@cvs.openbsd.org> | 2014-12-30 11:09:00 +0000 |
commit | a5803d1822902f261331b9f5716f0d288ce34dd3 (patch) | |
tree | 293ec8f910ea3a291b9408955fe36a74e6650a00 | |
parent | cbd2f454988a990a759345328ff2f8a9b46f4637 (diff) |
add __bounded as appropriate.
looks good to deraadt@ miod@ and tedu@
-rw-r--r-- | sys/crypto/siphash.h | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/sys/crypto/siphash.h b/sys/crypto/siphash.h index 9a6664319dc..eb2be5e44c1 100644 --- a/sys/crypto/siphash.h +++ b/sys/crypto/siphash.h @@ -1,4 +1,4 @@ -/* $OpenBSD: siphash.h,v 1.2 2014/12/20 06:04:39 tedu Exp $ */ +/* $OpenBSD: siphash.h,v 1.3 2014/12/30 11:08:59 dlg Exp $ */ /*- * Copyright (c) 2013 Andre Oppermann <andre@FreeBSD.org> * All rights reserved. @@ -64,10 +64,13 @@ typedef struct { } SIPHASH_KEY; void SipHash_Init(SIPHASH_CTX *, const SIPHASH_KEY *); -void SipHash_Update(SIPHASH_CTX *, int, int, const void *, size_t); +void SipHash_Update(SIPHASH_CTX *, int, int, const void *, size_t) + __bounded((__string__, 4, 5)); u_int64_t SipHash_End(SIPHASH_CTX *, int, int); -void SipHash_Final(void *, SIPHASH_CTX *, int, int); -u_int64_t SipHash(const SIPHASH_KEY *, int, int, const void *, size_t); +void SipHash_Final(void *, SIPHASH_CTX *, int, int) + __bounded((__minbytes__, 1, SIPHASH_DIGEST_LENGTH)); +u_int64_t SipHash(const SIPHASH_KEY *, int, int, const void *, size_t) + __bounded((__string__, 4, 5)); #define SipHash24_Init(_c, _k) SipHash_Init((_c), (_k)) #define SipHash24_Update(_c, _p, _l) SipHash_Update((_c), 2, 4, (_p), (_l)) |