summaryrefslogtreecommitdiff
path: root/beecrypt
diff options
context:
space:
mode:
authorjbj <devnull@localhost>2004-08-02 16:17:49 +0000
committerjbj <devnull@localhost>2004-08-02 16:17:49 +0000
commit90afeb87035da6b7603dd0360fae23b5f715b0bf (patch)
tree2bbdd4653d15868b0994f0a84aa66fed48d4032f /beecrypt
parent21bd2977b7f2f6fb43fab81fade1777938eaed15 (diff)
downloadrpm-90afeb87035da6b7603dd0360fae23b5f715b0bf.tar.gz
rpm-90afeb87035da6b7603dd0360fae23b5f715b0bf.tar.bz2
rpm-90afeb87035da6b7603dd0360fae23b5f715b0bf.zip
Annotate function args.
CVS patchset: 7379 CVS date: 2004/08/02 16:17:49
Diffstat (limited to 'beecrypt')
-rw-r--r--beecrypt/.splintrc3
-rw-r--r--beecrypt/aes.h8
-rw-r--r--beecrypt/base64.h2
-rw-r--r--beecrypt/beecrypt.h136
-rw-r--r--beecrypt/blockmode.h4
-rw-r--r--beecrypt/blockpad.h12
-rw-r--r--beecrypt/blowfish.c1
-rw-r--r--beecrypt/blowfish.h20
-rw-r--r--beecrypt/dhaes.c2
-rw-r--r--beecrypt/dhaes.h26
-rw-r--r--beecrypt/dldp.c8
-rw-r--r--beecrypt/dldp.h62
-rw-r--r--beecrypt/dlkp.h16
-rw-r--r--beecrypt/dlpk.h18
-rw-r--r--beecrypt/dlsvdp-dh.h4
-rw-r--r--beecrypt/dsa.h6
-rw-r--r--beecrypt/elgamal.h4
-rw-r--r--beecrypt/entropy.c20
-rw-r--r--beecrypt/entropy.h25
-rw-r--r--beecrypt/fips186.c2
-rw-r--r--beecrypt/fips186.h16
-rw-r--r--beecrypt/hmac.h10
-rw-r--r--beecrypt/hmacmd5.h10
-rw-r--r--beecrypt/hmacsha1.h10
-rw-r--r--beecrypt/hmacsha256.h10
-rw-r--r--beecrypt/md5.c2
-rw-r--r--beecrypt/md5.h8
-rw-r--r--beecrypt/memchunk.c1
-rw-r--r--beecrypt/memchunk.h16
-rw-r--r--beecrypt/mp.h86
-rw-r--r--beecrypt/mpbarrett.c2
-rw-r--r--beecrypt/mpbarrett.h118
-rw-r--r--beecrypt/mpnumber.h50
-rw-r--r--beecrypt/mpprime.c5
-rw-r--r--beecrypt/mpprime.h22
-rw-r--r--beecrypt/mtprng.c2
-rw-r--r--beecrypt/mtprng.h6
-rw-r--r--beecrypt/pkcs1.h2
-rw-r--r--beecrypt/pkcs12.h2
-rw-r--r--beecrypt/rsa.h6
-rw-r--r--beecrypt/rsakp.h16
-rw-r--r--beecrypt/rsapk.h12
-rw-r--r--beecrypt/sha1.c2
-rw-r--r--beecrypt/sha1.h8
-rw-r--r--beecrypt/sha256.c2
-rw-r--r--beecrypt/sha256.h8
46 files changed, 418 insertions, 393 deletions
diff --git a/beecrypt/.splintrc b/beecrypt/.splintrc
index 3b8e7c522..8d33e98b3 100644
--- a/beecrypt/.splintrc
+++ b/beecrypt/.splintrc
@@ -23,6 +23,7 @@
-compdef
-compdestroy
-compmempass
+-evalorder
-evalorderuncon
-globs
-globstate
@@ -30,7 +31,7 @@
-infloopsuncon # 2
-internalglobs
-mayaliasunique
--mods
+-modfilesys
-modobserveruncon
-moduncon
-mustfreefresh
diff --git a/beecrypt/aes.h b/beecrypt/aes.h
index 0db8feb0d..c8c22ceff 100644
--- a/beecrypt/aes.h
+++ b/beecrypt/aes.h
@@ -69,7 +69,7 @@ extern const BEECRYPTAPI blockCipher aes;
*/
BEECRYPTAPI
int aesSetup (aesParam* ap, const byte* key, size_t keybits, cipherOperation op)
- /*@*/;
+ /*@modifies ap @*/;
/*!\fn int aesSetIV(aesParam* ap, const byte* iv)
* \brief This function sets the Initialization Vector.
@@ -80,7 +80,7 @@ int aesSetup (aesParam* ap, const byte* key, size_t keybits, cipherOperation
*/
BEECRYPTAPI
int aesSetIV (aesParam* ap, const byte* iv)
- /*@*/;
+ /*@modifies ap @*/;
/*!\fn aesEncrypt(aesParam* ap, uint32_t* dst, const uint32_t* src)
* \brief This function performs the raw AES encryption; it encrypts one block
@@ -92,7 +92,7 @@ int aesSetIV (aesParam* ap, const byte* iv)
*/
BEECRYPTAPI
int aesEncrypt (aesParam* ap, uint32_t* dst, const uint32_t* src)
- /*@*/;
+ /*@modifies dst @*/;
/*!\fn aesDecrypt(aesParam* ap, uint32_t* dst, const uint32_t* src)
* \brief This function performs the raw AES decryption; it decrypts one block
@@ -104,7 +104,7 @@ int aesEncrypt (aesParam* ap, uint32_t* dst, const uint32_t* src)
*/
BEECRYPTAPI
int aesDecrypt (aesParam* ap, uint32_t* dst, const uint32_t* src)
- /*@*/;
+ /*@modifies dst @*/;
BEECRYPTAPI
uint32_t* aesFeedback(aesParam* ap)
diff --git a/beecrypt/base64.h b/beecrypt/base64.h
index a33841871..e775b9948 100644
--- a/beecrypt/base64.h
+++ b/beecrypt/base64.h
@@ -78,7 +78,7 @@ char* b64crc(const unsigned char* data, size_t ns)
*/
BEECRYPTAPI
int b64decode(const char* s, void** datap, size_t* lenp)
- /*@*/;
+ /*@modifies *datap, *lenp @*/;
/*!
*/
diff --git a/beecrypt/beecrypt.h b/beecrypt/beecrypt.h
index 9b2a6d555..ac644d615 100644
--- a/beecrypt/beecrypt.h
+++ b/beecrypt/beecrypt.h
@@ -126,8 +126,8 @@ const entropySource* entropySourceDefault(void)
* \retval -1 On failure.
*/
BEECRYPTAPI
-int entropyGatherNext(byte*, size_t)
- /*@*/;
+int entropyGatherNext(byte* data, size_t size)
+ /*@modifies data @*/;
#ifdef __cplusplus
}
@@ -228,10 +228,10 @@ BEECRYPTAPI
int randomGeneratorCount(void)
/*@*/;
BEECRYPTAPI
-const randomGenerator* randomGeneratorGet(int)
+const randomGenerator* randomGeneratorGet(int index)
/*@*/;
BEECRYPTAPI
-const randomGenerator* randomGeneratorFind(const char*)
+const randomGenerator* randomGeneratorFind(const char* name)
/*@*/;
BEECRYPTAPI
const randomGenerator* randomGeneratorDefault(void)
@@ -277,17 +277,17 @@ extern "C" {
#endif
BEECRYPTAPI
-int randomGeneratorContextInit(randomGeneratorContext*, const randomGenerator*)
- /*@*/;
+int randomGeneratorContextInit(randomGeneratorContext* ctxt, const randomGenerator* rng)
+ /*@modifies ctxt @*/;
BEECRYPTAPI
-int randomGeneratorContextFree(randomGeneratorContext*)
- /*@*/;
+int randomGeneratorContextFree(randomGeneratorContext* ctxt)
+ /*@modifies ctxt @*/;
BEECRYPTAPI
-int randomGeneratorContextNext(randomGeneratorContext*, byte*, size_t)
- /*@*/;
+int randomGeneratorContextNext(randomGeneratorContext* ctxt, byte* data, size_t size)
+ /*@modifies ctxt @*/;
BEECRYPTAPI
-int randomGeneratorContextSeed(randomGeneratorContext*, const byte*, size_t)
- /*@*/;
+int randomGeneratorContextSeed(randomGeneratorContext* ctxt, const byte* data, size_t size)
+ /*@modifies ctxt @*/;
#ifdef __cplusplus
}
@@ -360,10 +360,10 @@ BEECRYPTAPI
int hashFunctionCount(void)
/*@*/;
BEECRYPTAPI
-const hashFunction* hashFunctionGet(int)
+const hashFunction* hashFunctionGet(int index)
/*@*/;
BEECRYPTAPI
-const hashFunction* hashFunctionFind(const char*)
+const hashFunction* hashFunctionFind(const char* name)
/*@*/;
BEECRYPTAPI
const hashFunction* hashFunctionDefault(void)
@@ -408,32 +408,32 @@ extern "C" {
#endif
BEECRYPTAPI
-int hashFunctionContextInit(hashFunctionContext*, const hashFunction*)
- /*@*/;
+int hashFunctionContextInit(hashFunctionContext* ctxt, const hashFunction* hash)
+ /*@modifies ctxt @*/;
BEECRYPTAPI
-int hashFunctionContextFree(hashFunctionContext*)
- /*@*/;
+int hashFunctionContextFree(hashFunctionContext* ctxt)
+ /*@modifies ctxt @*/;
BEECRYPTAPI
-int hashFunctionContextReset(hashFunctionContext*)
- /*@*/;
+int hashFunctionContextReset(hashFunctionContext* ctxt)
+ /*@modifies ctxt @*/;
BEECRYPTAPI
-int hashFunctionContextUpdate(hashFunctionContext*, const byte*, size_t)
- /*@*/;
+int hashFunctionContextUpdate(hashFunctionContext* ctxt, const byte* data, size_t size)
+ /*@modifies ctxt @*/;
BEECRYPTAPI
-int hashFunctionContextUpdateMC(hashFunctionContext*, const memchunk*)
- /*@*/;
+int hashFunctionContextUpdateMC(hashFunctionContext* ctxt, const memchunk* m)
+ /*@modifies ctxt @*/;
BEECRYPTAPI
-int hashFunctionContextUpdateMP(hashFunctionContext*, const mpnumber*)
- /*@*/;
+int hashFunctionContextUpdateMP(hashFunctionContext* ctxt, const mpnumber* n)
+ /*@modifies ctxt @*/;
BEECRYPTAPI
-int hashFunctionContextDigest(hashFunctionContext*, byte*)
- /*@*/;
+int hashFunctionContextDigest(hashFunctionContext* ctxt, byte* digest)
+ /*@modifies ctxt, digest @*/;
BEECRYPTAPI
-int hashFunctionContextDigestMP(hashFunctionContext*, mpnumber*)
- /*@*/;
+int hashFunctionContextDigestMP(hashFunctionContext* ctxt, mpnumber* d)
+ /*@modifies ctxt, d @*/;
BEECRYPTAPI
-int hashFunctionContextDigestMatch(hashFunctionContext*, const mpnumber*)
- /*@*/;
+int hashFunctionContextDigestMatch(hashFunctionContext* ctxt, const mpnumber*)
+ /*@modifies ctxt @*/;
#ifdef __cplusplus
}
@@ -516,10 +516,10 @@ BEECRYPTAPI
int keyedHashFunctionCount(void)
/*@*/;
BEECRYPTAPI
-const keyedHashFunction* keyedHashFunctionGet(int)
+const keyedHashFunction* keyedHashFunctionGet(int index)
/*@*/;
BEECRYPTAPI
-const keyedHashFunction* keyedHashFunctionFind(const char*)
+const keyedHashFunction* keyedHashFunctionFind(const char* name)
/*@*/;
BEECRYPTAPI
const keyedHashFunction* keyedHashFunctionDefault(void)
@@ -564,35 +564,35 @@ extern "C" {
#endif
BEECRYPTAPI
-int keyedHashFunctionContextInit(keyedHashFunctionContext*, const keyedHashFunction*)
- /*@*/;
+int keyedHashFunctionContextInit(keyedHashFunctionContext* ctxt, const keyedHashFunction* mac)
+ /*@modifies ctxt @*/;
BEECRYPTAPI
-int keyedHashFunctionContextFree(keyedHashFunctionContext*)
- /*@*/;
+int keyedHashFunctionContextFree(keyedHashFunctionContext* ctxt)
+ /*@modifies ctxt @*/;
BEECRYPTAPI
-int keyedHashFunctionContextSetup(keyedHashFunctionContext*, const byte*, size_t)
- /*@*/;
+int keyedHashFunctionContextSetup(keyedHashFunctionContext* ctxt, const byte* key, size_t keybits)
+ /*@modifies ctxt @*/;
BEECRYPTAPI
-int keyedHashFunctionContextReset(keyedHashFunctionContext*)
- /*@*/;
+int keyedHashFunctionContextReset(keyedHashFunctionContext* ctxt)
+ /*@modifies ctxt @*/;
BEECRYPTAPI
-int keyedHashFunctionContextUpdate(keyedHashFunctionContext*, const byte*, size_t)
- /*@*/;
+int keyedHashFunctionContextUpdate(keyedHashFunctionContext* ctxt, const byte* data, size_t size)
+ /*@modifies ctxt @*/;
BEECRYPTAPI
-int keyedHashFunctionContextUpdateMC(keyedHashFunctionContext*, const memchunk*)
- /*@*/;
+int keyedHashFunctionContextUpdateMC(keyedHashFunctionContext* ctxt, const memchunk* m)
+ /*@modifies ctxt @*/;
BEECRYPTAPI
-int keyedHashFunctionContextUpdateMP(keyedHashFunctionContext*, const mpnumber*)
- /*@*/;
+int keyedHashFunctionContextUpdateMP(keyedHashFunctionContext* ctxt, const mpnumber* n)
+ /*@modifies ctxt @*/;
BEECRYPTAPI
-int keyedHashFunctionContextDigest(keyedHashFunctionContext*, byte*)
- /*@*/;
+int keyedHashFunctionContextDigest(keyedHashFunctionContext* ctxt, byte* digest)
+ /*@modifies ctxt @*/;
BEECRYPTAPI
-int keyedHashFunctionContextDigestMP(keyedHashFunctionContext*, mpnumber*)
- /*@*/;
+int keyedHashFunctionContextDigestMP(keyedHashFunctionContext* ctxt, mpnumber* d)
+ /*@modifies ctxt, d @*/;
BEECRYPTAPI
-int keyedHashFunctionContextDigestMatch(keyedHashFunctionContext*, const mpnumber*)
- /*@*/;
+int keyedHashFunctionContextDigestMatch(keyedHashFunctionContext* ctxt, const mpnumber* d)
+ /*@modifies ctxt @*/;
#ifdef __cplusplus
}
@@ -766,7 +766,7 @@ int blockCipherCount(void)
* range.
*/
BEECRYPTAPI
-const blockCipher* blockCipherGet(int)
+const blockCipher* blockCipherGet(int index)
/*@*/;
/*!\fn const blockCIiher* blockCipherFind(const char* name)
@@ -775,7 +775,7 @@ const blockCipher* blockCipherGet(int)
* \return A pointer to a blockcipher or null, if the name wasn't found.
*/
BEECRYPTAPI
-const blockCipher* blockCipherFind(const char*)
+const blockCipher* blockCipherFind(const char* name)
/*@*/;
/*!\fn const blockCipher* blockCipherDefault()
@@ -835,28 +835,28 @@ extern "C" {
#endif
BEECRYPTAPI
-int blockCipherContextInit(blockCipherContext*, const blockCipher*)
- /*@*/;
+int blockCipherContextInit(blockCipherContext* ctxt, const blockCipher* ciph)
+ /*@modifies ctxt @*/;
BEECRYPTAPI
-int blockCipherContextSetup(blockCipherContext*, const byte*, size_t, cipherOperation)
- /*@*/;
+int blockCipherContextSetup(blockCipherContext* ctxt, const byte* key, size_t keybits, cipherOperation op)
+ /*@modifies ctxt @*/;
BEECRYPTAPI
-int blockCipherContextSetIV(blockCipherContext*, const byte*)
- /*@*/;
+int blockCipherContextSetIV(blockCipherContext* ctxt, const byte* iv)
+ /*@modifies ctxt @*/;
BEECRYPTAPI
-int blockCipherContextFree(blockCipherContext*)
- /*@*/;
+int blockCipherContextFree(blockCipherContext* ctxt)
+ /*@modifies ctxt @*/;
BEECRYPTAPI
-int blockCipherContextECB(blockCipherContext*, uint32_t*, const uint32_t*, int)
- /*@*/;
+int blockCipherContextECB(blockCipherContext* ctxt, uint32_t* dst, const uint32_t* src, int nblocks)
+ /*@modifies ctxt, dst @*/;
BEECRYPTAPI
-int blockCipherContextCBC(blockCipherContext*, uint32_t*, const uint32_t*, int)
- /*@*/;
+int blockCipherContextCBC(blockCipherContext* ctxt, uint32_t* dst, const uint32_t* src, int nblocks)
+ /*@modifies ctxt, dst @*/;
#ifdef __cplusplus
}
diff --git a/beecrypt/blockmode.h b/beecrypt/blockmode.h
index bb67c095c..6cda1636f 100644
--- a/beecrypt/blockmode.h
+++ b/beecrypt/blockmode.h
@@ -73,7 +73,7 @@ int blockDecryptECB(const blockCipher* bc, blockCipherParam* bp, uint32_t* dst,
*/
BEECRYPTAPI
int blockEncryptCBC(const blockCipher* bc, blockCipherParam* bp, uint32_t* dst, const uint32_t* src, unsigned int nblocks)
- /*@*/;
+ /*@modifies dst @*/;
/*!\fn int blockDecryptCBC(const blockCipher* bc, blockCipherParam* bp, uint32_t* dst, const uint32_t* src, unsigned int nblocks)
* \brief This function decrypts a number of data blocks in Cipher Block
@@ -87,7 +87,7 @@ int blockEncryptCBC(const blockCipher* bc, blockCipherParam* bp, uint32_t* dst,
*/
BEECRYPTAPI
int blockDecryptCBC(const blockCipher* bc, blockCipherParam* bp, uint32_t* dst, const uint32_t* src, unsigned int nblocks)
- /*@*/;
+ /*@modifies dst @*/;
#ifdef __cplusplus
}
diff --git a/beecrypt/blockpad.h b/beecrypt/blockpad.h
index 98cf0d878..99a749a3b 100644
--- a/beecrypt/blockpad.h
+++ b/beecrypt/blockpad.h
@@ -33,17 +33,17 @@ extern "C" {
#endif
BEECRYPTAPI
-memchunk* pkcs5Pad (size_t, memchunk*)
- /*@*/;
+memchunk* pkcs5Pad (size_t blockbytes, memchunk* tmp)
+ /*@modifies tmp @*/;
BEECRYPTAPI
-memchunk* pkcs5Unpad(size_t, memchunk*)
- /*@*/;
+memchunk* pkcs5Unpad(size_t blockbytes, memchunk* tmp)
+ /*@modifies tmp @*/;
BEECRYPTAPI
-memchunk* pkcs5PadCopy (size_t, const memchunk*)
+memchunk* pkcs5PadCopy (size_t blockbytes, const memchunk* src)
/*@*/;
BEECRYPTAPI
-memchunk* pkcs5UnpadCopy(size_t, const memchunk*)
+memchunk* pkcs5UnpadCopy(size_t blockbytes, const memchunk* src)
/*@*/;
#ifdef __cplusplus
diff --git a/beecrypt/blowfish.c b/beecrypt/blowfish.c
index fe4b78be3..93808ce24 100644
--- a/beecrypt/blowfish.c
+++ b/beecrypt/blowfish.c
@@ -421,6 +421,7 @@ int blowfishSetIV(blowfishParam* bp, const byte* iv)
#endif
int blowfishBlowit(blowfishParam* bp, uint32_t* dst, const uint32_t* src)
+ /*@modifies dst @*/
{
register uint32_t xl = src[0], xr = src[1];
register uint32_t* p = bp->p;
diff --git a/beecrypt/blowfish.h b/beecrypt/blowfish.h
index 592b76828..219f23eca 100644
--- a/beecrypt/blowfish.h
+++ b/beecrypt/blowfish.h
@@ -80,8 +80,8 @@ extern const BEECRYPTAPI blockCipher blowfish;
* \retval -1 on failure.
*/
BEECRYPTAPI
-int blowfishSetup (blowfishParam*, const byte*, size_t, cipherOperation)
- /*@*/;
+int blowfishSetup (blowfishParam* bp, const byte* key, size_t keybits, cipherOperation op)
+ /*@modifies bp @*/;
/*!\fn int blowfishSetIV(blowfishParam* bp, const byte* iv)
* \brief This function sets the Initialization Vector.
@@ -91,8 +91,8 @@ int blowfishSetup (blowfishParam*, const byte*, size_t, cipherOperation)
* \retval 0 on success.
*/
BEECRYPTAPI
-int blowfishSetIV (blowfishParam*, const byte*)
- /*@*/;
+int blowfishSetIV (blowfishParam* bp, const byte* iv)
+ /*@modifies bp @*/;
/*!\fn blowfishEncrypt(blowfishParam* bp, uint32_t* dst, const uint32_t* src)
* \brief This function performs the Blowfish encryption; it encrypts one block
@@ -103,8 +103,8 @@ int blowfishSetIV (blowfishParam*, const byte*)
* \retval 0 on success.
*/
BEECRYPTAPI
-int blowfishEncrypt (blowfishParam*, uint32_t*, const uint32_t*)
- /*@*/;
+int blowfishEncrypt (blowfishParam* bp, uint32_t* dst, const uint32_t* src)
+ /*@modifies bp, dst @*/;
/*!\fn blowfishDecrypt(blowfishParam* bp, uint32_t* dst, const uint32_t* src)
* \brief This function performs the Blowfish decryption; it Rderypts one block
@@ -115,12 +115,12 @@ int blowfishEncrypt (blowfishParam*, uint32_t*, const uint32_t*)
* \retval 0 on success.
*/
BEECRYPTAPI
-int blowfishDecrypt (blowfishParam*, uint32_t*, const uint32_t*)
- /*@*/;
+int blowfishDecrypt (blowfishParam* bp, uint32_t* dst, const uint32_t* src)
+ /*@modifies bp, dst @*/;
BEECRYPTAPI
-uint32_t* blowfishFeedback(blowfishParam*)
- /*@*/;
+uint32_t* blowfishFeedback(blowfishParam* bp)
+ /*@modifies bp @*/;
#ifdef __cplusplus
}
diff --git a/beecrypt/dhaes.c b/beecrypt/dhaes.c
index ce693614d..53dcb8c5c 100644
--- a/beecrypt/dhaes.c
+++ b/beecrypt/dhaes.c
@@ -176,7 +176,7 @@ int dhaes_pContextFree(dhaes_pContext* ctxt)
}
static int dhaes_pContextSetup(dhaes_pContext* ctxt, const mpnumber* private, const mpnumber* public, const mpnumber* message, cipherOperation op)
- /*@*/
+ /*@modifies ctxt @*/
{
register int rc;
diff --git a/beecrypt/dhaes.h b/beecrypt/dhaes.h
index d8be2191f..b8a9e4798 100644
--- a/beecrypt/dhaes.h
+++ b/beecrypt/dhaes.h
@@ -63,28 +63,28 @@ extern "C" {
#endif
BEECRYPTAPI
-int dhaes_pUsable(const dhaes_pParameters*)
+int dhaes_pUsable(const dhaes_pParameters* params)
/*@*/;
BEECRYPTAPI
-int dhaes_pContextInit (dhaes_pContext*, const dhaes_pParameters*)
- /*@*/;
+int dhaes_pContextInit (dhaes_pContext* ctxt, const dhaes_pParameters* params)
+ /*@modifies ctxt @*/;
BEECRYPTAPI
-int dhaes_pContextInitDecrypt(dhaes_pContext*, const dhaes_pParameters*, const mpnumber*)
- /*@*/;
+int dhaes_pContextInitDecrypt(dhaes_pContext* ctxt, const dhaes_pParameters* params, const mpnumber* pri)
+ /*@modifies ctxt @*/;
BEECRYPTAPI
-int dhaes_pContextInitEncrypt(dhaes_pContext*, const dhaes_pParameters*, const mpnumber*)
- /*@*/;
+int dhaes_pContextInitEncrypt(dhaes_pContext* ctxt, const dhaes_pParameters* params, const mpnumber* pub)
+ /*@modifies ctxt @*/;
BEECRYPTAPI
-int dhaes_pContextFree (dhaes_pContext*)
- /*@*/;
+int dhaes_pContextFree (dhaes_pContext* ctxt)
+ /*@modifies ctxt @*/;
BEECRYPTAPI
-memchunk* dhaes_pContextEncrypt(dhaes_pContext*, mpnumber*, mpnumber*, const memchunk*, randomGeneratorContext*)
- /*@*/;
+memchunk* dhaes_pContextEncrypt(dhaes_pContext* ctxt, mpnumber* ephemeralPublicKey, mpnumber* mac, const memchunk* cleartext, randomGeneratorContext* rng)
+ /*@modifies ctxt, ephemeralPublicKey, mac @*/;
BEECRYPTAPI
-memchunk* dhaes_pContextDecrypt(dhaes_pContext*, const mpnumber*, const mpnumber*, const memchunk*)
- /*@*/;
+memchunk* dhaes_pContextDecrypt(dhaes_pContext* ctxt, const mpnumber* ephemeralPublicKey, const mpnumber* mac, const memchunk* ciphertext)
+ /*@modifies ctxt @*/;
#ifdef __cplusplus
}
diff --git a/beecrypt/dldp.c b/beecrypt/dldp.c
index a5b265ebb..e323c6e49 100644
--- a/beecrypt/dldp.c
+++ b/beecrypt/dldp.c
@@ -34,10 +34,10 @@
/*!\addtogroup DL_m
* \{
*/
-static int dldp_pgoqGenerator_w(dldp_p*, randomGeneratorContext*, mpw*)
- /*@*/;
-static int dldp_pgonGenerator_w(dldp_p*, randomGeneratorContext*, mpw*)
- /*@*/;
+static int dldp_pgoqGenerator_w(dldp_p* dp, randomGeneratorContext* rgc, mpw* wksp)
+ /*@modifies dp, wksp @*/;
+static int dldp_pgonGenerator_w(dldp_p* dp, randomGeneratorContext* rgc, mpw* wksp)
+ /*@modifies dp, wksp @*/;
int dldp_pPrivate(const dldp_p* dp, randomGeneratorContext* rgc, mpnumber* x)
{
diff --git a/beecrypt/dldp.h b/beecrypt/dldp.h
index 8ba3d7deb..d576e1234 100644
--- a/beecrypt/dldp.h
+++ b/beecrypt/dldp.h
@@ -104,41 +104,41 @@ extern "C" {
*/
BEECRYPTAPI
-int dldp_pInit(dldp_p*)
- /*@*/;
+int dldp_pInit(dldp_p* dp)
+ /*@modifies dp @*/;
BEECRYPTAPI
-int dldp_pFree(dldp_p*)
- /*@*/;
+int dldp_pFree(dldp_p* dp)
+ /*@modifies dp @*/;
BEECRYPTAPI
-int dldp_pCopy(dldp_p*, const dldp_p*)
- /*@*/;
+int dldp_pCopy(dldp_p* dst, const dldp_p* src)
+ /*@modifies dst @*/;
/*
* Functions for generating keys
*/
BEECRYPTAPI
-int dldp_pPrivate (const dldp_p*, randomGeneratorContext*, mpnumber*)
- /*@*/;
+int dldp_pPrivate (const dldp_p* dp, randomGeneratorContext* rgc, mpnumber* wksp)
+ /*@modifies wksp @*/;
BEECRYPTAPI
-int dldp_pPrivate_s(const dldp_p*, randomGeneratorContext*, mpnumber*, size_t)
- /*@*/;
+int dldp_pPrivate_s(const dldp_p* dp, randomGeneratorContext* rgc, mpnumber* x, size_t xbits)
+ /*@modifies x @*/;
BEECRYPTAPI
-int dldp_pPublic (const dldp_p*, const mpnumber*, mpnumber*)
- /*@*/;
+int dldp_pPublic (const dldp_p* dp, const mpnumber* x, mpnumber* y)
+ /*@modifies y @*/;
BEECRYPTAPI
-int dldp_pPair (const dldp_p*, randomGeneratorContext*, mpnumber*, mpnumber*)
- /*@*/;
+int dldp_pPair (const dldp_p* dp, randomGeneratorContext* rgc, mpnumber* x, mpnumber* y)
+ /*@modifies x, y @*/;
BEECRYPTAPI
-int dldp_pPair_s (const dldp_p*, randomGeneratorContext*, mpnumber*, mpnumber*, size_t)
- /*@*/;
+int dldp_pPair_s (const dldp_p* dp, randomGeneratorContext* rgc, mpnumber* x, mpnumber* y, size_t xbits)
+ /*@modifies x, y @*/;
/*
* Function for comparing domain parameters
*/
BEECRYPTAPI
-int dldp_pEqual (const dldp_p*, const dldp_p*)
+int dldp_pEqual (const dldp_p* a, const dldp_p* b)
/*@*/;
/*
@@ -146,16 +146,16 @@ int dldp_pEqual (const dldp_p*, const dldp_p*)
*/
BEECRYPTAPI
-int dldp_pgoqMake (dldp_p*, randomGeneratorContext*, size_t, size_t, int)
- /*@*/;
+int dldp_pgoqMake (dldp_p* dp, randomGeneratorContext* rgc, size_t pbits, size_t qbits, int cofactor)
+ /*@modifies dp @*/;
BEECRYPTAPI
-int dldp_pgoqMakeSafe (dldp_p*, randomGeneratorContext*, size_t)
- /*@*/;
+int dldp_pgoqMakeSafe (dldp_p* dp, randomGeneratorContext* rgc, size_t bits)
+ /*@modifies dp @*/;
BEECRYPTAPI
-int dldp_pgoqGenerator(dldp_p*, randomGeneratorContext*)
- /*@*/;
+int dldp_pgoqGenerator(dldp_p* dp, randomGeneratorContext* rgc)
+ /*@modifies dp @*/;
BEECRYPTAPI
-int dldp_pgoqValidate (const dldp_p*, randomGeneratorContext*, int)
+int dldp_pgoqValidate (const dldp_p* dp, randomGeneratorContext* rgc, int cofactor)
/*@*/;
/*
@@ -163,16 +163,16 @@ int dldp_pgoqValidate (const dldp_p*, randomGeneratorContext*, int)
*/
BEECRYPTAPI
-int dldp_pgonMake (dldp_p*, randomGeneratorContext*, size_t, size_t)
- /*@*/;
+int dldp_pgonMake (dldp_p* dp, randomGeneratorContext* rgc, size_t pbits, size_t qbits)
+ /*@modifies dp @*/;
BEECRYPTAPI
-int dldp_pgonMakeSafe (dldp_p*, randomGeneratorContext*, size_t)
- /*@*/;
+int dldp_pgonMakeSafe (dldp_p* dp, randomGeneratorContext* rgc, size_t pbits)
+ /*@modifies dp @*/;
BEECRYPTAPI
-int dldp_pgonGenerator(dldp_p*, randomGeneratorContext*)
- /*@*/;
+int dldp_pgonGenerator(dldp_p* dp, randomGeneratorContext* rgc)
+ /*@modifies dp @*/;
BEECRYPTAPI
-int dldp_pgonValidate (const dldp_p*, randomGeneratorContext*)
+int dldp_pgonValidate (const dldp_p* dp, randomGeneratorContext* rgc)
/*@*/;
#ifdef __cplusplus
diff --git a/beecrypt/dlkp.h b/beecrypt/dlkp.h
index a2e316c0a..69c574f47 100644
--- a/beecrypt/dlkp.h
+++ b/beecrypt/dlkp.h
@@ -56,17 +56,17 @@ extern "C" {
#endif
BEECRYPTAPI
-int dlkp_pPair(dlkp_p*, randomGeneratorContext*, const dldp_p*)
- /*@*/;
+int dlkp_pPair(dlkp_p* kp, randomGeneratorContext* rgc, const dldp_p* param)
+ /*@modifies kp @*/;
BEECRYPTAPI
-int dlkp_pInit(dlkp_p*)
- /*@*/;
+int dlkp_pInit(dlkp_p* kp)
+ /*@modifies kp @*/;
BEECRYPTAPI
-int dlkp_pFree(dlkp_p*)
- /*@*/;
+int dlkp_pFree(dlkp_p* kp)
+ /*@modifies kp @*/;
BEECRYPTAPI
-int dlkp_pCopy(dlkp_p*, const dlkp_p*)
- /*@*/;
+int dlkp_pCopy(dlkp_p* dst, const dlkp_p* src)
+ /*@modifies dst @*/;
#ifdef __cplusplus
}
diff --git a/beecrypt/dlpk.h b/beecrypt/dlpk.h
index 21f34de7c..4eb4f631a 100644
--- a/beecrypt/dlpk.h
+++ b/beecrypt/dlpk.h
@@ -54,24 +54,24 @@ extern "C" {
#endif
BEECRYPTAPI
-int dlpk_pInit(dlpk_p*)
- /*@*/;
+int dlpk_pInit(dlpk_p* pk)
+ /*@modifies pk @*/;
BEECRYPTAPI
-int dlpk_pFree(dlpk_p*)
- /*@*/;
+int dlpk_pFree(dlpk_p* pk)
+ /*@modifies pk @*/;
BEECRYPTAPI
-int dlpk_pCopy(dlpk_p*, const dlpk_p*)
- /*@*/;
+int dlpk_pCopy(dlpk_p* dst, const dlpk_p* src)
+ /*@modifies dst @*/;
BEECRYPTAPI
-int dlpk_pEqual(const dlpk_p*, const dlpk_p*)
+int dlpk_pEqual(const dlpk_p* a, const dlpk_p* b)
/*@*/;
BEECRYPTAPI
-int dlpk_pgoqValidate(const dlpk_p*, randomGeneratorContext*, int cofactor)
+int dlpk_pgoqValidate(const dlpk_p* pk, randomGeneratorContext* rgc, int cofactor)
/*@*/;
BEECRYPTAPI
-int dlpk_pgonValidate(const dlpk_p*, randomGeneratorContext*)
+int dlpk_pgonValidate(const dlpk_p* pk, randomGeneratorContext* rgc)
/*@*/;
#ifdef __cplusplus
diff --git a/beecrypt/dlsvdp-dh.h b/beecrypt/dlsvdp-dh.h
index 4b39fdd1e..7b4b8ed04 100644
--- a/beecrypt/dlsvdp-dh.h
+++ b/beecrypt/dlsvdp-dh.h
@@ -37,8 +37,8 @@ typedef dldp_p dhparam;
typedef dlkp_p dhkp;
BEECRYPTAPI
-int dlsvdp_pDHSecret(const dhparam*, const mpnumber*, const mpnumber*, mpnumber*)
- /*@*/;
+int dlsvdp_pDHSecret(const dhparam* dp, const mpnumber* x, const mpnumber* y, mpnumber* s)
+ /*@modifies s @*/;
#ifdef __cplusplus
}
diff --git a/beecrypt/dsa.h b/beecrypt/dsa.h
index b6d23f6a4..138d3593e 100644
--- a/beecrypt/dsa.h
+++ b/beecrypt/dsa.h
@@ -63,7 +63,7 @@ extern "C" {
*/
BEECRYPTAPI
int dsasign(const mpbarrett* p, const mpbarrett* q, const mpnumber* g, randomGeneratorContext*, const mpnumber* hm, const mpnumber* x, mpnumber* r, mpnumber* s)
- /*@*/;
+ /*@modifies r, s @*/;
/*!\fn int dsavrfy(const mpbarrett* p, const mpbarrett* q, const mpnumber* g, const mpnumber* hm, const mpnumber* y, const mpnumber* r, const mpnumber* s)
* \brief This function performs a raw DSA verification.
@@ -103,8 +103,8 @@ int dsavrfy(const mpbarrett* p, const mpbarrett* q, const mpnumber* g, const mpn
* \retval -1 on failure.
*/
BEECRYPTAPI
-int dsaparamMake(dsaparam*, randomGeneratorContext*, size_t)
- /*@*/;
+int dsaparamMake(dsaparam* dp, randomGeneratorContext* rgc, size_t psize)
+ /*@modifies dp @*/;
#ifdef __cplusplus
}
diff --git a/beecrypt/elgamal.h b/beecrypt/elgamal.h
index 29a6de8f9..5f68cceb5 100644
--- a/beecrypt/elgamal.h
+++ b/beecrypt/elgamal.h
@@ -67,7 +67,7 @@ randomGeneratorContext* rgc, const mpnumber* hm, const mpnumber* x, mpnumber* r,
*/
BEECRYPTAPI
int elgv1sign(const mpbarrett* p, const mpbarrett* n, const mpnumber* g, randomGeneratorContext*, const mpnumber* hm, const mpnumber* x, mpnumber* r, mpnumber* s)
- /*@*/;
+ /*@modifies r, s @*/;
/*!\fn int elgv1vrfy(const mpbarrett* p, const mpbarrett* n, const mpnumber* g, const mpnumber* hm, const mpnumber* y, const mpnumber* r, const mpnumber* s)
* \brief This function performs raw ElGamal verification, variant 1.
@@ -91,7 +91,7 @@ int elgv1sign(const mpbarrett* p, const mpbarrett* n, const mpnumber* g, randomG
*/
BEECRYPTAPI
int elgv3sign(const mpbarrett* p, const mpbarrett* n, const mpnumber* g, randomGeneratorContext*, const mpnumber* hm, const mpnumber* x, mpnumber* r, mpnumber* s)
- /*@*/;
+ /*@modifies r, s @*/;
/*!\fn int elgv3sign(const mpbarrett* p, const mpbarrett* n, const mpnumber* g, randomGeneratorContext* rgc, const mpnumber* hm, const mpnumber* x, mpnumber* r, mpnumber* s)
* \brief This function performs raw ElGamal signing, variant 3.
diff --git a/beecrypt/entropy.c b/beecrypt/entropy.c
index 9ac46af2f..56299defe 100644
--- a/beecrypt/entropy.c
+++ b/beecrypt/entropy.c
@@ -101,7 +101,8 @@ int entropy_provider_cleanup()
* return an error in case they are all zeroes or ones.
*/
static int entropy_noise_filter(void* sampledata, int samplecount, int samplesize, int channels, int swap)
- /*@*/
+ /*@globals errno @*/
+ /*@modifies sampledata, errno @*/
{
register int rc = 0, i;
@@ -284,7 +285,8 @@ static int entropy_noise_gather(HWAVEIN wavein, int samplesize, int channels, in
#else
static int entropy_noise_gather(int fd, int samplesize, int channels, int swap, int timeout, byte* data, size_t size)
#endif
- /*@*/
+ /*@globals errno @*/
+ /*@modifies errno @*/
{
size_t randombits = size << 3;
byte temp = 0;
@@ -832,7 +834,7 @@ static int opendevice(const char *device)
/*!\ingroup ES_random_m ES_urandom_m
*/
static int entropy_randombits(int fd, int timeout, byte* data, size_t size)
- /*@*/
+ /*@modifies data @*/
{
register int rc;
@@ -932,7 +934,7 @@ static int entropy_randombits(int fd, int timeout, byte* data, size_t size)
/*!\ingroup ES_tty_m
*/
static int entropy_ttybits(int fd, byte* data, size_t size)
- /*@*/
+ /*@modifies data @*/
{
byte dummy;
@@ -1064,6 +1066,8 @@ static int entropy_ttybits(int fd, byte* data, size_t size)
/*!\ingroup ES_audio_m
*/
int entropy_dev_audio(byte* data, size_t size)
+ /*@globals dev_audio_fd @*/
+ /*@modifies dev_audio_fd @*/
{
const char* timeout_env = getenv("BEECRYPT_ENTROPY_AUDIO_TIMEOUT");
@@ -1156,6 +1160,8 @@ dev_audio_end:
/*!\ingroup ES_dsp_m
*/
int entropy_dev_dsp(byte* data, size_t size)
+ /*@globals dev_dsp_fd @*/
+ /*@modifies dev_dsp_fd @*/
{
const char* timeout_env = getenv("BEECRYPT_ENTROPY_DSP_TIMEOUT");
@@ -1278,6 +1284,8 @@ dev_dsp_end:
/*!\ingroup ES_random_m
*/
int entropy_dev_random(byte* data, size_t size)
+ /*@globals dev_random_fd @*/
+ /*@modifies dev_random_fd @*/
{
const char* timeout_env = getenv("BEECRYPT_ENTROPY_RANDOM_TIMEOUT");
@@ -1322,6 +1330,8 @@ dev_random_end:
/*!\ingroup ES_urandom_m
*/
int entropy_dev_urandom(byte* data, size_t size)
+ /*@globals dev_urandom_fd @*/
+ /*@modifies dev_urandom_fd @*/
{
const char* timeout_env = getenv("BEECRYPT_ENTROPY_URANDOM_TIMEOUT");
@@ -1366,6 +1376,8 @@ dev_urandom_end:
/*!\ingroup ES_tty_m
*/
int entropy_dev_tty(byte* data, size_t size)
+ /*@globals dev_tty_fd @*/
+ /*@modifies dev_tty_fd @*/
{
register int rc;
diff --git a/beecrypt/entropy.h b/beecrypt/entropy.h
index a478c6119..f00160692 100644
--- a/beecrypt/entropy.h
+++ b/beecrypt/entropy.h
@@ -50,24 +50,29 @@ BEECRYPTAPI
int entropy_wincrypt(byte*, size_t);
#else
#if HAVE_DEV_AUDIO
-int entropy_dev_audio (byte*, size_t)
- /*@*/;
+int entropy_dev_audio (byte* data, size_t size)
+ /*@globals internalState @*/
+ /*@modifies data, internalState @*/;
#endif
#if HAVE_DEV_DSP
-int entropy_dev_dsp (byte*, size_t)
- /*@*/;
+int entropy_dev_dsp (byte* data, size_t size)
+ /*@globals internalState @*/
+ /*@modifies data, internalState @*/;
#endif
#if HAVE_DEV_RANDOM
-int entropy_dev_random (byte*, size_t)
- /*@*/;
+int entropy_dev_random (byte* data, size_t size)
+ /*@globals internalState @*/
+ /*@modifies data, internalState @*/;
#endif
#if HAVE_DEV_URANDOM
-int entropy_dev_urandom(byte*, size_t)
- /*@*/;
+int entropy_dev_urandom(byte* data, size_t size)
+ /*@globals internalState @*/
+ /*@modifies data, internalState @*/;
#endif
#if HAVE_DEV_TTY
-int entropy_dev_tty (byte*, size_t)
- /*@*/;
+int entropy_dev_tty (byte* data, size_t size)
+ /*@globals internalState @*/
+ /*@modifies data, internalState @*/;
#endif
#endif
diff --git a/beecrypt/fips186.c b/beecrypt/fips186.c
index f3555a6f4..1a9d9f568 100644
--- a/beecrypt/fips186.c
+++ b/beecrypt/fips186.c
@@ -48,7 +48,7 @@ const randomGenerator fips186prng = {
};
static int fips186init(register sha1Param* p)
- /*@*/
+ /*@modifies p @*/
{
memcpy(p->h, fips186hinit, 5 * sizeof(uint32_t));
return 0;
diff --git a/beecrypt/fips186.h b/beecrypt/fips186.h
index 29a40fb58..815bf2eac 100644
--- a/beecrypt/fips186.h
+++ b/beecrypt/fips186.h
@@ -64,17 +64,17 @@ extern "C" {
extern BEECRYPTAPI const randomGenerator fips186prng;
BEECRYPTAPI
-int fips186Setup (fips186Param*)
- /*@*/;
+int fips186Setup (fips186Param* fp)
+ /*@modifies fp @*/;
BEECRYPTAPI
-int fips186Seed (fips186Param*, const byte*, size_t)
- /*@*/;
+int fips186Seed (fips186Param* fp, const byte* data, size_t size)
+ /*@modifies fp @*/;
BEECRYPTAPI
-int fips186Next (fips186Param*, byte*, size_t)
- /*@*/;
+int fips186Next (fips186Param* fp, byte* data, size_t size)
+ /*@modifies fp, data @*/;
BEECRYPTAPI
-int fips186Cleanup(fips186Param*)
- /*@*/;
+int fips186Cleanup(fips186Param* fp)
+ /*@modifies fp @*/;
#ifdef __cplusplus
}
diff --git a/beecrypt/hmac.h b/beecrypt/hmac.h
index 14bb8cac0..4d7de7c0b 100644
--- a/beecrypt/hmac.h
+++ b/beecrypt/hmac.h
@@ -38,16 +38,16 @@ extern "C" {
/* not used directly as keyed hash function, but instead used as generic methods */
BEECRYPTAPI
-int hmacSetup ( byte*, byte*, const hashFunction*, hashFunctionParam*, const byte*, size_t)
- /*@*/;
+int hmacSetup ( byte* kxi, byte* kxo, const hashFunction* hash, hashFunctionParam* param, const byte* key, size_t keybits)
+ /*@modifies kxi, kxo @*/;
BEECRYPTAPI
-int hmacReset (const byte*, const hashFunction*, hashFunctionParam*)
+int hmacReset (const byte* kxi, const hashFunction* hash, hashFunctionParam* param)
/*@*/;
BEECRYPTAPI
-int hmacUpdate( const hashFunction*, hashFunctionParam*, const byte*, size_t)
+int hmacUpdate( const hashFunction* hash, hashFunctionParam* param, const byte* data, size_t size)
/*@*/;
BEECRYPTAPI
-int hmacDigest( const byte*, const hashFunction*, hashFunctionParam*, byte*)
+int hmacDigest( const byte* kxo, const hashFunction* hash, hashFunctionParam* param, byte* data)
/*@*/;
#ifdef __cplusplus
diff --git a/beecrypt/hmacmd5.h b/beecrypt/hmacmd5.h
index 8df9c04af..e56954f40 100644
--- a/beecrypt/hmacmd5.h
+++ b/beecrypt/hmacmd5.h
@@ -45,16 +45,16 @@ extern "C" {
extern BEECRYPTAPI const keyedHashFunction hmacmd5;
BEECRYPTAPI
-int hmacmd5Setup (hmacmd5Param*, const byte*, size_t)
- /*@*/;
+int hmacmd5Setup (hmacmd5Param* sp, const byte* key, size_t keybits)
+ /*@modifies sp @*/;
BEECRYPTAPI
-int hmacmd5Reset (hmacmd5Param*)
+int hmacmd5Reset (hmacmd5Param* sp)
/*@*/;
BEECRYPTAPI
-int hmacmd5Update(hmacmd5Param*, const byte*, size_t)
+int hmacmd5Update(hmacmd5Param* sp, const byte* data, size_t size)
/*@*/;
BEECRYPTAPI
-int hmacmd5Digest(hmacmd5Param*, byte*)
+int hmacmd5Digest(hmacmd5Param* sp, byte* data)
/*@*/;
#ifdef __cplusplus
diff --git a/beecrypt/hmacsha1.h b/beecrypt/hmacsha1.h
index c9e8c9976..342773eb5 100644
--- a/beecrypt/hmacsha1.h
+++ b/beecrypt/hmacsha1.h
@@ -45,16 +45,16 @@ extern "C" {
extern BEECRYPTAPI const keyedHashFunction hmacsha1;
BEECRYPTAPI
-int hmacsha1Setup (hmacsha1Param*, const byte*, size_t)
- /*@*/;
+int hmacsha1Setup (hmacsha1Param* sp, const byte* key, size_t keybits)
+ /*@modifies sp @*/;
BEECRYPTAPI
-int hmacsha1Reset (hmacsha1Param*)
+int hmacsha1Reset (hmacsha1Param* sp)
/*@*/;
BEECRYPTAPI
-int hmacsha1Update(hmacsha1Param*, const byte*, size_t)
+int hmacsha1Update(hmacsha1Param* sp, const byte* data, size_t size)
/*@*/;
BEECRYPTAPI
-int hmacsha1Digest(hmacsha1Param*, byte*)
+int hmacsha1Digest(hmacsha1Param* sp, byte* data)
/*@*/;
#ifdef __cplusplus
diff --git a/beecrypt/hmacsha256.h b/beecrypt/hmacsha256.h
index e1dda3c78..7cca0627a 100644
--- a/beecrypt/hmacsha256.h
+++ b/beecrypt/hmacsha256.h
@@ -45,16 +45,16 @@ extern "C" {
extern BEECRYPTAPI const keyedHashFunction hmacsha256;
BEECRYPTAPI
-int hmacsha256Setup (hmacsha256Param*, const byte*, size_t)
- /*@*/;
+int hmacsha256Setup (hmacsha256Param* sp, const byte* key, size_t keybits)
+ /*@modifies sp @*/;
BEECRYPTAPI
-int hmacsha256Reset (hmacsha256Param*)
+int hmacsha256Reset (hmacsha256Param* sp)
/*@*/;
BEECRYPTAPI
-int hmacsha256Update(hmacsha256Param*, const byte*, size_t)
+int hmacsha256Update(hmacsha256Param* sp, const byte* data, size_t size)
/*@*/;
BEECRYPTAPI
-int hmacsha256Digest(hmacsha256Param*, byte*)
+int hmacsha256Digest(hmacsha256Param* sp, byte*)
/*@*/;
#ifdef __cplusplus
diff --git a/beecrypt/md5.c b/beecrypt/md5.c
index 0a91fd714..f85b3a58f 100644
--- a/beecrypt/md5.c
+++ b/beecrypt/md5.c
@@ -215,7 +215,7 @@ int md5Update(md5Param* mp, const byte* data, size_t size)
}
static void md5Finish(md5Param* mp)
- /*@*/
+ /*@modifies mp @*/
{
register byte *ptr = ((byte *) mp->data) + mp->offset++;
diff --git a/beecrypt/md5.h b/beecrypt/md5.h
index 459955375..beaac7aae 100644
--- a/beecrypt/md5.h
+++ b/beecrypt/md5.h
@@ -74,7 +74,7 @@ extern BEECRYPTAPI const hashFunction md5;
*/
BEECRYPTAPI
void md5Process(md5Param* mp)
- /*@*/;
+ /*@modifies mp @*/;
/*!\fn int md5Reset(md5Param* mp)
* \brief This function resets the parameter block so that it's ready for a
@@ -84,7 +84,7 @@ void md5Process(md5Param* mp)
*/
BEECRYPTAPI
int md5Reset (md5Param* mp)
- /*@*/;
+ /*@modifies mp @*/;
/*!\fn int md5Update(md5Param* mp, const byte* data, size_t size)
* \brief This function should be used to pass successive blocks of data
@@ -96,7 +96,7 @@ int md5Reset (md5Param* mp)
*/
BEECRYPTAPI
int md5Update (md5Param* mp, const byte* data, size_t size)
- /*@*/;
+ /*@modifies mp @*/;
/*!\fn int md5Digest(md5Param* mp, byte* digest)
* \brief This function finishes the current hash computation and copies
@@ -107,7 +107,7 @@ int md5Update (md5Param* mp, const byte* data, size_t size)
*/
BEECRYPTAPI
int md5Digest (md5Param* mp, byte* digest)
- /*@*/;
+ /*@modifies mp, digest @*/;
#ifdef __cplusplus
}
diff --git a/beecrypt/memchunk.c b/beecrypt/memchunk.c
index 325c1ca56..bce766926 100644
--- a/beecrypt/memchunk.c
+++ b/beecrypt/memchunk.c
@@ -47,6 +47,7 @@ memchunk* memchunkAlloc(size_t size)
}
void memchunkInit(memchunk* m)
+ /*@modifies m @*/
{
m->data = (byte*) 0;
m->size = 0;
diff --git a/beecrypt/memchunk.h b/beecrypt/memchunk.h
index a50daf1c6..ba8da6df1 100644
--- a/beecrypt/memchunk.h
+++ b/beecrypt/memchunk.h
@@ -36,19 +36,19 @@ extern "C" {
#endif
BEECRYPTAPI
-memchunk* memchunkAlloc(size_t)
+memchunk* memchunkAlloc(size_t size)
/*@*/;
BEECRYPTAPI
-void memchunkWipe(memchunk*)
- /*@*/;
+void memchunkWipe(memchunk* m)
+ /*@modifies m @*/;
BEECRYPTAPI
-void memchunkFree(memchunk*)
- /*@*/;
+void memchunkFree(memchunk* m)
+ /*@modifies m @*/;
BEECRYPTAPI
-memchunk* memchunkResize(memchunk*, size_t)
- /*@*/;
+memchunk* memchunkResize(memchunk* m, size_t size)
+ /*@modifies m @*/;
BEECRYPTAPI
-memchunk* memchunkClone(const memchunk*)
+memchunk* memchunkClone(const memchunk* m)
/*@*/;
#ifdef __cplusplus
diff --git a/beecrypt/mp.h b/beecrypt/mp.h
index 41ff667eb..ac01565c0 100644
--- a/beecrypt/mp.h
+++ b/beecrypt/mp.h
@@ -87,7 +87,7 @@ void mpcopy(size_t size, mpw* dest, const mpw* src)
#else
BEECRYPTAPI
void mpmove(size_t size, mpw* dest, const mpw* src)
- /*@*/;
+ /*@modifies dest @*/;
#endif
/*!\fn void mpzero(size_t size, mpw* data)
@@ -97,7 +97,7 @@ void mpmove(size_t size, mpw* dest, const mpw* src)
*/
BEECRYPTAPI
void mpzero(size_t size, mpw* data)
- /*@*/;
+ /*@modifies data @*/;
/*!\fn void mpfill(size_t size, mpw* data, mpw fill)
* \brief This function fills each word of a multi-precision integer with a
@@ -108,7 +108,7 @@ void mpzero(size_t size, mpw* data)
*/
BEECRYPTAPI
void mpfill(size_t size, mpw* data, mpw fill)
- /*@*/;
+ /*@modifies data @*/;
/*!\fn int mpodd(size_t size, const mpw* data)
* \brief This functions tests if a multi-precision integer is odd.
@@ -405,7 +405,7 @@ int mplsbset(size_t size, const mpw* data)
*/
BEECRYPTAPI
void mpsetmsb(size_t size, mpw* data)
- /*@*/;
+ /*@modifies data */;
/*!\fn void mpsetlsb(size_t size, mpw* data)
* \brief This function sets the least significant bit of a multi-precision
@@ -415,7 +415,7 @@ void mpsetmsb(size_t size, mpw* data)
*/
BEECRYPTAPI
void mpsetlsb(size_t size, mpw* data)
- /*@*/;
+ /*@modifies data */;
/*!\fn void mpclrmsb(size_t size, mpw* data)
* \brief This function clears the most significant bit of a multi-precision
@@ -425,7 +425,7 @@ void mpsetlsb(size_t size, mpw* data)
*/
BEECRYPTAPI
void mpclrmsb(size_t size, mpw* data)
- /*@*/;
+ /*@modifies data */;
/*!\fn void mpclrlsb(size_t size, mpw* data)
* \brief This function clears the least significant bit of a multi-precision
@@ -435,7 +435,7 @@ void mpclrmsb(size_t size, mpw* data)
*/
BEECRYPTAPI
void mpclrlsb(size_t size, mpw* data)
- /*@*/;
+ /*@modifies data */;
/*!\fn mpand(size_t size, mpw* xdata, const mpw* ydata)
* \brief This function computes the bit-wise AND of two multi-precision
@@ -446,7 +446,7 @@ void mpclrlsb(size_t size, mpw* data)
*/
BEECRYPTAPI
void mpand(size_t size, mpw* xdata, const mpw* ydata)
- /*@*/;
+ /*@modifies xdata @*/;
/*!\fn void mpor(size_t size, mpw* xdata, const mpw* ydata)
* \brief This function computes the bit-wise OR of two multi-precision
@@ -457,7 +457,7 @@ void mpand(size_t size, mpw* xdata, const mpw* ydata)
*/
BEECRYPTAPI
void mpor(size_t size, mpw* xdata, const mpw* ydata)
- /*@*/;
+ /*@modifies xdata @*/;
/*!\fn void mpxor(size_t size, mpw* xdata, const mpw* ydata)
* \brief This function computes the bit-wise XOR of two multi-precision
@@ -468,7 +468,7 @@ void mpor(size_t size, mpw* xdata, const mpw* ydata)
*/
BEECRYPTAPI
void mpxor(size_t size, mpw* xdata, const mpw* ydata)
- /*@*/;
+ /*@modifies xdata @*/;
/*!\fn mpnot(size_t size, mpw* data)
* \brief This function flips all bits of a multi-precision integer.
@@ -477,7 +477,7 @@ void mpxor(size_t size, mpw* xdata, const mpw* ydata)
*/
BEECRYPTAPI
void mpnot(size_t size, mpw* data)
- /*@*/;
+ /*@modifies data @*/;
/*!\fn void mpsetw(size_t size, mpw* xdata, mpw y)
* \brief This function sets the value of a multi-precision integer to the
@@ -489,7 +489,7 @@ void mpnot(size_t size, mpw* data)
*/
BEECRYPTAPI
void mpsetw(size_t size, mpw* xdata, mpw y)
- /*@*/;
+ /*@modifies xdata @*/;
/*!\fn void mpsetx(size_t xsize, mpw* xdata, size_t ysize, const mpw* ydata)
* \brief This function set the value of the first multi-precision integer
@@ -501,7 +501,7 @@ void mpsetw(size_t size, mpw* xdata, mpw y)
* \param ydata The second multi-precision integer.
*/
void mpsetx(size_t xsize, mpw* xdata, size_t ysize, const mpw* ydata)
- /*@*/;
+ /*@modifies xdata @*/;
/*!\fn int mpaddw(size_t size, mpw* xdata, mpw y)
* \brief This function adds one word to a multi-precision integer.
@@ -513,7 +513,7 @@ void mpsetx(size_t xsize, mpw* xdata, size_t ysize, const mpw* ydata)
*/
BEECRYPTAPI
int mpaddw(size_t size, mpw* xdata, mpw y)
- /*@*/;
+ /*@modifies xdata @*/;
/*!\fn int mpadd(size_t size, mpw* xdata, const mpw* ydata)
* \brief This function adds two multi-precision integers of equal size.
@@ -525,7 +525,7 @@ int mpaddw(size_t size, mpw* xdata, mpw y)
*/
BEECRYPTAPI
int mpadd (size_t size, mpw* xdata, const mpw* ydata)
- /*@*/;
+ /*@modifies xdata @*/;
/*!\fn int mpaddx(size_t xsize, mpw* xdata, size_t ysize, const mpw* ydata)
* \brief This function adds two multi-precision integers of different size.
@@ -538,7 +538,7 @@ int mpadd (size_t size, mpw* xdata, const mpw* ydata)
*/
BEECRYPTAPI
int mpaddx(size_t xsize, mpw* xdata, size_t ysize, const mpw* ydata)
- /*@*/;
+ /*@modifies xdata @*/;
/*!\fn int mpsubw(size_t size, mpw* xdata, mpw y)
* \brief This function subtracts one word to a multi-precision integer.
@@ -550,7 +550,7 @@ int mpaddx(size_t xsize, mpw* xdata, size_t ysize, const mpw* ydata)
*/
BEECRYPTAPI
int mpsubw(size_t size, mpw* xdata, mpw y)
- /*@*/;
+ /*@modifies xdata @*/;
/*!\fn int mpsub(size_t size, mpw* xdata, const mpw* ydata)
* \brief This function subtracts two multi-precision integers of equal size.
@@ -562,7 +562,7 @@ int mpsubw(size_t size, mpw* xdata, mpw y)
*/
BEECRYPTAPI
int mpsub (size_t size, mpw* xdata, const mpw* ydata)
- /*@*/;
+ /*@modifies xdata @*/;
/*!\fn int mpsubx(size_t xsize, mpw* xdata, size_t ysize, const mpw* ydata)
* \brief This function subtracts two multi-precision integers of different
@@ -575,11 +575,11 @@ int mpsub (size_t size, mpw* xdata, const mpw* ydata)
*/
BEECRYPTAPI
int mpsubx(size_t xsize, mpw* xdata, size_t ysize, const mpw* ydata)
- /*@*/;
+ /*@modifies xdata @*/;
BEECRYPTAPI
int mpmultwo(size_t size, mpw* data)
- /*@*/;
+ /*@modifies data @*/;
/*!\fn void mpneg(size_t size, mpw* data)
* \brief This function negates a multi-precision integer.
@@ -588,7 +588,7 @@ int mpmultwo(size_t size, mpw* data)
*/
BEECRYPTAPI
void mpneg(size_t size, mpw* data)
- /*@*/;
+ /*@modifies data @*/;
/*!\fn size_t mpsize(size_t size, const mpw* data)
* \brief This function returns the true size of a multi-precision
@@ -620,27 +620,27 @@ size_t mplszcnt(size_t size, const mpw* data)
BEECRYPTAPI
void mplshift(size_t size, mpw* data, size_t count)
- /*@*/;
+ /*@modifies data @*/;
BEECRYPTAPI
void mprshift(size_t size, mpw* data, size_t count)
- /*@*/;
+ /*@modifies data @*/;
BEECRYPTAPI
size_t mprshiftlsz(size_t size, mpw* data)
- /*@*/;
+ /*@modifies data @*/;
BEECRYPTAPI
size_t mpnorm(size_t size, mpw* data)
- /*@*/;
+ /*@modifies data @*/;
BEECRYPTAPI
void mpdivtwo (size_t size, mpw* data)
- /*@*/;
+ /*@modifies data @*/;
BEECRYPTAPI
void mpsdivtwo(size_t size, mpw* data)
- /*@*/;
+ /*@modifies data @*/;
/*!\fn mpw mpsetmul(size_t size, mpw* result, const mpw* data, mpw y)
* \brief This function performs a multi-precision multiply-setup.
@@ -658,7 +658,7 @@ void mpsdivtwo(size_t size, mpw* data)
*/
BEECRYPTAPI
mpw mpsetmul (size_t size, mpw* result, const mpw* data, mpw y)
- /*@*/;
+ /*@modifies result @*/;
/*!\fn mpw mpaddmul(size_t size, mpw* result, const mpw* data, mpw y)
* \brief This function performs a mult-precision multiply-accumulate.
@@ -675,7 +675,7 @@ mpw mpsetmul (size_t size, mpw* result, const mpw* data, mpw y)
*/
BEECRYPTAPI
mpw mpaddmul (size_t size, mpw* result, const mpw* data, mpw y)
- /*@*/;
+ /*@modifies result @*/;
/*!\fn void mpaddsqrtrc(size_t size, mpw* result, const mpw* data)
* \brief This function is used in the calculation of a multi-precision
@@ -683,41 +683,41 @@ mpw mpaddmul (size_t size, mpw* result, const mpw* data, mpw y)
*/
BEECRYPTAPI
void mpaddsqrtrc(size_t size, mpw* result, const mpw* data)
- /*@*/;
+ /*@modifies result @*/;
/*!\fn void mpmul(mpw* result, size_t xsize, const mpw* xdata, size_t ysize, const mpw* ydata)
* \brief This function computes a full multi-precision product.
*/
BEECRYPTAPI
void mpmul(mpw* result, size_t xsize, const mpw* xdata, size_t ysize, const mpw* ydata)
- /*@*/;
+ /*@modifies result @*/;
/*!\fn void mpsqr(mpw* result, size_t size, const mpw* data)
* \brief This function computes a full multi-precision square.
*/
BEECRYPTAPI
void mpsqr(mpw* result, size_t size, const mpw* data)
- /*@*/;
+ /*@modifies result @*/;
BEECRYPTAPI
void mpgcd_w(size_t size, const mpw* xdata, const mpw* ydata, mpw* result, mpw* wksp)
- /*@*/;
+ /*@modifies result, wksp @*/;
BEECRYPTAPI
int mpextgcd_w(size_t size, const mpw* xdata, const mpw* ydata, mpw* result, mpw* wksp)
- /*@*/;
+ /*@modifies result, wksp @*/;
BEECRYPTAPI
mpw mppndiv(mpw xhi, mpw xlo, mpw y)
/*@*/;
BEECRYPTAPI
-void mpmod (mpw* result, size_t xsize, const mpw* xdata, size_t ysize, const mpw*ydata, mpw* wksp)
- /*@*/;
+void mpmod (mpw* result, size_t xsize, const mpw* xdata, size_t ysize, const mpw*ydata, mpw* workspace)
+ /*@modifies result, workspace @*/;
BEECRYPTAPI
-void mpndivmod(mpw* result, size_t xsize, const mpw* xdata, size_t ysize, const mpw* ydata, mpw* wksp)
- /*@*/;
+void mpndivmod(mpw* result, size_t xsize, const mpw* xdata, size_t ysize, const mpw* ydata, mpw* workspace)
+ /*@modifies result, workspace @*/;
/*
* Output Routines
@@ -733,11 +733,11 @@ void mpprintln(size_t size, const mpw* data)
BEECRYPTAPI
void mpfprint(FILE* f, size_t size, const mpw* data)
- /*@*/;
+ /*@modifies f @*/;
BEECRYPTAPI
void mpfprintln(FILE* f, size_t size, const mpw* data)
- /*@*/;
+ /*@modifies f @*/;
/*
* Conversion Routines
@@ -745,15 +745,15 @@ void mpfprintln(FILE* f, size_t size, const mpw* data)
BEECRYPTAPI
int os2ip(mpw* idata, size_t isize, const byte* osdata, size_t ossize)
- /*@*/;
+ /*@modifies idata @*/;
BEECRYPTAPI
int i2osp(byte* osdata, size_t ossize, const mpw* idata, size_t isize)
- /*@*/;
+ /*@modifies osdata @*/;
BEECRYPTAPI
int hs2ip(mpw* idata, size_t isize, const char* hsdata, size_t hssize)
- /*@*/;
+ /*@modifies idata @*/;
#ifdef __cplusplus
}
diff --git a/beecrypt/mpbarrett.c b/beecrypt/mpbarrett.c
index 24e5d1de3..c025488e1 100644
--- a/beecrypt/mpbarrett.c
+++ b/beecrypt/mpbarrett.c
@@ -388,6 +388,7 @@ void mpbsubone(const mpbarrett* b, mpw* result)
* computes the negative (modulo b) of x, where x must contain a value between 0 and b-1
*/
void mpbneg(const mpbarrett* b, const mpw* data, mpw* result)
+ /*@modifies result @*/
{
register size_t size = b->size;
@@ -507,6 +508,7 @@ void mpbsqrmod_w(const mpbarrett* b, size_t xsize, const mpw* xdata, mpw* result
* needs workspace (4*size+2)
*/
void mpbslide_w(const mpbarrett* b, size_t xsize, const mpw* xdata, mpw* slide, mpw* wksp)
+ /*@modifies slide, wksp @*/
{
register size_t size = b->size;
mpbsqrmod_w(b, xsize, xdata, slide , wksp); /* x^2 mod b, temp */
diff --git a/beecrypt/mpbarrett.h b/beecrypt/mpbarrett.h
index c73106a66..5b7b4bc48 100644
--- a/beecrypt/mpbarrett.h
+++ b/beecrypt/mpbarrett.h
@@ -69,115 +69,115 @@ extern "C" {
#endif
BEECRYPTAPI
-void mpbzero(mpbarrett*)
- /*@*/;
+void mpbzero(mpbarrett* b)
+ /*@modifies b @*/;
BEECRYPTAPI
-void mpbinit(mpbarrett*, size_t)
- /*@*/;
+void mpbinit(mpbarrett* b, size_t size)
+ /*@modifies b @*/;
BEECRYPTAPI
-void mpbfree(mpbarrett*)
- /*@*/;
+void mpbfree(mpbarrett* b)
+ /*@modifies b @*/;
BEECRYPTAPI
-void mpbcopy(mpbarrett*, const mpbarrett*)
- /*@*/;
+void mpbcopy(mpbarrett* b, const mpbarrett* copy)
+ /*@modifies b @*/;
BEECRYPTAPI
-void mpbwipe(mpbarrett*)
- /*@*/;
+void mpbwipe(mpbarrett* b)
+ /*@modifies b @*/;
BEECRYPTAPI
-void mpbset(mpbarrett*, size_t, const mpw*)
- /*@*/;
+void mpbset(mpbarrett* b, size_t size, const mpw* data)
+ /*@modifies b @*/;
BEECRYPTAPI
-int mpbsetbin(mpbarrett*, const byte*, size_t)
- /*@*/;
+int mpbsetbin(mpbarrett* b, const byte* osdata, size_t ossize)
+ /*@modifies b @*/;
BEECRYPTAPI
-int mpbsethex(mpbarrett*, const char*)
- /*@*/;
+int mpbsethex(mpbarrett* b, const char* hex)
+ /*@modifies b @*/;
BEECRYPTAPI
-void mpbsubone(const mpbarrett*, mpw*)
- /*@*/;
+void mpbsubone(const mpbarrett* b, mpw* result)
+ /*@modifies result @*/;
BEECRYPTAPI
-void mpbmu_w(mpbarrett*, mpw*)
- /*@*/;
+void mpbmu_w(mpbarrett* b, mpw* wksp)
+ /*@modifies b, wksp @*/;
BEECRYPTAPI
-void mpbrnd_w (const mpbarrett*, randomGeneratorContext*, mpw*, mpw*)
- /*@*/;
+void mpbrnd_w (const mpbarrett* b, randomGeneratorContext* rc, mpw* result, mpw* wksp)
+ /*@modifies result, wksp @*/;
BEECRYPTAPI
-void mpbrndodd_w(const mpbarrett*, randomGeneratorContext*, mpw*, mpw*)
- /*@*/;
+void mpbrndodd_w(const mpbarrett* b, randomGeneratorContext* rc, mpw* result, mpw* wksp)
+ /*@modifies result, wksp @*/;
BEECRYPTAPI
-void mpbrndinv_w(const mpbarrett*, randomGeneratorContext*, mpw*, mpw*, mpw*)
- /*@*/;
+void mpbrndinv_w(const mpbarrett* b, randomGeneratorContext* rc, mpw* result, mpw* inverse, mpw* wksp)
+ /*@modifies result, inverse, wksp @*/;
BEECRYPTAPI
-void mpbneg_w(const mpbarrett*, const mpw*, mpw*)
- /*@*/;
+void mpbneg_w(const mpbarrett* b, const mpw* data, mpw* result)
+ /*@modifies result @*/;
BEECRYPTAPI
-void mpbmod_w(const mpbarrett*, const mpw*, mpw*, mpw*)
- /*@*/;
+void mpbmod_w(const mpbarrett* b, const mpw* data, mpw* result, mpw* wksp)
+ /*@modifies result, wksp @*/;
BEECRYPTAPI
-void mpbaddmod_w(const mpbarrett*, size_t, const mpw*, size_t, const mpw*, mpw*, mpw*)
- /*@*/;
+void mpbaddmod_w(const mpbarrett* b, size_t xsize, const mpw* xdata, size_t ysize, const mpw* ydata, mpw* result, mpw* wksp)
+ /*@modifies result, wksp @*/;
BEECRYPTAPI
-void mpbsubmod_w(const mpbarrett*, size_t, const mpw*, size_t, const mpw*, mpw*, mpw*)
- /*@*/;
+void mpbsubmod_w(const mpbarrett* b, size_t xsize, const mpw* xdata, size_t ysize, const mpw* ydata, mpw* result, mpw* wksp)
+ /*@modifies result, wksp @*/;
BEECRYPTAPI
-void mpbmulmod_w(const mpbarrett*, size_t, const mpw*, size_t, const mpw*, mpw*, mpw*)
- /*@*/;
+void mpbmulmod_w(const mpbarrett* b, size_t xsize, const mpw* xdata, size_t ysize, const mpw* ydata, mpw* result, mpw* wksp)
+ /*@modifies result, wksp @*/;
BEECRYPTAPI
-void mpbsqrmod_w(const mpbarrett*, size_t, const mpw*, mpw*, mpw*)
- /*@*/;
+void mpbsqrmod_w(const mpbarrett* b, size_t xsize, const mpw* xdata, mpw* result, mpw* wksp)
+ /*@modifies result, wksp @*/;
BEECRYPTAPI
-void mpbpowmod_w(const mpbarrett*, size_t, const mpw*, size_t, const mpw*, mpw*, mpw*)
- /*@*/;
+void mpbpowmod_w(const mpbarrett* b, size_t xsize, const mpw* xdata, size_t psize, const mpw* pdata, mpw* result, mpw* wksp)
+ /*@modifies result, wksp @*/;
BEECRYPTAPI
-void mpbpowmodsld_w(const mpbarrett*, const mpw*, size_t, const mpw*, mpw*, mpw*)
- /*@*/;
+void mpbpowmodsld_w(const mpbarrett* b, const mpw* slide, size_t psize, const mpw* pdata, mpw* result, mpw* wksp)
+ /*@modifies result, wksp @*/;
BEECRYPTAPI
-void mpbtwopowmod_w(const mpbarrett*, size_t, const mpw*, mpw*, mpw*)
- /*@*/;
+void mpbtwopowmod_w(const mpbarrett* b, size_t psize, const mpw* pdata, mpw* result, mpw* wksp)
+ /*@modifies result, wksp @*/;
/* To be added:
* simultaneous multiple exponentiation, for use in dsa and elgamal signature verification
*/
BEECRYPTAPI
-void mpbsm2powmod(const mpbarrett*, const mpw*, const mpw*, const mpw*, const mpw*)
+void mpbsm2powmod(const mpbarrett* b, const mpw*, const mpw*, const mpw*, const mpw*)
/*@*/;
BEECRYPTAPI
-void mpbsm3powmod(const mpbarrett*, const mpw*, const mpw*, const mpw*, const mpw*, const mpw*, const mpw*)
+void mpbsm3powmod(const mpbarrett* b, const mpw*, const mpw*, const mpw*, const mpw*, const mpw*, const mpw*)
/*@*/;
BEECRYPTAPI
-int mpbpprime_w(const mpbarrett*, randomGeneratorContext*, int, mpw*)
- /*@*/;
+int mpbpprime_w(const mpbarrett* b, randomGeneratorContext* r, int t, mpw* wksp)
+ /*@modifies wksp @*/;
/* the next routines take mpnumbers as parameters */
BEECRYPTAPI
-void mpbnrnd(const mpbarrett*, randomGeneratorContext*, mpnumber*)
- /*@*/;
+void mpbnrnd(const mpbarrett* b, randomGeneratorContext* rc, mpnumber* result)
+ /*@modifies result @*/;
BEECRYPTAPI
-void mpbnmulmod(const mpbarrett*, const mpnumber*, const mpnumber*, mpnumber*)
- /*@*/;
+void mpbnmulmod(const mpbarrett* b, const mpnumber* x, const mpnumber* y, mpnumber* result)
+ /*@modifies result @*/;
BEECRYPTAPI
-void mpbnsqrmod(const mpbarrett*, const mpnumber*, mpnumber*)
- /*@*/;
+void mpbnsqrmod(const mpbarrett* b, const mpnumber* x, mpnumber* result)
+ /*@modifies result @*/;
BEECRYPTAPI
-void mpbnpowmod (const mpbarrett*, const mpnumber*, const mpnumber*, mpnumber*)
- /*@*/;
+void mpbnpowmod (const mpbarrett* b, const mpnumber* x, const mpnumber* pow, mpnumber* y)
+ /*@modifies y @*/;
BEECRYPTAPI
-void mpbnpowmodsld(const mpbarrett*, const mpw*, const mpnumber*, mpnumber*)
- /*@*/;
+void mpbnpowmodsld(const mpbarrett* b, const mpw* slide, const mpnumber* pow, mpnumber* y)
+ /*@modifies y @*/;
BEECRYPTAPI
-size_t mpbbits(const mpbarrett*)
+size_t mpbbits(const mpbarrett* b)
/*@*/;
#ifdef __cplusplus
diff --git a/beecrypt/mpnumber.h b/beecrypt/mpnumber.h
index 733d6cc0d..4fc3e3b78 100644
--- a/beecrypt/mpnumber.h
+++ b/beecrypt/mpnumber.h
@@ -73,49 +73,49 @@ extern "C" {
#endif
BEECRYPTAPI
-void mpnzero(mpnumber*)
- /*@*/;
+void mpnzero(mpnumber* n)
+ /*@modifies n @*/;
BEECRYPTAPI
-void mpnsize(mpnumber*, size_t)
- /*@*/;
+void mpnsize(mpnumber* n, size_t size)
+ /*@modifies n @*/;
BEECRYPTAPI
-void mpninit(mpnumber*, size_t, const mpw*)
- /*@*/;
+void mpninit(mpnumber* n, size_t size, const mpw* data)
+ /*@modifies n @*/;
BEECRYPTAPI
-void mpnfree(mpnumber*)
- /*@*/;
+void mpnfree(mpnumber* n)
+ /*@modifies n @*/;
BEECRYPTAPI
-void mpncopy(mpnumber*, const mpnumber*)
- /*@*/;
+void mpncopy(mpnumber* n, const mpnumber* copy)
+ /*@modifies n @*/;
BEECRYPTAPI
-void mpnwipe(mpnumber*)
- /*@*/;
+void mpnwipe(mpnumber* n)
+ /*@modifies n @*/;
BEECRYPTAPI
-void mpnset (mpnumber*, size_t, const mpw*)
- /*@*/;
+void mpnset (mpnumber* n, size_t size, const mpw* data)
+ /*@modifies n @*/;
BEECRYPTAPI
-void mpnsetw (mpnumber*, mpw)
- /*@*/;
+void mpnsetw (mpnumber* n, mpw val)
+ /*@modifies n @*/;
BEECRYPTAPI
-int mpnsetbin(mpnumber*, const byte*, size_t)
- /*@*/;
+int mpnsetbin(mpnumber* n, const byte* osdata, size_t ossize)
+ /*@modifies n @*/;
BEECRYPTAPI
-int mpnsethex(mpnumber*, const char*)
- /*@*/;
+int mpnsethex(mpnumber* n, const char* hex)
+ /*@modifies n @*/;
BEECRYPTAPI
-int mpninv(mpnumber*, const mpnumber*, const mpnumber*)
- /*@*/;
+int mpninv(mpnumber* inv, const mpnumber* k, const mpnumber* mod)
+ /*@modifies inv @*/;
/*!\brief Truncate the mpnumber to the specified number of (least significant) bits.
*/
BEECRYPTAPI
-size_t mpntrbits(mpnumber*, size_t)
- /*@*/;
+size_t mpntrbits(mpnumber* n, size_t bits)
+ /*@modifies n @*/;
BEECRYPTAPI
-size_t mpnbits(const mpnumber*)
+size_t mpnbits(const mpnumber* n)
/*@*/;
#ifdef __cplusplus
diff --git a/beecrypt/mpprime.c b/beecrypt/mpprime.c
index 4cf35e4b8..58e5e8542 100644
--- a/beecrypt/mpprime.c
+++ b/beecrypt/mpprime.c
@@ -710,7 +710,7 @@ int mpptrials(size_t bits)
* needs workspace of (size*2) words
*/
static void mpprndbits(mpbarrett* p, size_t bits, size_t lsbset, const mpnumber* min, const mpnumber* max, randomGeneratorContext* rc, mpw* wksp)
- /*@*/
+ /*@modifies p, wksp @*/
{
register size_t size = p->size;
register size_t msbclr = MP_WORDS_TO_BITS(size) - bits;
@@ -758,6 +758,7 @@ static void mpprndbits(mpbarrett* p, size_t bits, size_t lsbset, const mpnumber*
* needs workspace of (3*size) words
*/
int mppsppdiv_w(const mpbarrett* p, mpw* wksp)
+ /*@modifies wksp @*/
{
/* small prime product trial division test */
register size_t size = p->size;
@@ -779,6 +780,7 @@ int mppsppdiv_w(const mpbarrett* p, mpw* wksp)
* needs workspace of (5*size+2)
*/
int mppmilrabtwo_w(const mpbarrett* p, int s, const mpw* rdata, const mpw* ndata, mpw* wksp)
+ /*@modifies wksp @*/
{
register size_t size = p->size;
register int j = 0;
@@ -804,6 +806,7 @@ int mppmilrabtwo_w(const mpbarrett* p, int s, const mpw* rdata, const mpw* ndata
* needs workspace of (5*size+2) words
*/
int mppmilraba_w(const mpbarrett* p, const mpw* adata, int s, const mpw* rdata, const mpw* ndata, mpw* wksp)
+ /*@modifies wksp @*/
{
register size_t size = p->size;
register int j = 0;
diff --git a/beecrypt/mpprime.h b/beecrypt/mpprime.h
index 10e09829a..3e3590a21 100644
--- a/beecrypt/mpprime.h
+++ b/beecrypt/mpprime.h
@@ -37,27 +37,27 @@ extern "C" {
#endif
BEECRYPTAPI
-int mpptrials (size_t)
+int mpptrials (size_t bits)
/*@*/;
BEECRYPTAPI
-int mppmilrab_w (const mpbarrett*, randomGeneratorContext*, int, mpw*)
- /*@*/;
+int mppmilrab_w (const mpbarrett* p, randomGeneratorContext* rc, int t, mpw* wksp)
+ /*@modifies wksp @*/;
BEECRYPTAPI
-int mpprnd_w (mpbarrett*, randomGeneratorContext*, size_t, int, const mpnumber*, mpw*)
- /*@*/;
+int mpprnd_w (mpbarrett* p, randomGeneratorContext* rc, size_t bits, int t, const mpnumber* f, mpw* wksp)
+ /*@modifies p, wksp @*/;
BEECRYPTAPI
-int mpprndr_w (mpbarrett*, randomGeneratorContext*, size_t, int, const mpnumber*, const mpnumber*, const mpnumber*, mpw*)
- /*@*/;
+int mpprndr_w (mpbarrett* p, randomGeneratorContext* rc, size_t bits, int t, const mpnumber* min, const mpnumber* max, const mpnumber* f, mpw* wksp)
+ /*@modifies p, wksp @*/;
BEECRYPTAPI
-void mpprndsafe_w (mpbarrett*, randomGeneratorContext*, size_t, int, mpw*)
- /*@*/;
+void mpprndsafe_w (mpbarrett* p, randomGeneratorContext* rc, size_t bits, int t, mpw* wksp)
+ /*@modifies p, wksp @*/;
BEECRYPTAPI
void mpprndcon_w (mpbarrett*, randomGeneratorContext*, size_t, int, const mpnumber*, const mpnumber*, const mpnumber*, mpnumber*, mpw*)
/*@*/;
BEECRYPTAPI
-void mpprndconone_w(mpbarrett*, randomGeneratorContext*, size_t, int, const mpbarrett*, const mpnumber*, mpnumber*, int, mpw*)
- /*@*/;
+void mpprndconone_w(mpbarrett* p, randomGeneratorContext* rc, size_t bits, int t, const mpbarrett* q, const mpnumber* f, mpnumber* r, int cofactor, mpw* wksp)
+ /*@modifies p, r, wksp @*/;
#ifdef __cplusplus
}
diff --git a/beecrypt/mtprng.c b/beecrypt/mtprng.c
index ed13a8d62..835214fce 100644
--- a/beecrypt/mtprng.c
+++ b/beecrypt/mtprng.c
@@ -49,7 +49,7 @@
const randomGenerator mtprng = { "Mersenne Twister", sizeof(mtprngParam), (randomGeneratorSetup) mtprngSetup, (randomGeneratorSeed) mtprngSeed, (randomGeneratorNext) mtprngNext, (randomGeneratorCleanup) mtprngCleanup };
static void mtprngReload(mtprngParam* mp)
- /*@*/
+ /*@modifies mp @*/
{
register uint32_t *p0 = mp->state;
register uint32_t *p2 = p0+2, *pM = p0+M, s0, s1;
diff --git a/beecrypt/mtprng.h b/beecrypt/mtprng.h
index 22a7d20ba..bfa6ad126 100644
--- a/beecrypt/mtprng.h
+++ b/beecrypt/mtprng.h
@@ -63,19 +63,19 @@ extern BEECRYPTAPI const randomGenerator mtprng;
*/
BEECRYPTAPI
int mtprngSetup (mtprngParam* mp)
- /*@*/;
+ /*@modifies mp @*/;
/*
*/
BEECRYPTAPI
int mtprngSeed (mtprngParam* mp, const byte* data, size_t size)
- /*@*/;
+ /*@modifies mp @*/;
/*
*/
BEECRYPTAPI
int mtprngNext (mtprngParam* mp, byte* data, size_t size)
- /*@*/;
+ /*@modifies mp, data @*/;
/*
*/
diff --git a/beecrypt/pkcs1.h b/beecrypt/pkcs1.h
index 83d0268c0..a9943ca8d 100644
--- a/beecrypt/pkcs1.h
+++ b/beecrypt/pkcs1.h
@@ -19,7 +19,7 @@ extern "C" {
*/
BEECRYPTAPI
int pkcs1_emsa_encode_digest(hashFunctionContext* ctxt, byte* emdata, size_t emsize)
- /*@*/;
+ /*@modifies ctxt, emdata @*/;
#ifdef __cplusplus
}
diff --git a/beecrypt/pkcs12.h b/beecrypt/pkcs12.h
index 8d3fcca4d..927a7ba2d 100644
--- a/beecrypt/pkcs12.h
+++ b/beecrypt/pkcs12.h
@@ -18,7 +18,7 @@ extern "C" {
BEECRYPTAPI
int pkcs12_derive_key(const hashFunction* h, byte id, const byte* pdata, size_t psize, const byte* sdata, size_t ssize, size_t iterationcount, byte* ndata, size_t nsize)
- /*@*/;
+ /*@modifies ndata @*/;
#ifdef __cplusplus
}
diff --git a/beecrypt/rsa.h b/beecrypt/rsa.h
index 93afa7659..a429ebda2 100644
--- a/beecrypt/rsa.h
+++ b/beecrypt/rsa.h
@@ -50,7 +50,7 @@ extern "C" {
BEECRYPTAPI
int rsapub(const mpbarrett* n, const mpnumber* e,
const mpnumber* m, mpnumber* c)
- /*@*/;
+ /*@modifies c @*/;
/*!\fn int rsapri(const mpbarrett* n, const mpnumber* d, const mpnumber* c, mpnumber* m)
* \brief This function performs a raw RSA private key operation.
@@ -70,7 +70,7 @@ int rsapub(const mpbarrett* n, const mpnumber* e,
BEECRYPTAPI
int rsapri(const mpbarrett* n, const mpnumber* d,
const mpnumber* c, mpnumber* m)
- /*@*/;
+ /*@modifies m @*/;
/*!\fn int rsapricrt(const mpbarrett* n, const mpbarrett* p, const mpbarrett* q, const mpnumber* dp, const mpnumber* dq, const mpnumber* qi, const mpnumber* c, mpnumber* m)
*
@@ -98,7 +98,7 @@ BEECRYPTAPI
int rsapricrt(const mpbarrett* n, const mpbarrett* p, const mpbarrett* q,
const mpnumber* dp, const mpnumber* dq, const mpnumber* qi,
const mpnumber* c, mpnumber* m)
- /*@*/;
+ /*@modifies m @*/;
/*!\fn int rsavrfy(const mpbarrett* n, const mpnumber* e, const mpnumber* m, const mpnumber* c)
* \brief This function performs a raw RSA verification.
diff --git a/beecrypt/rsakp.h b/beecrypt/rsakp.h
index e6b006fa5..684bef6ad 100644
--- a/beecrypt/rsakp.h
+++ b/beecrypt/rsakp.h
@@ -90,17 +90,17 @@ extern "C" {
#endif
BEECRYPTAPI
-int rsakpMake(rsakp*, randomGeneratorContext*, size_t)
- /*@*/;
+int rsakpMake(rsakp* kp, randomGeneratorContext* rgc, size_t bits)
+ /*@modifies kp @*/;
BEECRYPTAPI
-int rsakpInit(rsakp*)
- /*@*/;
+int rsakpInit(rsakp* kp)
+ /*@modifies kp @*/;
BEECRYPTAPI
-int rsakpFree(rsakp*)
- /*@*/;
+int rsakpFree(rsakp* kp)
+ /*@modifies kp @*/;
BEECRYPTAPI
-int rsakpCopy(rsakp*, const rsakp*)
- /*@*/;
+int rsakpCopy(rsakp* dst, const rsakp* src)
+ /*@modifies dst @*/;
#ifdef __cplusplus
}
diff --git a/beecrypt/rsapk.h b/beecrypt/rsapk.h
index 1b154ecc7..a2bdcde51 100644
--- a/beecrypt/rsapk.h
+++ b/beecrypt/rsapk.h
@@ -52,14 +52,14 @@ extern "C" {
#endif
BEECRYPTAPI
-int rsapkInit(rsapk*)
- /*@*/;
+int rsapkInit(rsapk* pk)
+ /*@modifies pk @*/;
BEECRYPTAPI
-int rsapkFree(rsapk*)
- /*@*/;
+int rsapkFree(rsapk* pk)
+ /*@modifies pk @*/;
BEECRYPTAPI
-int rsapkCopy(rsapk*, const rsapk*)
- /*@*/;
+int rsapkCopy(rsapk* dst, const rsapk* src)
+ /*@modifies dst @*/;
#ifdef __cplusplus
}
diff --git a/beecrypt/sha1.c b/beecrypt/sha1.c
index a6d19be25..f682a69b2 100644
--- a/beecrypt/sha1.c
+++ b/beecrypt/sha1.c
@@ -237,7 +237,7 @@ int sha1Update(sha1Param* sp, const byte* data, size_t size)
}
static void sha1Finish(sha1Param* sp)
- /*@*/
+ /*@modifies sp @*/
{
register byte *ptr = ((byte *) sp->data) + sp->offset++;
diff --git a/beecrypt/sha1.h b/beecrypt/sha1.h
index a6ec40d39..a9b585ecb 100644
--- a/beecrypt/sha1.h
+++ b/beecrypt/sha1.h
@@ -74,7 +74,7 @@ extern BEECRYPTAPI const hashFunction sha1;
*/
BEECRYPTAPI
void sha1Process(sha1Param* sp)
- /*@*/;
+ /*@modifies sp @*/;
/*!\fn int sha1Reset(sha1Param* sp)
* \brief This function resets the parameter block so that it's ready for a
@@ -84,7 +84,7 @@ void sha1Process(sha1Param* sp)
*/
BEECRYPTAPI
int sha1Reset (sha1Param* sp)
- /*@*/;
+ /*@modifies sp @*/;
/*!\fn int sha1Update(sha1Param* sp, const byte* data, size_t size)
* \brief This function should be used to pass successive blocks of data
@@ -96,7 +96,7 @@ int sha1Reset (sha1Param* sp)
*/
BEECRYPTAPI
int sha1Update (sha1Param* sp, const byte* data, size_t size)
- /*@*/;
+ /*@modifies sp @*/;
/*!\fn int sha1Digest(sha1Param* sp, byte* digest)
* \brief This function finishes the current hash computation and copies
@@ -107,7 +107,7 @@ int sha1Update (sha1Param* sp, const byte* data, size_t size)
*/
BEECRYPTAPI
int sha1Digest (sha1Param* sp, byte* digest)
- /*@*/;
+ /*@modifies sp, digest @*/;
#ifdef __cplusplus
}
diff --git a/beecrypt/sha256.c b/beecrypt/sha256.c
index d51f8b76a..10889e257 100644
--- a/beecrypt/sha256.c
+++ b/beecrypt/sha256.c
@@ -225,7 +225,7 @@ int sha256Update(register sha256Param* sp, const byte* data, size_t size)
}
static void sha256Finish(register sha256Param* sp)
- /*@*/
+ /*@modifies sp @*/
{
register byte *ptr = ((byte *) sp->data) + sp->offset++;
diff --git a/beecrypt/sha256.h b/beecrypt/sha256.h
index aed9e9cab..57462c01f 100644
--- a/beecrypt/sha256.h
+++ b/beecrypt/sha256.h
@@ -73,7 +73,7 @@ extern BEECRYPTAPI const hashFunction sha256;
*/
BEECRYPTAPI
void sha256Process(sha256Param* sp)
- /*@*/;
+ /*@modifies sp @*/;
/*!\fn int sha256Reset(sha256Param* sp)
* \brief This function resets the parameter block so that it's ready for a
@@ -83,7 +83,7 @@ void sha256Process(sha256Param* sp)
*/
BEECRYPTAPI
int sha256Reset (sha256Param* sp)
- /*@*/;
+ /*@modifies sp @*/;
/*!\fn int sha256Update(sha256Param* sp, const byte* data, size_t size)
* \brief This function should be used to pass successive blocks of data
@@ -95,7 +95,7 @@ int sha256Reset (sha256Param* sp)
*/
BEECRYPTAPI
int sha256Update (sha256Param* sp, const byte* data, size_t size)
- /*@*/;
+ /*@modifies sp @*/;
/*!\fn int sha256Digest(sha256Param* sp, byte* digest)
* \brief This function finishes the current hash computation and copies
@@ -106,7 +106,7 @@ int sha256Update (sha256Param* sp, const byte* data, size_t size)
*/
BEECRYPTAPI
int sha256Digest (sha256Param* sp, byte* digest)
- /*@*/;
+ /*@modifies sp, digest @*/;
#ifdef __cplusplus
}