Splint fiddles.
authorjbj <devnull@localhost>
Mon, 2 Aug 2004 16:56:03 +0000 (16:56 +0000)
committerjbj <devnull@localhost>
Mon, 2 Aug 2004 16:56:03 +0000 (16:56 +0000)
CVS patchset: 7380
CVS date: 2004/08/02 16:56:03

beecrypt/.splintrc
beecrypt/base64.h
beecrypt/beecrypt.h
beecrypt/blockpad.h
beecrypt/dhaes.h
beecrypt/memchunk.h
beecrypt/mpbarrett.h
beecrypt/mpnumber.h
beecrypt/mpprime.c
beecrypt/mpprime.h

index 8d33e98..f1dbea6 100644 (file)
@@ -24,7 +24,6 @@
 -compdestroy
 -compmempass
 -evalorder
--evalorderuncon
 -globs
 -globstate
 -infloops
 -internalglobs
 -mayaliasunique
 -modfilesys
--modobserveruncon
--moduncon
+-moduncon              # 22
 -mustfreefresh
 -mustfreeonly
 -namechecks
 -noeffect
--noeffectuncon
+-noeffectuncon         # 12
 -nullderef
--nullpass
+-nullpass              # 14
 -nullptrarith
--nullret
--nullstate
+-nullret               # 2
+-nullstate             # 1
 -paramuse
--protoparammatch
+-protoparammatch       # 7
 +ptrnegate
 -retalias
 -retvalint
@@ -65,7 +63,7 @@
 -readonlytrans
 -statictrans
 -temptrans
--unqualifiedtrans
+-unqualifiedtrans      # 11
 
 -looploopbreak
 -looploopcontinue
@@ -79,7 +77,6 @@
 -fcnuse
 -typeuse
 
-
 -elseifcomplete
 -whileempty
 
index e775b99..b01a979 100644 (file)
@@ -55,7 +55,7 @@ extern "C" {
  * \param ns no. bytes of data (0 uses strlen(data))
  * \return (malloc'd) base64 string
  */
-BEECRYPTAPI
+BEECRYPTAPI /*@null@*/
 char* b64encode(const void* data, size_t ns)
        /*@*/;
 
@@ -65,7 +65,7 @@ char* b64encode(const void* data, size_t ns)
  * \param ns no. bytes of binary data
  * \return (malloc'd) base64 string
  */
-BEECRYPTAPI
+BEECRYPTAPI /*@null@*/
 char* b64crc(const unsigned char* data, size_t ns)
        /*@*/;
 
@@ -82,13 +82,13 @@ int b64decode(const char* s, void** datap, size_t* lenp)
 
 /*!
  */
-BEECRYPTAPI
+BEECRYPTAPI /*@null@*/
 char*          b64enc(const memchunk*)
        /*@*/;
 
 /*!
  */
-BEECRYPTAPI
+BEECRYPTAPI /*@null@*/
 memchunk*      b64dec(const char*)
        /*@*/;
 
index ac644d6..5fec9ad 100644 (file)
@@ -92,7 +92,7 @@ int                                           entropySourceCount(void)
  * \return A pointer to an entropy source or null, if the index was out of
  *  range.
  */
-BEECRYPTAPI
+BEECRYPTAPI /*@null@*/
 const entropySource*   entropySourceGet(int n)
        /*@*/;
 
@@ -101,7 +101,7 @@ const entropySource*        entropySourceGet(int n)
  * \param name Name of the requested entropy source.
  * \return A pointer to an entropy source or null, if the name wasn't found.
  */
-BEECRYPTAPI
+BEECRYPTAPI /*@null@*/
 const entropySource*   entropySourceFind(const char* name)
        /*@*/;
 
@@ -110,7 +110,7 @@ const entropySource*        entropySourceFind(const char* name)
  *  can be specified by setting environment variable BEECRYPT_ENTROPY.
  * \return A pointer to an entropy source or null, in case an error occured.
  */
-BEECRYPTAPI
+BEECRYPTAPI /*@null@*/
 const entropySource*   entropySourceDefault(void)
        /*@*/;
 
@@ -227,13 +227,13 @@ extern "C" {
 BEECRYPTAPI
 int                                            randomGeneratorCount(void)
        /*@*/;
-BEECRYPTAPI
+BEECRYPTAPI /*@null@*/
 const randomGenerator* randomGeneratorGet(int index)
        /*@*/;
-BEECRYPTAPI
+BEECRYPTAPI /*@null@*/
 const randomGenerator* randomGeneratorFind(const char* name)
        /*@*/;
-BEECRYPTAPI
+BEECRYPTAPI /*@null@*/
 const randomGenerator* randomGeneratorDefault(void)
        /*@*/;
 
@@ -253,6 +253,7 @@ struct _randomGeneratorContext
 #endif
 {
        const randomGenerator* rng;
+/*@relnull@*/
        randomGeneratorParam* param;
 
        #ifdef __cplusplus
@@ -359,13 +360,13 @@ extern "C" {
 BEECRYPTAPI
 int                                    hashFunctionCount(void)
        /*@*/;
-BEECRYPTAPI
+BEECRYPTAPI /*@null@*/
 const hashFunction*    hashFunctionGet(int index)
        /*@*/;
-BEECRYPTAPI
+BEECRYPTAPI /*@null@*/
 const hashFunction*    hashFunctionFind(const char* name)
        /*@*/;
-BEECRYPTAPI
+BEECRYPTAPI /*@null@*/
 const hashFunction*    hashFunctionDefault(void)
        /*@*/;
 
@@ -384,6 +385,7 @@ struct _hashFunctionContext
 #endif
 {
        const hashFunction* algo;
+/*@relnull@*/
        hashFunctionParam* param;
 
        #ifdef __cplusplus
@@ -515,13 +517,13 @@ extern "C" {
 BEECRYPTAPI
 int                                                    keyedHashFunctionCount(void)
        /*@*/;
-BEECRYPTAPI
+BEECRYPTAPI /*@null@*/
 const keyedHashFunction*       keyedHashFunctionGet(int index)
        /*@*/;
-BEECRYPTAPI
+BEECRYPTAPI /*@null@*/
 const keyedHashFunction*       keyedHashFunctionFind(const char* name)
        /*@*/;
-BEECRYPTAPI
+BEECRYPTAPI /*@null@*/
 const keyedHashFunction*       keyedHashFunctionDefault(void)
        /*@*/;
 
@@ -540,6 +542,7 @@ struct _keyedHashFunctionContext
 #endif
 {
        const keyedHashFunction*        algo;
+/*@relnull@*/
        keyedHashFunctionParam*         param;
 
        #ifdef __cplusplus
@@ -765,7 +768,7 @@ int                                         blockCipherCount(void)
  * \return A pointer to a blockcipher or null, if the index was out of
  *  range.
  */
-BEECRYPTAPI
+BEECRYPTAPI /*@null@*/
 const blockCipher*             blockCipherGet(int index)
        /*@*/;
 
@@ -774,7 +777,7 @@ const blockCipher*          blockCipherGet(int index)
  * \param name Name of the requested blockcipher.
  * \return A pointer to a blockcipher or null, if the name wasn't found.
  */
-BEECRYPTAPI
+BEECRYPTAPI /*@null@*/
 const blockCipher*             blockCipherFind(const char* name)
        /*@*/;
 
@@ -783,7 +786,7 @@ const blockCipher*          blockCipherFind(const char* name)
  *  can be specified by setting environment variable BEECRYPT_CIPHER.
  * \return A pointer to a blockcipher or null, in case an error occured.
  */
-BEECRYPTAPI
+BEECRYPTAPI /*@null@*/
 const blockCipher*             blockCipherDefault(void)
        /*@*/;
 
@@ -808,6 +811,7 @@ struct _blockCipherContext
        /*!\var param
         * \brief Pointer to the parameters used by algo.
         */
+/*@relnull@*/
        blockCipherParam*       param;
        /*!\var op
         */
index 99a749a..75b2595 100644 (file)
 extern "C" {
 #endif
 
-BEECRYPTAPI
+BEECRYPTAPI /*@null@*/
 memchunk* pkcs5Pad  (size_t blockbytes, memchunk* tmp)
        /*@modifies tmp @*/;
-BEECRYPTAPI
+BEECRYPTAPI /*@null@*/
 memchunk* pkcs5Unpad(size_t blockbytes, memchunk* tmp)
        /*@modifies tmp @*/;
 
-BEECRYPTAPI
+BEECRYPTAPI /*@null@*/
 memchunk* pkcs5PadCopy  (size_t blockbytes, const memchunk* src)
        /*@*/;
-BEECRYPTAPI
+BEECRYPTAPI /*@null@*/
 memchunk* pkcs5UnpadCopy(size_t blockbytes, const memchunk* src)
        /*@*/;
 
index b8a9e47..e67c718 100644 (file)
@@ -82,7 +82,7 @@ int dhaes_pContextFree       (dhaes_pContext* ctxt)
 BEECRYPTAPI
 memchunk* dhaes_pContextEncrypt(dhaes_pContext* ctxt,       mpnumber* ephemeralPublicKey,       mpnumber* mac, const memchunk* cleartext, randomGeneratorContext* rng)
        /*@modifies ctxt, ephemeralPublicKey, mac @*/;
-BEECRYPTAPI
+BEECRYPTAPI /*@null@*/
 memchunk* dhaes_pContextDecrypt(dhaes_pContext* ctxt, const mpnumber* ephemeralPublicKey, const mpnumber* mac, const memchunk* ciphertext)
        /*@modifies ctxt @*/;
 
index ba8da6d..b3f3462 100644 (file)
@@ -28,6 +28,7 @@
 typedef struct
 {
        size_t  size;
+/*@relnull@*/
        byte*   data;
 } memchunk;
 
@@ -35,7 +36,7 @@ typedef struct
 extern "C" {
 #endif
 
-BEECRYPTAPI
+BEECRYPTAPI /*@null@*/
 memchunk*      memchunkAlloc(size_t size)
        /*@*/;
 BEECRYPTAPI
@@ -44,10 +45,10 @@ void                memchunkWipe(memchunk* m)
 BEECRYPTAPI
 void           memchunkFree(memchunk* m)
        /*@modifies m @*/;
-BEECRYPTAPI
+BEECRYPTAPI /*@null@*/
 memchunk*      memchunkResize(memchunk* m, size_t size)
        /*@modifies m @*/;
-BEECRYPTAPI
+BEECRYPTAPI /*@null@*/
 memchunk*      memchunkClone(const memchunk* m)
        /*@*/;
 
index 5b7b4bc..f3cd2c9 100644 (file)
@@ -40,7 +40,9 @@ struct _mpbarrett
 #endif
 {
        size_t  size;
+/*@relnull@*/
        mpw*    modl;   /* (size) words */
+/*@relnull@*/
        mpw*    mu;             /* (size+1) words */
 
 #ifdef __cplusplus
index 4fc3e3b..8b49f7c 100644 (file)
@@ -39,6 +39,7 @@ struct _mpnumber
 #endif
 {
        size_t  size;
+/*@relnull@*/
        mpw*    data;
 
 #ifdef __cplusplus
index 58e5e85..b75a6ab 100644 (file)
@@ -709,7 +709,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)
+static void mpprndbits(mpbarrett* p, size_t bits, size_t lsbset, /*@null@*/ const mpnumber* min, /*@null@*/ const mpnumber* max, randomGeneratorContext* rc, mpw* wksp)
        /*@modifies p, wksp @*/
 {
        register size_t size = p->size;
index 3e3590a..e0cabc2 100644 (file)
@@ -44,10 +44,10 @@ int  mppmilrab_w   (const mpbarrett* p, randomGeneratorContext* rc, int t, mpw*
        /*@modifies wksp @*/;
 
 BEECRYPTAPI
-int  mpprnd_w      (mpbarrett* p, randomGeneratorContext* rc, size_t bits, int t, const mpnumber* f, mpw* wksp)
+int  mpprnd_w      (mpbarrett* p, randomGeneratorContext* rc, size_t bits, int t, /*@null@*/ const mpnumber* f, mpw* wksp)
        /*@modifies p, wksp @*/;
 BEECRYPTAPI
-int  mpprndr_w     (mpbarrett* p, randomGeneratorContext* rc, size_t bits, int t, const mpnumber* min, const mpnumber* max, const mpnumber* f, mpw* wksp)
+int  mpprndr_w     (mpbarrett* p, randomGeneratorContext* rc, size_t bits, int t, /*@null@*/ const mpnumber* min, /*@null@*/ const mpnumber* max, const mpnumber* f, mpw* wksp)
        /*@modifies p, wksp @*/;
 BEECRYPTAPI
 void mpprndsafe_w  (mpbarrett* p, randomGeneratorContext* rc, size_t bits, int t, mpw* wksp)
@@ -56,7 +56,7 @@ BEECRYPTAPI
 void mpprndcon_w   (mpbarrett*, randomGeneratorContext*, size_t, int, const mpnumber*, const mpnumber*, const mpnumber*, mpnumber*, mpw*)
        /*@*/;
 BEECRYPTAPI
-void mpprndconone_w(mpbarrett* p, randomGeneratorContext* rc, size_t bits, int t, const mpbarrett* q, const mpnumber* f, mpnumber* r, int cofactor, mpw* wksp)
+void mpprndconone_w(mpbarrett* p, randomGeneratorContext* rc, size_t bits, int t, const mpbarrett* q, /*@null@*/ const mpnumber* f, mpnumber* r, int cofactor, mpw* wksp)
        /*@modifies p, r, wksp @*/;
 
 #ifdef __cplusplus