Splint fiddles.
CVS patchset: 7378 CVS date: 2004/08/02 08:42:28
This commit is contained in:
parent
b01550d8fc
commit
21bd2977b7
|
@ -0,0 +1,115 @@
|
|||
-I. -I/usr/lib/gcc-lib/i386-redhat-linux/3.1/include -DHAVE_CONFIG_H -D_GNU_SOURCE -DHAVE_DEV_DSP -DHAVE_SYS_SOUNDCARD
|
||||
|
||||
+partial
|
||||
+forcehints
|
||||
|
||||
-warnposix
|
||||
|
||||
+unixlib
|
||||
|
||||
-unrecogcomments # XXX ignore doxygen markings
|
||||
|
||||
+strict # lclint level
|
||||
|
||||
# --- in progress
|
||||
+likelybounds
|
||||
-bufferoverflowhigh
|
||||
|
||||
-aliasunique
|
||||
-bitwisesigned
|
||||
-boolops
|
||||
-branchstate
|
||||
-castfcnptr
|
||||
-compdef
|
||||
-compdestroy
|
||||
-compmempass
|
||||
-evalorderuncon
|
||||
-globs
|
||||
-globstate
|
||||
-infloops
|
||||
-infloopsuncon # 2
|
||||
-internalglobs
|
||||
-mayaliasunique
|
||||
-mods
|
||||
-modobserveruncon
|
||||
-moduncon
|
||||
-mustfreefresh
|
||||
-mustfreeonly
|
||||
-namechecks
|
||||
-noeffect
|
||||
-noeffectuncon
|
||||
-nullderef
|
||||
-nullpass
|
||||
-nullptrarith
|
||||
-nullret
|
||||
-nullstate
|
||||
-paramuse
|
||||
-protoparammatch
|
||||
+ptrnegate
|
||||
-retalias
|
||||
-retvalint
|
||||
-retvalother
|
||||
-shadow
|
||||
-shiftimplementation
|
||||
-shiftnegative
|
||||
-sizeoftype
|
||||
-type
|
||||
-unreachable
|
||||
-usedef
|
||||
-usereleased
|
||||
|
||||
-dependenttrans
|
||||
-immediatetrans
|
||||
-observertrans
|
||||
-readonlytrans
|
||||
-statictrans
|
||||
-temptrans
|
||||
-unqualifiedtrans
|
||||
|
||||
-looploopbreak
|
||||
-looploopcontinue
|
||||
-loopswitchbreak
|
||||
-switchswitchbreak
|
||||
|
||||
-declundef
|
||||
-exportheader
|
||||
-exportheadervar
|
||||
-exportlocal
|
||||
-fcnuse
|
||||
-typeuse
|
||||
|
||||
|
||||
-elseifcomplete
|
||||
-whileempty
|
||||
|
||||
# --- not-yet at strict level
|
||||
-exportconst # 3
|
||||
-exportfcn # 308
|
||||
-exporttype # 53
|
||||
-exportvar # 14
|
||||
-protoparamname # 826
|
||||
|
||||
-ansi-reserved-internal # goofy
|
||||
|
||||
-ptrarith # 212
|
||||
|
||||
-mustdefine # 64
|
||||
-strictops # 23
|
||||
|
||||
-impcheckedstrictglobs
|
||||
-impcheckedstrictstatics
|
||||
-strictbranchstate
|
||||
|
||||
-forblock # 15
|
||||
-ifblock # 455
|
||||
-whileblock # 25
|
||||
-sys-dir-errors # 1296
|
||||
|
||||
# --- not-yet at checks level
|
||||
-predboolptr # 88
|
||||
-ansi-reserved # goofy
|
||||
|
||||
# --- not-yet at standard level
|
||||
+boolint # 329
|
||||
+charint # 3
|
||||
+matchanyintegral # 573
|
|
@ -34,6 +34,8 @@ LIBBEECRYPT_LT_REVISION = 0
|
|||
|
||||
AUTOMAKE_OPTIONS = gnu check-news no-dependencies
|
||||
|
||||
LINT = splint
|
||||
|
||||
SUBDIRS = . $(MAYBE_SUB) tests docs gas masm
|
||||
|
||||
SUFFIXES = .s
|
||||
|
@ -64,3 +66,28 @@ DISTCLEANFILES = mpopt.s aesopt.s blowfishopt.s sha1opt.s
|
|||
|
||||
bench:
|
||||
(cd tests && $(MAKE) $(AM_MAKEFLAGS) bench)
|
||||
|
||||
beecrypt.lcd: Makefile.am ${libbeecrypt_la_SOURCES} ${pkginclude_HEADERS} ${noinst_HEADERS}
|
||||
$(LINT) $(DEFS) $(INCLUDES) ${libbeecrypt_la_SOURCES} -dump $@
|
||||
|
||||
# XXX don't bite into gcj java dependencies (yet)
|
||||
libbeecrypt_splint_SOURCES = aes.c base64.c beecrypt.c blockmode.c blockpad.c blowfish.c dhaes.c dldp.c dlkp.c dlpk.c dlsvdp-dh.c dsa.c elgamal.c endianness.c entropy.c fips186.c hmac.c hmacmd5.c hmacsha1.c hmacsha256.c md5.c memchunk.c mp.c mpbarrett.c mpnumber.c mpprime.c mtprng.c pkcs1.c pkcs12.c rsa.c rsakp.c rsapk.c sha1.c sha256.c timestamp.c # cppglue.cxx
|
||||
|
||||
.PHONY: sources
|
||||
sources:
|
||||
@echo $(libbeecrypt_splint_SOURCES:%=beecrypt/%) | sed -e 's,beecrypt/javaglue.c,,'
|
||||
|
||||
# XXX don't bite into javaglue.c (yet)
|
||||
.PHONY: lint
|
||||
lint:
|
||||
$(LINT) $(DEFS) $(INCLUDES) $(libbeecrypt_splint_SOURCES:javaglue.c=) # tests/beetest.c
|
||||
|
||||
.PHONY: listobjs
|
||||
listobjs:
|
||||
@echo $(BEECRYPT_OBJECTS) > $@
|
||||
|
||||
DOXYGEN = /usr/bin/doxygen .PHONY: doxygen
|
||||
doxygen apidocs: Doxyfile Doxyheader
|
||||
rm -rf $@
|
||||
mkdir -p $@
|
||||
- [ -x ${DOXYGEN} ] && ${DOXYGEN}
|
||||
|
|
|
@ -68,7 +68,8 @@ extern const BEECRYPTAPI blockCipher aes;
|
|||
* \retval -1 on failure.
|
||||
*/
|
||||
BEECRYPTAPI
|
||||
int aesSetup (aesParam* ap, const byte* key, size_t keybits, cipherOperation op);
|
||||
int aesSetup (aesParam* ap, const byte* key, size_t keybits, cipherOperation op)
|
||||
/*@*/;
|
||||
|
||||
/*!\fn int aesSetIV(aesParam* ap, const byte* iv)
|
||||
* \brief This function sets the Initialization Vector.
|
||||
|
@ -78,7 +79,8 @@ int aesSetup (aesParam* ap, const byte* key, size_t keybits, cipherOperation
|
|||
* \retval 0 on success.
|
||||
*/
|
||||
BEECRYPTAPI
|
||||
int aesSetIV (aesParam* ap, const byte* iv);
|
||||
int aesSetIV (aesParam* ap, const byte* iv)
|
||||
/*@*/;
|
||||
|
||||
/*!\fn aesEncrypt(aesParam* ap, uint32_t* dst, const uint32_t* src)
|
||||
* \brief This function performs the raw AES encryption; it encrypts one block
|
||||
|
@ -89,7 +91,8 @@ int aesSetIV (aesParam* ap, const byte* iv);
|
|||
* \retval 0 on success.
|
||||
*/
|
||||
BEECRYPTAPI
|
||||
int aesEncrypt (aesParam* ap, uint32_t* dst, const uint32_t* src);
|
||||
int aesEncrypt (aesParam* ap, uint32_t* dst, const uint32_t* src)
|
||||
/*@*/;
|
||||
|
||||
/*!\fn aesDecrypt(aesParam* ap, uint32_t* dst, const uint32_t* src)
|
||||
* \brief This function performs the raw AES decryption; it decrypts one block
|
||||
|
@ -100,10 +103,12 @@ int aesEncrypt (aesParam* ap, uint32_t* dst, const uint32_t* src);
|
|||
* \retval 0 on success.
|
||||
*/
|
||||
BEECRYPTAPI
|
||||
int aesDecrypt (aesParam* ap, uint32_t* dst, const uint32_t* src);
|
||||
int aesDecrypt (aesParam* ap, uint32_t* dst, const uint32_t* src)
|
||||
/*@*/;
|
||||
|
||||
BEECRYPTAPI
|
||||
uint32_t* aesFeedback(aesParam* ap);
|
||||
uint32_t* aesFeedback(aesParam* ap)
|
||||
/*@*/;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
@ -56,7 +56,8 @@ extern "C" {
|
|||
* \return (malloc'd) base64 string
|
||||
*/
|
||||
BEECRYPTAPI
|
||||
char* b64encode(const void* data, size_t ns);
|
||||
char* b64encode(const void* data, size_t ns)
|
||||
/*@*/;
|
||||
|
||||
/*!
|
||||
* Encode crc of binary input data into 5 bytes of base64 output.
|
||||
|
@ -65,7 +66,8 @@ char* b64encode(const void* data, size_t ns);
|
|||
* \return (malloc'd) base64 string
|
||||
*/
|
||||
BEECRYPTAPI
|
||||
char* b64crc(const unsigned char* data, size_t ns);
|
||||
char* b64crc(const unsigned char* data, size_t ns)
|
||||
/*@*/;
|
||||
|
||||
/*!
|
||||
* Decode chunks of 4 bytes of base64 input into 3 bytes of binary output.
|
||||
|
@ -75,17 +77,20 @@ char* b64crc(const unsigned char* data, size_t ns);
|
|||
* \return 0 on success, 1: s == NULL, 2: bad length, 3: bad char
|
||||
*/
|
||||
BEECRYPTAPI
|
||||
int b64decode(const char* s, void** datap, size_t* lenp);
|
||||
int b64decode(const char* s, void** datap, size_t* lenp)
|
||||
/*@*/;
|
||||
|
||||
/*!
|
||||
*/
|
||||
BEECRYPTAPI
|
||||
char* b64enc(const memchunk*);
|
||||
char* b64enc(const memchunk*)
|
||||
/*@*/;
|
||||
|
||||
/*!
|
||||
*/
|
||||
BEECRYPTAPI
|
||||
memchunk* b64dec(const char*);
|
||||
memchunk* b64dec(const char*)
|
||||
/*@*/;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
@ -44,7 +44,8 @@
|
|||
* \brief Prototype definition for an entropy-generating function.
|
||||
* \ingroup ES_m
|
||||
*/
|
||||
typedef int (*entropyNext)(byte*, size_t);
|
||||
typedef int (*entropyNext)(byte*, size_t)
|
||||
/*@*/;
|
||||
|
||||
/*!\brief This struct holds information and pointers to code specific to each
|
||||
* source of entropy.
|
||||
|
@ -80,7 +81,8 @@ extern "C" {
|
|||
* \return The number of implemented entropy sources.
|
||||
*/
|
||||
BEECRYPTAPI
|
||||
int entropySourceCount(void);
|
||||
int entropySourceCount(void)
|
||||
/*@*/;
|
||||
|
||||
/*!\fn const entropySource* entropySourceGet(int n)
|
||||
* \brief This function returns the \a n -th entropy source implemented by
|
||||
|
@ -91,7 +93,8 @@ int entropySourceCount(void);
|
|||
* range.
|
||||
*/
|
||||
BEECRYPTAPI
|
||||
const entropySource* entropySourceGet(int n);
|
||||
const entropySource* entropySourceGet(int n)
|
||||
/*@*/;
|
||||
|
||||
/*!\fn const entropySource* entropySourceFind(const char* name)
|
||||
* \brief This function returns the entropy source specified by the given name.
|
||||
|
@ -99,7 +102,8 @@ const entropySource* entropySourceGet(int n);
|
|||
* \return A pointer to an entropy source or null, if the name wasn't found.
|
||||
*/
|
||||
BEECRYPTAPI
|
||||
const entropySource* entropySourceFind(const char* name);
|
||||
const entropySource* entropySourceFind(const char* name)
|
||||
/*@*/;
|
||||
|
||||
/*!\fn const entropySource* entropySourceDefault()
|
||||
* \brief This functions returns the default entropy source; the default value
|
||||
|
@ -107,7 +111,8 @@ const entropySource* entropySourceFind(const char* name);
|
|||
* \return A pointer to an entropy source or null, in case an error occured.
|
||||
*/
|
||||
BEECRYPTAPI
|
||||
const entropySource* entropySourceDefault(void);
|
||||
const entropySource* entropySourceDefault(void)
|
||||
/*@*/;
|
||||
|
||||
/*!\fn int entropyGatherNext(byte* data, size_t size)
|
||||
* \brief This function gathers \a size bytes of entropy into \a data.
|
||||
|
@ -121,7 +126,8 @@ const entropySource* entropySourceDefault(void);
|
|||
* \retval -1 On failure.
|
||||
*/
|
||||
BEECRYPTAPI
|
||||
int entropyGatherNext(byte*, size_t);
|
||||
int entropyGatherNext(byte*, size_t)
|
||||
/*@*/;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
@ -133,10 +139,14 @@ int entropyGatherNext(byte*, size_t);
|
|||
|
||||
typedef void randomGeneratorParam;
|
||||
|
||||
typedef int (*randomGeneratorSetup )(randomGeneratorParam*);
|
||||
typedef int (*randomGeneratorSeed )(randomGeneratorParam*, const byte*, size_t);
|
||||
typedef int (*randomGeneratorNext )(randomGeneratorParam*, byte*, size_t);
|
||||
typedef int (*randomGeneratorCleanup)(randomGeneratorParam*);
|
||||
typedef int (*randomGeneratorSetup )(randomGeneratorParam*)
|
||||
/*@*/;
|
||||
typedef int (*randomGeneratorSeed )(randomGeneratorParam*, const byte*, size_t)
|
||||
/*@*/;
|
||||
typedef int (*randomGeneratorNext )(randomGeneratorParam*, byte*, size_t)
|
||||
/*@*/;
|
||||
typedef int (*randomGeneratorCleanup)(randomGeneratorParam*)
|
||||
/*@*/;
|
||||
|
||||
/*
|
||||
* The struct 'randomGenerator' holds information and pointers to code specific
|
||||
|
@ -215,13 +225,17 @@ extern "C" {
|
|||
#endif
|
||||
|
||||
BEECRYPTAPI
|
||||
int randomGeneratorCount(void);
|
||||
int randomGeneratorCount(void)
|
||||
/*@*/;
|
||||
BEECRYPTAPI
|
||||
const randomGenerator* randomGeneratorGet(int);
|
||||
const randomGenerator* randomGeneratorGet(int)
|
||||
/*@*/;
|
||||
BEECRYPTAPI
|
||||
const randomGenerator* randomGeneratorFind(const char*);
|
||||
const randomGenerator* randomGeneratorFind(const char*)
|
||||
/*@*/;
|
||||
BEECRYPTAPI
|
||||
const randomGenerator* randomGeneratorDefault(void);
|
||||
const randomGenerator* randomGeneratorDefault(void)
|
||||
/*@*/;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
@ -263,13 +277,17 @@ extern "C" {
|
|||
#endif
|
||||
|
||||
BEECRYPTAPI
|
||||
int randomGeneratorContextInit(randomGeneratorContext*, const randomGenerator*);
|
||||
int randomGeneratorContextInit(randomGeneratorContext*, const randomGenerator*)
|
||||
/*@*/;
|
||||
BEECRYPTAPI
|
||||
int randomGeneratorContextFree(randomGeneratorContext*);
|
||||
int randomGeneratorContextFree(randomGeneratorContext*)
|
||||
/*@*/;
|
||||
BEECRYPTAPI
|
||||
int randomGeneratorContextNext(randomGeneratorContext*, byte*, size_t);
|
||||
int randomGeneratorContextNext(randomGeneratorContext*, byte*, size_t)
|
||||
/*@*/;
|
||||
BEECRYPTAPI
|
||||
int randomGeneratorContextSeed(randomGeneratorContext*, const byte*, size_t);
|
||||
int randomGeneratorContextSeed(randomGeneratorContext*, const byte*, size_t)
|
||||
/*@*/;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
@ -284,9 +302,12 @@ int randomGeneratorContextSeed(randomGeneratorContext*, const byte*, size_t);
|
|||
*/
|
||||
typedef void hashFunctionParam;
|
||||
|
||||
typedef int (*hashFunctionReset )(hashFunctionParam*);
|
||||
typedef int (*hashFunctionUpdate)(hashFunctionParam*, const byte*, size_t);
|
||||
typedef int (*hashFunctionDigest)(hashFunctionParam*, byte*);
|
||||
typedef int (*hashFunctionReset )(hashFunctionParam*)
|
||||
/*@*/;
|
||||
typedef int (*hashFunctionUpdate)(hashFunctionParam*, const byte*, size_t)
|
||||
/*@*/;
|
||||
typedef int (*hashFunctionDigest)(hashFunctionParam*, byte*)
|
||||
/*@*/;
|
||||
|
||||
/*
|
||||
* The struct 'hashFunction' holds information and pointers to code specific
|
||||
|
@ -336,13 +357,17 @@ extern "C" {
|
|||
#endif
|
||||
|
||||
BEECRYPTAPI
|
||||
int hashFunctionCount(void);
|
||||
int hashFunctionCount(void)
|
||||
/*@*/;
|
||||
BEECRYPTAPI
|
||||
const hashFunction* hashFunctionGet(int);
|
||||
const hashFunction* hashFunctionGet(int)
|
||||
/*@*/;
|
||||
BEECRYPTAPI
|
||||
const hashFunction* hashFunctionFind(const char*);
|
||||
const hashFunction* hashFunctionFind(const char*)
|
||||
/*@*/;
|
||||
BEECRYPTAPI
|
||||
const hashFunction* hashFunctionDefault(void);
|
||||
const hashFunction* hashFunctionDefault(void)
|
||||
/*@*/;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
@ -383,23 +408,32 @@ extern "C" {
|
|||
#endif
|
||||
|
||||
BEECRYPTAPI
|
||||
int hashFunctionContextInit(hashFunctionContext*, const hashFunction*);
|
||||
int hashFunctionContextInit(hashFunctionContext*, const hashFunction*)
|
||||
/*@*/;
|
||||
BEECRYPTAPI
|
||||
int hashFunctionContextFree(hashFunctionContext*);
|
||||
int hashFunctionContextFree(hashFunctionContext*)
|
||||
/*@*/;
|
||||
BEECRYPTAPI
|
||||
int hashFunctionContextReset(hashFunctionContext*);
|
||||
int hashFunctionContextReset(hashFunctionContext*)
|
||||
/*@*/;
|
||||
BEECRYPTAPI
|
||||
int hashFunctionContextUpdate(hashFunctionContext*, const byte*, size_t);
|
||||
int hashFunctionContextUpdate(hashFunctionContext*, const byte*, size_t)
|
||||
/*@*/;
|
||||
BEECRYPTAPI
|
||||
int hashFunctionContextUpdateMC(hashFunctionContext*, const memchunk*);
|
||||
int hashFunctionContextUpdateMC(hashFunctionContext*, const memchunk*)
|
||||
/*@*/;
|
||||
BEECRYPTAPI
|
||||
int hashFunctionContextUpdateMP(hashFunctionContext*, const mpnumber*);
|
||||
int hashFunctionContextUpdateMP(hashFunctionContext*, const mpnumber*)
|
||||
/*@*/;
|
||||
BEECRYPTAPI
|
||||
int hashFunctionContextDigest(hashFunctionContext*, byte*);
|
||||
int hashFunctionContextDigest(hashFunctionContext*, byte*)
|
||||
/*@*/;
|
||||
BEECRYPTAPI
|
||||
int hashFunctionContextDigestMP(hashFunctionContext*, mpnumber*);
|
||||
int hashFunctionContextDigestMP(hashFunctionContext*, mpnumber*)
|
||||
/*@*/;
|
||||
BEECRYPTAPI
|
||||
int hashFunctionContextDigestMatch(hashFunctionContext*, const mpnumber*);
|
||||
int hashFunctionContextDigestMatch(hashFunctionContext*, const mpnumber*)
|
||||
/*@*/;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
@ -414,10 +448,14 @@ int hashFunctionContextDigestMatch(hashFunctionContext*, const mpnumber*);
|
|||
*/
|
||||
typedef void keyedHashFunctionParam;
|
||||
|
||||
typedef int (*keyedHashFunctionSetup )(keyedHashFunctionParam*, const byte*, size_t);
|
||||
typedef int (*keyedHashFunctionReset )(keyedHashFunctionParam*);
|
||||
typedef int (*keyedHashFunctionUpdate )(keyedHashFunctionParam*, const byte*, size_t);
|
||||
typedef int (*keyedHashFunctionDigest )(keyedHashFunctionParam*, byte*);
|
||||
typedef int (*keyedHashFunctionSetup )(keyedHashFunctionParam*, const byte*, size_t)
|
||||
/*@*/;
|
||||
typedef int (*keyedHashFunctionReset )(keyedHashFunctionParam*)
|
||||
/*@*/;
|
||||
typedef int (*keyedHashFunctionUpdate )(keyedHashFunctionParam*, const byte*, size_t)
|
||||
/*@*/;
|
||||
typedef int (*keyedHashFunctionDigest )(keyedHashFunctionParam*, byte*)
|
||||
/*@*/;
|
||||
|
||||
/*
|
||||
* The struct 'keyedHashFunction' holds information and pointers to code
|
||||
|
@ -475,13 +513,17 @@ extern "C" {
|
|||
#endif
|
||||
|
||||
BEECRYPTAPI
|
||||
int keyedHashFunctionCount(void);
|
||||
int keyedHashFunctionCount(void)
|
||||
/*@*/;
|
||||
BEECRYPTAPI
|
||||
const keyedHashFunction* keyedHashFunctionGet(int);
|
||||
const keyedHashFunction* keyedHashFunctionGet(int)
|
||||
/*@*/;
|
||||
BEECRYPTAPI
|
||||
const keyedHashFunction* keyedHashFunctionFind(const char*);
|
||||
const keyedHashFunction* keyedHashFunctionFind(const char*)
|
||||
/*@*/;
|
||||
BEECRYPTAPI
|
||||
const keyedHashFunction* keyedHashFunctionDefault(void);
|
||||
const keyedHashFunction* keyedHashFunctionDefault(void)
|
||||
/*@*/;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
@ -522,25 +564,35 @@ extern "C" {
|
|||
#endif
|
||||
|
||||
BEECRYPTAPI
|
||||
int keyedHashFunctionContextInit(keyedHashFunctionContext*, const keyedHashFunction*);
|
||||
int keyedHashFunctionContextInit(keyedHashFunctionContext*, const keyedHashFunction*)
|
||||
/*@*/;
|
||||
BEECRYPTAPI
|
||||
int keyedHashFunctionContextFree(keyedHashFunctionContext*);
|
||||
int keyedHashFunctionContextFree(keyedHashFunctionContext*)
|
||||
/*@*/;
|
||||
BEECRYPTAPI
|
||||
int keyedHashFunctionContextSetup(keyedHashFunctionContext*, const byte*, size_t);
|
||||
int keyedHashFunctionContextSetup(keyedHashFunctionContext*, const byte*, size_t)
|
||||
/*@*/;
|
||||
BEECRYPTAPI
|
||||
int keyedHashFunctionContextReset(keyedHashFunctionContext*);
|
||||
int keyedHashFunctionContextReset(keyedHashFunctionContext*)
|
||||
/*@*/;
|
||||
BEECRYPTAPI
|
||||
int keyedHashFunctionContextUpdate(keyedHashFunctionContext*, const byte*, size_t);
|
||||
int keyedHashFunctionContextUpdate(keyedHashFunctionContext*, const byte*, size_t)
|
||||
/*@*/;
|
||||
BEECRYPTAPI
|
||||
int keyedHashFunctionContextUpdateMC(keyedHashFunctionContext*, const memchunk*);
|
||||
int keyedHashFunctionContextUpdateMC(keyedHashFunctionContext*, const memchunk*)
|
||||
/*@*/;
|
||||
BEECRYPTAPI
|
||||
int keyedHashFunctionContextUpdateMP(keyedHashFunctionContext*, const mpnumber*);
|
||||
int keyedHashFunctionContextUpdateMP(keyedHashFunctionContext*, const mpnumber*)
|
||||
/*@*/;
|
||||
BEECRYPTAPI
|
||||
int keyedHashFunctionContextDigest(keyedHashFunctionContext*, byte*);
|
||||
int keyedHashFunctionContextDigest(keyedHashFunctionContext*, byte*)
|
||||
/*@*/;
|
||||
BEECRYPTAPI
|
||||
int keyedHashFunctionContextDigestMP(keyedHashFunctionContext*, mpnumber*);
|
||||
int keyedHashFunctionContextDigestMP(keyedHashFunctionContext*, mpnumber*)
|
||||
/*@*/;
|
||||
BEECRYPTAPI
|
||||
int keyedHashFunctionContextDigestMatch(keyedHashFunctionContext*, const mpnumber*);
|
||||
int keyedHashFunctionContextDigestMatch(keyedHashFunctionContext*, const mpnumber*)
|
||||
/*@*/;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
@ -571,7 +623,8 @@ typedef void blockCipherParam;
|
|||
/*!\brief Prototype definition for a setup function.
|
||||
* \ingroup BC_m
|
||||
*/
|
||||
typedef int (*blockCipherSetup )(blockCipherParam*, const byte*, size_t, cipherOperation);
|
||||
typedef int (*blockCipherSetup )(blockCipherParam*, const byte*, size_t, cipherOperation)
|
||||
/*@*/;
|
||||
|
||||
/*!\typedef int (*blockCipherSetIV)(blockCipherPatam* bp, const byte* iv)
|
||||
* \brief Prototype definition for an initialization vector setup function.
|
||||
|
@ -582,7 +635,8 @@ typedef int (*blockCipherSetup )(blockCipherParam*, const byte*, size_t, cipher
|
|||
* \retval -1 on failure.
|
||||
* \ingroup BC_m
|
||||
*/
|
||||
typedef int (*blockCipherSetIV )(blockCipherParam*, const byte*);
|
||||
typedef int (*blockCipherSetIV )(blockCipherParam*, const byte*)
|
||||
/*@*/;
|
||||
|
||||
/*!\typedef int (*blockCipherRawcrypt)(blockCipherParam* bp, uint32_t* dst, const uint32_t* src)
|
||||
* \brief Prototype for a \e raw encryption or decryption function.
|
||||
|
@ -593,7 +647,8 @@ typedef int (*blockCipherSetIV )(blockCipherParam*, const byte*);
|
|||
* \retval -1 on failure.
|
||||
* \ingroup BC_m
|
||||
*/
|
||||
typedef int (*blockCipherRawcrypt)(blockCipherParam*, uint32_t*, const uint32_t*);
|
||||
typedef int (*blockCipherRawcrypt)(blockCipherParam*, uint32_t*, const uint32_t*)
|
||||
/*@*/;
|
||||
|
||||
/*!\typedef int (*blockCipherModcrypt)(blockCipherParam* bp, uint32_t* dst, const uint32_t* src, unsigned int nblocks)
|
||||
* \brief Prototype for a \e encryption or decryption function which operates
|
||||
|
@ -606,9 +661,11 @@ typedef int (*blockCipherRawcrypt)(blockCipherParam*, uint32_t*, const uint32_t*
|
|||
* \retval -1 on failure.
|
||||
* \ingroup BC_m
|
||||
*/
|
||||
typedef int (*blockCipherModcrypt)(blockCipherParam*, uint32_t*, const uint32_t*, unsigned int);
|
||||
typedef int (*blockCipherModcrypt)(blockCipherParam*, uint32_t*, const uint32_t*, unsigned int)
|
||||
/*@*/;
|
||||
|
||||
typedef uint32_t* (*blockCipherFeedback)(blockCipherParam*);
|
||||
typedef uint32_t* (*blockCipherFeedback)(blockCipherParam*)
|
||||
/*@*/;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
|
@ -697,7 +754,8 @@ extern "C" {
|
|||
* \return The number of implemented blockciphers.
|
||||
*/
|
||||
BEECRYPTAPI
|
||||
int blockCipherCount(void);
|
||||
int blockCipherCount(void)
|
||||
/*@*/;
|
||||
|
||||
/*!\fn const blockCipher* blockCipherGet(int n)
|
||||
* \brief This function returns the \a n -th blockcipher implemented by
|
||||
|
@ -708,7 +766,8 @@ int blockCipherCount(void);
|
|||
* range.
|
||||
*/
|
||||
BEECRYPTAPI
|
||||
const blockCipher* blockCipherGet(int);
|
||||
const blockCipher* blockCipherGet(int)
|
||||
/*@*/;
|
||||
|
||||
/*!\fn const blockCIiher* blockCipherFind(const char* name)
|
||||
* \brief This function returns the blockcipher specified by the given name.
|
||||
|
@ -716,7 +775,8 @@ 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*)
|
||||
/*@*/;
|
||||
|
||||
/*!\fn const blockCipher* blockCipherDefault()
|
||||
* \brief This functions returns the default blockcipher; the default value
|
||||
|
@ -724,7 +784,8 @@ const blockCipher* blockCipherFind(const char*);
|
|||
* \return A pointer to a blockcipher or null, in case an error occured.
|
||||
*/
|
||||
BEECRYPTAPI
|
||||
const blockCipher* blockCipherDefault(void);
|
||||
const blockCipher* blockCipherDefault(void)
|
||||
/*@*/;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
@ -774,22 +835,28 @@ extern "C" {
|
|||
#endif
|
||||
|
||||
BEECRYPTAPI
|
||||
int blockCipherContextInit(blockCipherContext*, const blockCipher*);
|
||||
int blockCipherContextInit(blockCipherContext*, const blockCipher*)
|
||||
/*@*/;
|
||||
|
||||
BEECRYPTAPI
|
||||
int blockCipherContextSetup(blockCipherContext*, const byte*, size_t, cipherOperation);
|
||||
int blockCipherContextSetup(blockCipherContext*, const byte*, size_t, cipherOperation)
|
||||
/*@*/;
|
||||
|
||||
BEECRYPTAPI
|
||||
int blockCipherContextSetIV(blockCipherContext*, const byte*);
|
||||
int blockCipherContextSetIV(blockCipherContext*, const byte*)
|
||||
/*@*/;
|
||||
|
||||
BEECRYPTAPI
|
||||
int blockCipherContextFree(blockCipherContext*);
|
||||
int blockCipherContextFree(blockCipherContext*)
|
||||
/*@*/;
|
||||
|
||||
BEECRYPTAPI
|
||||
int blockCipherContextECB(blockCipherContext*, uint32_t*, const uint32_t*, int);
|
||||
int blockCipherContextECB(blockCipherContext*, uint32_t*, const uint32_t*, int)
|
||||
/*@*/;
|
||||
|
||||
BEECRYPTAPI
|
||||
int blockCipherContextCBC(blockCipherContext*, uint32_t*, const uint32_t*, int);
|
||||
int blockCipherContextCBC(blockCipherContext*, uint32_t*, const uint32_t*, int)
|
||||
/*@*/;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
@ -44,7 +44,8 @@ extern "C" {
|
|||
* \retval 0 on success.
|
||||
*/
|
||||
BEECRYPTAPI
|
||||
int blockEncryptECB(const blockCipher* bc, blockCipherParam* bp, uint32_t* dst, const uint32_t* src, unsigned int nblocks);
|
||||
int blockEncryptECB(const blockCipher* bc, blockCipherParam* bp, uint32_t* dst, const uint32_t* src, unsigned int nblocks)
|
||||
/*@*/;
|
||||
|
||||
/*!\fn int blockDecryptECB(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 Electronic Code
|
||||
|
@ -57,7 +58,8 @@ int blockEncryptECB(const blockCipher* bc, blockCipherParam* bp, uint32_t* dst,
|
|||
* \retval 0 on success.
|
||||
*/
|
||||
BEECRYPTAPI
|
||||
int blockDecryptECB(const blockCipher* bc, blockCipherParam* bp, uint32_t* dst, const uint32_t* src, unsigned int nblocks);
|
||||
int blockDecryptECB(const blockCipher* bc, blockCipherParam* bp, uint32_t* dst, const uint32_t* src, unsigned int nblocks)
|
||||
/*@*/;
|
||||
|
||||
/*!\fn int blockEncryptCBC(const blockCipher* bc, blockCipherParam* bp, uint32_t* dst, const uint32_t* src, unsigned int nblocks)
|
||||
* \brief This function encrypts a number of data blocks in Cipher Block
|
||||
|
@ -70,7 +72,8 @@ int blockDecryptECB(const blockCipher* bc, blockCipherParam* bp, uint32_t* dst,
|
|||
* \retval 0 on success.
|
||||
*/
|
||||
BEECRYPTAPI
|
||||
int blockEncryptCBC(const blockCipher* bc, blockCipherParam* bp, uint32_t* dst, const uint32_t* src, unsigned int nblocks);
|
||||
int blockEncryptCBC(const blockCipher* bc, blockCipherParam* bp, uint32_t* dst, const uint32_t* src, unsigned int nblocks)
|
||||
/*@*/;
|
||||
|
||||
/*!\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
|
||||
|
@ -83,7 +86,8 @@ int blockEncryptCBC(const blockCipher* bc, blockCipherParam* bp, uint32_t* dst,
|
|||
* \retval 0 on success.
|
||||
*/
|
||||
BEECRYPTAPI
|
||||
int blockDecryptCBC(const blockCipher* bc, blockCipherParam* bp, uint32_t* dst, const uint32_t* src, unsigned int nblocks);
|
||||
int blockDecryptCBC(const blockCipher* bc, blockCipherParam* bp, uint32_t* dst, const uint32_t* src, unsigned int nblocks)
|
||||
/*@*/;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
@ -33,14 +33,18 @@ extern "C" {
|
|||
#endif
|
||||
|
||||
BEECRYPTAPI
|
||||
memchunk* pkcs5Pad (size_t, memchunk*);
|
||||
memchunk* pkcs5Pad (size_t, memchunk*)
|
||||
/*@*/;
|
||||
BEECRYPTAPI
|
||||
memchunk* pkcs5Unpad(size_t, memchunk*);
|
||||
memchunk* pkcs5Unpad(size_t, memchunk*)
|
||||
/*@*/;
|
||||
|
||||
BEECRYPTAPI
|
||||
memchunk* pkcs5PadCopy (size_t, const memchunk*);
|
||||
memchunk* pkcs5PadCopy (size_t, const memchunk*)
|
||||
/*@*/;
|
||||
BEECRYPTAPI
|
||||
memchunk* pkcs5UnpadCopy(size_t, const memchunk*);
|
||||
memchunk* pkcs5UnpadCopy(size_t, const memchunk*)
|
||||
/*@*/;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
@ -80,7 +80,8 @@ extern const BEECRYPTAPI blockCipher blowfish;
|
|||
* \retval -1 on failure.
|
||||
*/
|
||||
BEECRYPTAPI
|
||||
int blowfishSetup (blowfishParam*, const byte*, size_t, cipherOperation);
|
||||
int blowfishSetup (blowfishParam*, const byte*, size_t, cipherOperation)
|
||||
/*@*/;
|
||||
|
||||
/*!\fn int blowfishSetIV(blowfishParam* bp, const byte* iv)
|
||||
* \brief This function sets the Initialization Vector.
|
||||
|
@ -90,7 +91,8 @@ int blowfishSetup (blowfishParam*, const byte*, size_t, cipherOperation);
|
|||
* \retval 0 on success.
|
||||
*/
|
||||
BEECRYPTAPI
|
||||
int blowfishSetIV (blowfishParam*, const byte*);
|
||||
int blowfishSetIV (blowfishParam*, const byte*)
|
||||
/*@*/;
|
||||
|
||||
/*!\fn blowfishEncrypt(blowfishParam* bp, uint32_t* dst, const uint32_t* src)
|
||||
* \brief This function performs the Blowfish encryption; it encrypts one block
|
||||
|
@ -101,7 +103,8 @@ int blowfishSetIV (blowfishParam*, const byte*);
|
|||
* \retval 0 on success.
|
||||
*/
|
||||
BEECRYPTAPI
|
||||
int blowfishEncrypt (blowfishParam*, uint32_t*, const uint32_t*);
|
||||
int blowfishEncrypt (blowfishParam*, uint32_t*, const uint32_t*)
|
||||
/*@*/;
|
||||
|
||||
/*!\fn blowfishDecrypt(blowfishParam* bp, uint32_t* dst, const uint32_t* src)
|
||||
* \brief This function performs the Blowfish decryption; it Rderypts one block
|
||||
|
@ -112,10 +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*, uint32_t*, const uint32_t*)
|
||||
/*@*/;
|
||||
|
||||
BEECRYPTAPI
|
||||
uint32_t* blowfishFeedback(blowfishParam*);
|
||||
uint32_t* blowfishFeedback(blowfishParam*)
|
||||
/*@*/;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
@ -176,6 +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)
|
||||
/*@*/
|
||||
{
|
||||
register int rc;
|
||||
|
||||
|
|
|
@ -63,21 +63,28 @@ extern "C" {
|
|||
#endif
|
||||
|
||||
BEECRYPTAPI
|
||||
int dhaes_pUsable(const dhaes_pParameters*);
|
||||
int dhaes_pUsable(const dhaes_pParameters*)
|
||||
/*@*/;
|
||||
|
||||
BEECRYPTAPI
|
||||
int dhaes_pContextInit (dhaes_pContext*, const dhaes_pParameters*);
|
||||
int dhaes_pContextInit (dhaes_pContext*, const dhaes_pParameters*)
|
||||
/*@*/;
|
||||
BEECRYPTAPI
|
||||
int dhaes_pContextInitDecrypt(dhaes_pContext*, const dhaes_pParameters*, const mpnumber*);
|
||||
int dhaes_pContextInitDecrypt(dhaes_pContext*, const dhaes_pParameters*, const mpnumber*)
|
||||
/*@*/;
|
||||
BEECRYPTAPI
|
||||
int dhaes_pContextInitEncrypt(dhaes_pContext*, const dhaes_pParameters*, const mpnumber*);
|
||||
int dhaes_pContextInitEncrypt(dhaes_pContext*, const dhaes_pParameters*, const mpnumber*)
|
||||
/*@*/;
|
||||
BEECRYPTAPI
|
||||
int dhaes_pContextFree (dhaes_pContext*);
|
||||
int dhaes_pContextFree (dhaes_pContext*)
|
||||
/*@*/;
|
||||
|
||||
BEECRYPTAPI
|
||||
memchunk* dhaes_pContextEncrypt(dhaes_pContext*, mpnumber*, mpnumber*, const memchunk*, randomGeneratorContext*);
|
||||
memchunk* dhaes_pContextEncrypt(dhaes_pContext*, mpnumber*, mpnumber*, const memchunk*, randomGeneratorContext*)
|
||||
/*@*/;
|
||||
BEECRYPTAPI
|
||||
memchunk* dhaes_pContextDecrypt(dhaes_pContext*, const mpnumber*, const mpnumber*, const memchunk*);
|
||||
memchunk* dhaes_pContextDecrypt(dhaes_pContext*, const mpnumber*, const mpnumber*, const memchunk*)
|
||||
/*@*/;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
@ -34,8 +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*, randomGeneratorContext*, mpw*)
|
||||
/*@*/;
|
||||
static int dldp_pgonGenerator_w(dldp_p*, randomGeneratorContext*, mpw*)
|
||||
/*@*/;
|
||||
|
||||
int dldp_pPrivate(const dldp_p* dp, randomGeneratorContext* rgc, mpnumber* x)
|
||||
{
|
||||
|
|
|
@ -104,59 +104,76 @@ extern "C" {
|
|||
*/
|
||||
|
||||
BEECRYPTAPI
|
||||
int dldp_pInit(dldp_p*);
|
||||
int dldp_pInit(dldp_p*)
|
||||
/*@*/;
|
||||
BEECRYPTAPI
|
||||
int dldp_pFree(dldp_p*);
|
||||
int dldp_pFree(dldp_p*)
|
||||
/*@*/;
|
||||
BEECRYPTAPI
|
||||
int dldp_pCopy(dldp_p*, const dldp_p*);
|
||||
int dldp_pCopy(dldp_p*, const dldp_p*)
|
||||
/*@*/;
|
||||
|
||||
/*
|
||||
* Functions for generating keys
|
||||
*/
|
||||
|
||||
BEECRYPTAPI
|
||||
int dldp_pPrivate (const dldp_p*, randomGeneratorContext*, mpnumber*);
|
||||
int dldp_pPrivate (const dldp_p*, randomGeneratorContext*, mpnumber*)
|
||||
/*@*/;
|
||||
BEECRYPTAPI
|
||||
int dldp_pPrivate_s(const dldp_p*, randomGeneratorContext*, mpnumber*, size_t);
|
||||
int dldp_pPrivate_s(const dldp_p*, randomGeneratorContext*, mpnumber*, size_t)
|
||||
/*@*/;
|
||||
BEECRYPTAPI
|
||||
int dldp_pPublic (const dldp_p*, const mpnumber*, mpnumber*);
|
||||
int dldp_pPublic (const dldp_p*, const mpnumber*, mpnumber*)
|
||||
/*@*/;
|
||||
BEECRYPTAPI
|
||||
int dldp_pPair (const dldp_p*, randomGeneratorContext*, mpnumber*, mpnumber*);
|
||||
int dldp_pPair (const dldp_p*, randomGeneratorContext*, mpnumber*, mpnumber*)
|
||||
/*@*/;
|
||||
BEECRYPTAPI
|
||||
int dldp_pPair_s (const dldp_p*, randomGeneratorContext*, mpnumber*, mpnumber*, size_t);
|
||||
int dldp_pPair_s (const dldp_p*, randomGeneratorContext*, mpnumber*, mpnumber*, size_t)
|
||||
/*@*/;
|
||||
|
||||
/*
|
||||
* Function for comparing domain parameters
|
||||
*/
|
||||
|
||||
BEECRYPTAPI
|
||||
int dldp_pEqual (const dldp_p*, const dldp_p*);
|
||||
int dldp_pEqual (const dldp_p*, const dldp_p*)
|
||||
/*@*/;
|
||||
|
||||
/*
|
||||
* Functions for generating and validating dldp_pgoq variant domain parameters
|
||||
*/
|
||||
|
||||
BEECRYPTAPI
|
||||
int dldp_pgoqMake (dldp_p*, randomGeneratorContext*, size_t, size_t, int);
|
||||
int dldp_pgoqMake (dldp_p*, randomGeneratorContext*, size_t, size_t, int)
|
||||
/*@*/;
|
||||
BEECRYPTAPI
|
||||
int dldp_pgoqMakeSafe (dldp_p*, randomGeneratorContext*, size_t);
|
||||
int dldp_pgoqMakeSafe (dldp_p*, randomGeneratorContext*, size_t)
|
||||
/*@*/;
|
||||
BEECRYPTAPI
|
||||
int dldp_pgoqGenerator(dldp_p*, randomGeneratorContext*);
|
||||
int dldp_pgoqGenerator(dldp_p*, randomGeneratorContext*)
|
||||
/*@*/;
|
||||
BEECRYPTAPI
|
||||
int dldp_pgoqValidate (const dldp_p*, randomGeneratorContext*, int);
|
||||
int dldp_pgoqValidate (const dldp_p*, randomGeneratorContext*, int)
|
||||
/*@*/;
|
||||
|
||||
/*
|
||||
* Functions for generating and validating dldp_pgon variant domain parameters
|
||||
*/
|
||||
|
||||
BEECRYPTAPI
|
||||
int dldp_pgonMake (dldp_p*, randomGeneratorContext*, size_t, size_t);
|
||||
int dldp_pgonMake (dldp_p*, randomGeneratorContext*, size_t, size_t)
|
||||
/*@*/;
|
||||
BEECRYPTAPI
|
||||
int dldp_pgonMakeSafe (dldp_p*, randomGeneratorContext*, size_t);
|
||||
int dldp_pgonMakeSafe (dldp_p*, randomGeneratorContext*, size_t)
|
||||
/*@*/;
|
||||
BEECRYPTAPI
|
||||
int dldp_pgonGenerator(dldp_p*, randomGeneratorContext*);
|
||||
int dldp_pgonGenerator(dldp_p*, randomGeneratorContext*)
|
||||
/*@*/;
|
||||
BEECRYPTAPI
|
||||
int dldp_pgonValidate (const dldp_p*, randomGeneratorContext*);
|
||||
int dldp_pgonValidate (const dldp_p*, randomGeneratorContext*)
|
||||
/*@*/;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
@ -56,13 +56,17 @@ extern "C" {
|
|||
#endif
|
||||
|
||||
BEECRYPTAPI
|
||||
int dlkp_pPair(dlkp_p*, randomGeneratorContext*, const dldp_p*);
|
||||
int dlkp_pPair(dlkp_p*, randomGeneratorContext*, const dldp_p*)
|
||||
/*@*/;
|
||||
BEECRYPTAPI
|
||||
int dlkp_pInit(dlkp_p*);
|
||||
int dlkp_pInit(dlkp_p*)
|
||||
/*@*/;
|
||||
BEECRYPTAPI
|
||||
int dlkp_pFree(dlkp_p*);
|
||||
int dlkp_pFree(dlkp_p*)
|
||||
/*@*/;
|
||||
BEECRYPTAPI
|
||||
int dlkp_pCopy(dlkp_p*, const dlkp_p*);
|
||||
int dlkp_pCopy(dlkp_p*, const dlkp_p*)
|
||||
/*@*/;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
@ -54,19 +54,25 @@ extern "C" {
|
|||
#endif
|
||||
|
||||
BEECRYPTAPI
|
||||
int dlpk_pInit(dlpk_p*);
|
||||
int dlpk_pInit(dlpk_p*)
|
||||
/*@*/;
|
||||
BEECRYPTAPI
|
||||
int dlpk_pFree(dlpk_p*);
|
||||
int dlpk_pFree(dlpk_p*)
|
||||
/*@*/;
|
||||
BEECRYPTAPI
|
||||
int dlpk_pCopy(dlpk_p*, const dlpk_p*);
|
||||
int dlpk_pCopy(dlpk_p*, const dlpk_p*)
|
||||
/*@*/;
|
||||
|
||||
BEECRYPTAPI
|
||||
int dlpk_pEqual(const dlpk_p*, const dlpk_p*);
|
||||
int dlpk_pEqual(const dlpk_p*, const dlpk_p*)
|
||||
/*@*/;
|
||||
|
||||
BEECRYPTAPI
|
||||
int dlpk_pgoqValidate(const dlpk_p*, randomGeneratorContext*, int cofactor);
|
||||
int dlpk_pgoqValidate(const dlpk_p*, randomGeneratorContext*, int cofactor)
|
||||
/*@*/;
|
||||
BEECRYPTAPI
|
||||
int dlpk_pgonValidate(const dlpk_p*, randomGeneratorContext*);
|
||||
int dlpk_pgonValidate(const dlpk_p*, randomGeneratorContext*)
|
||||
/*@*/;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
@ -37,7 +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*, const mpnumber*, const mpnumber*, mpnumber*)
|
||||
/*@*/;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
@ -62,7 +62,8 @@ extern "C" {
|
|||
* \retval -1 on failure.
|
||||
*/
|
||||
BEECRYPTAPI
|
||||
int dsasign(const mpbarrett* p, const mpbarrett* q, const mpnumber* g, randomGeneratorContext*, const mpnumber* hm, const mpnumber* x, mpnumber* r, mpnumber* s);
|
||||
int dsasign(const mpbarrett* p, const mpbarrett* q, const mpnumber* g, randomGeneratorContext*, const mpnumber* hm, const mpnumber* x, mpnumber* r, mpnumber* 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.
|
||||
|
@ -86,7 +87,8 @@ int dsasign(const mpbarrett* p, const mpbarrett* q, const mpnumber* g, randomGen
|
|||
* \retval 0 on failure.
|
||||
*/
|
||||
BEECRYPTAPI
|
||||
int dsavrfy(const mpbarrett* p, const mpbarrett* q, const mpnumber* g, const mpnumber* hm, const mpnumber* y, const mpnumber* r, const mpnumber* s);
|
||||
int dsavrfy(const mpbarrett* p, const mpbarrett* q, const mpnumber* g, const mpnumber* hm, const mpnumber* y, const mpnumber* r, const mpnumber* s)
|
||||
/*@*/;
|
||||
|
||||
/*!\fn int dsaparamMake(dsaparam* dp, randomGeneratorContext* rgc, size_t psize)
|
||||
* \brief This function generates a set of DSA parameters.
|
||||
|
@ -101,7 +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*, randomGeneratorContext*, size_t)
|
||||
/*@*/;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
@ -66,7 +66,8 @@ randomGeneratorContext* rgc, const mpnumber* hm, const mpnumber* x, mpnumber* r,
|
|||
* \retval -1 on failure.
|
||||
*/
|
||||
BEECRYPTAPI
|
||||
int elgv1sign(const mpbarrett* p, const mpbarrett* n, const mpnumber* g, randomGeneratorContext*, const mpnumber* hm, const mpnumber* x, mpnumber* r, mpnumber* s);
|
||||
int elgv1sign(const mpbarrett* p, const mpbarrett* n, const mpnumber* g, randomGeneratorContext*, const mpnumber* hm, const mpnumber* x, mpnumber* r, mpnumber* 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.
|
||||
|
@ -89,7 +90,8 @@ int elgv1sign(const mpbarrett* p, const mpbarrett* n, const mpnumber* g, randomG
|
|||
* \retval 0 on failure.
|
||||
*/
|
||||
BEECRYPTAPI
|
||||
int elgv3sign(const mpbarrett* p, const mpbarrett* n, const mpnumber* g, randomGeneratorContext*, const mpnumber* hm, const mpnumber* x, mpnumber* r, mpnumber* s);
|
||||
int elgv3sign(const mpbarrett* p, const mpbarrett* n, const mpnumber* g, randomGeneratorContext*, const mpnumber* hm, const mpnumber* x, mpnumber* r, mpnumber* 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.
|
||||
|
@ -111,7 +113,8 @@ int elgv3sign(const mpbarrett* p, const mpbarrett* n, const mpnumber* g, randomG
|
|||
* \retval -1 on failure.
|
||||
*/
|
||||
BEECRYPTAPI
|
||||
int elgv1vrfy(const mpbarrett* p, const mpbarrett* n, const mpnumber* g, const mpnumber* hm, const mpnumber* y, const mpnumber* r, const mpnumber* s);
|
||||
int elgv1vrfy(const mpbarrett* p, const mpbarrett* n, const mpnumber* g, const mpnumber* hm, const mpnumber* y, const mpnumber* r, const mpnumber* s)
|
||||
/*@*/;
|
||||
|
||||
/*!\fn int elgv3vrfy(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 3.
|
||||
|
@ -134,7 +137,8 @@ int elgv1vrfy(const mpbarrett* p, const mpbarrett* n, const mpnumber* g, const m
|
|||
* \retval 0 on failure.
|
||||
*/
|
||||
BEECRYPTAPI
|
||||
int elgv3vrfy(const mpbarrett* p, const mpbarrett* n, const mpnumber* g, const mpnumber* hm, const mpnumber* y, const mpnumber* r, const mpnumber* s);
|
||||
int elgv3vrfy(const mpbarrett* p, const mpbarrett* n, const mpnumber* g, const mpnumber* hm, const mpnumber* y, const mpnumber* r, const mpnumber* s)
|
||||
/*@*/;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
@ -69,11 +69,16 @@ inline int64_t swap64(int64_t n)
|
|||
((n & ((int64_t) 0xff) << 56) >> 56) );
|
||||
}
|
||||
#else
|
||||
int16_t swap16 (int16_t);
|
||||
uint16_t swapu16(uint16_t);
|
||||
int32_t swap32 (int32_t);
|
||||
uint32_t swapu32(uint32_t);
|
||||
int64_t swap64 (int64_t);
|
||||
int16_t swap16 (int16_t)
|
||||
/*@*/;
|
||||
uint16_t swapu16(uint16_t)
|
||||
/*@*/;
|
||||
int32_t swap32 (int32_t)
|
||||
/*@*/;
|
||||
uint32_t swapu32(uint32_t)
|
||||
/*@*/;
|
||||
int64_t swap64 (int64_t)
|
||||
/*@*/;
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
|
@ -101,6 +101,7 @@ 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)
|
||||
/*@*/
|
||||
{
|
||||
register int rc = 0, i;
|
||||
|
||||
|
@ -283,6 +284,7 @@ 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
|
||||
/*@*/
|
||||
{
|
||||
size_t randombits = size << 3;
|
||||
byte temp = 0;
|
||||
|
@ -789,6 +791,7 @@ static pthread_mutex_t dev_tty_lock = PTHREAD_MUTEX_INITIALIZER;
|
|||
|
||||
#if HAVE_SYS_STAT_H
|
||||
static int statdevice(const char *device)
|
||||
/*@*/
|
||||
{
|
||||
struct stat s;
|
||||
|
||||
|
@ -809,6 +812,7 @@ static int statdevice(const char *device)
|
|||
#endif
|
||||
|
||||
static int opendevice(const char *device)
|
||||
/*@*/
|
||||
{
|
||||
register int fd;
|
||||
|
||||
|
@ -828,6 +832,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)
|
||||
/*@*/
|
||||
{
|
||||
register int rc;
|
||||
|
||||
|
@ -927,6 +932,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)
|
||||
/*@*/
|
||||
{
|
||||
byte dummy;
|
||||
|
||||
|
|
|
@ -50,19 +50,24 @@ BEECRYPTAPI
|
|||
int entropy_wincrypt(byte*, size_t);
|
||||
#else
|
||||
#if HAVE_DEV_AUDIO
|
||||
int entropy_dev_audio (byte*, size_t);
|
||||
int entropy_dev_audio (byte*, size_t)
|
||||
/*@*/;
|
||||
#endif
|
||||
#if HAVE_DEV_DSP
|
||||
int entropy_dev_dsp (byte*, size_t);
|
||||
int entropy_dev_dsp (byte*, size_t)
|
||||
/*@*/;
|
||||
#endif
|
||||
#if HAVE_DEV_RANDOM
|
||||
int entropy_dev_random (byte*, size_t);
|
||||
int entropy_dev_random (byte*, size_t)
|
||||
/*@*/;
|
||||
#endif
|
||||
#if HAVE_DEV_URANDOM
|
||||
int entropy_dev_urandom(byte*, size_t);
|
||||
int entropy_dev_urandom(byte*, size_t)
|
||||
/*@*/;
|
||||
#endif
|
||||
#if HAVE_DEV_TTY
|
||||
int entropy_dev_tty (byte*, size_t);
|
||||
int entropy_dev_tty (byte*, size_t)
|
||||
/*@*/;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
|
|
@ -48,6 +48,7 @@ const randomGenerator fips186prng = {
|
|||
};
|
||||
|
||||
static int fips186init(register sha1Param* p)
|
||||
/*@*/
|
||||
{
|
||||
memcpy(p->h, fips186hinit, 5 * sizeof(uint32_t));
|
||||
return 0;
|
||||
|
|
|
@ -64,13 +64,17 @@ extern "C" {
|
|||
extern BEECRYPTAPI const randomGenerator fips186prng;
|
||||
|
||||
BEECRYPTAPI
|
||||
int fips186Setup (fips186Param*);
|
||||
int fips186Setup (fips186Param*)
|
||||
/*@*/;
|
||||
BEECRYPTAPI
|
||||
int fips186Seed (fips186Param*, const byte*, size_t);
|
||||
int fips186Seed (fips186Param*, const byte*, size_t)
|
||||
/*@*/;
|
||||
BEECRYPTAPI
|
||||
int fips186Next (fips186Param*, byte*, size_t);
|
||||
int fips186Next (fips186Param*, byte*, size_t)
|
||||
/*@*/;
|
||||
BEECRYPTAPI
|
||||
int fips186Cleanup(fips186Param*);
|
||||
int fips186Cleanup(fips186Param*)
|
||||
/*@*/;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
@ -38,13 +38,17 @@ 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*, byte*, const hashFunction*, hashFunctionParam*, const byte*, size_t)
|
||||
/*@*/;
|
||||
BEECRYPTAPI
|
||||
int hmacReset (const byte*, const hashFunction*, hashFunctionParam*);
|
||||
int hmacReset (const byte*, const hashFunction*, hashFunctionParam*)
|
||||
/*@*/;
|
||||
BEECRYPTAPI
|
||||
int hmacUpdate( const hashFunction*, hashFunctionParam*, const byte*, size_t);
|
||||
int hmacUpdate( const hashFunction*, hashFunctionParam*, const byte*, size_t)
|
||||
/*@*/;
|
||||
BEECRYPTAPI
|
||||
int hmacDigest( const byte*, const hashFunction*, hashFunctionParam*, byte*);
|
||||
int hmacDigest( const byte*, const hashFunction*, hashFunctionParam*, byte*)
|
||||
/*@*/;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
@ -45,13 +45,17 @@ extern "C" {
|
|||
extern BEECRYPTAPI const keyedHashFunction hmacmd5;
|
||||
|
||||
BEECRYPTAPI
|
||||
int hmacmd5Setup (hmacmd5Param*, const byte*, size_t);
|
||||
int hmacmd5Setup (hmacmd5Param*, const byte*, size_t)
|
||||
/*@*/;
|
||||
BEECRYPTAPI
|
||||
int hmacmd5Reset (hmacmd5Param*);
|
||||
int hmacmd5Reset (hmacmd5Param*)
|
||||
/*@*/;
|
||||
BEECRYPTAPI
|
||||
int hmacmd5Update(hmacmd5Param*, const byte*, size_t);
|
||||
int hmacmd5Update(hmacmd5Param*, const byte*, size_t)
|
||||
/*@*/;
|
||||
BEECRYPTAPI
|
||||
int hmacmd5Digest(hmacmd5Param*, byte*);
|
||||
int hmacmd5Digest(hmacmd5Param*, byte*)
|
||||
/*@*/;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
@ -45,13 +45,17 @@ extern "C" {
|
|||
extern BEECRYPTAPI const keyedHashFunction hmacsha1;
|
||||
|
||||
BEECRYPTAPI
|
||||
int hmacsha1Setup (hmacsha1Param*, const byte*, size_t);
|
||||
int hmacsha1Setup (hmacsha1Param*, const byte*, size_t)
|
||||
/*@*/;
|
||||
BEECRYPTAPI
|
||||
int hmacsha1Reset (hmacsha1Param*);
|
||||
int hmacsha1Reset (hmacsha1Param*)
|
||||
/*@*/;
|
||||
BEECRYPTAPI
|
||||
int hmacsha1Update(hmacsha1Param*, const byte*, size_t);
|
||||
int hmacsha1Update(hmacsha1Param*, const byte*, size_t)
|
||||
/*@*/;
|
||||
BEECRYPTAPI
|
||||
int hmacsha1Digest(hmacsha1Param*, byte*);
|
||||
int hmacsha1Digest(hmacsha1Param*, byte*)
|
||||
/*@*/;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
@ -45,13 +45,17 @@ extern "C" {
|
|||
extern BEECRYPTAPI const keyedHashFunction hmacsha256;
|
||||
|
||||
BEECRYPTAPI
|
||||
int hmacsha256Setup (hmacsha256Param*, const byte*, size_t);
|
||||
int hmacsha256Setup (hmacsha256Param*, const byte*, size_t)
|
||||
/*@*/;
|
||||
BEECRYPTAPI
|
||||
int hmacsha256Reset (hmacsha256Param*);
|
||||
int hmacsha256Reset (hmacsha256Param*)
|
||||
/*@*/;
|
||||
BEECRYPTAPI
|
||||
int hmacsha256Update(hmacsha256Param*, const byte*, size_t);
|
||||
int hmacsha256Update(hmacsha256Param*, const byte*, size_t)
|
||||
/*@*/;
|
||||
BEECRYPTAPI
|
||||
int hmacsha256Digest(hmacsha256Param*, byte*);
|
||||
int hmacsha256Digest(hmacsha256Param*, byte*)
|
||||
/*@*/;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
@ -215,6 +215,7 @@ int md5Update(md5Param* mp, const byte* data, size_t size)
|
|||
}
|
||||
|
||||
static void md5Finish(md5Param* mp)
|
||||
/*@*/
|
||||
{
|
||||
register byte *ptr = ((byte *) mp->data) + mp->offset++;
|
||||
|
||||
|
|
|
@ -73,7 +73,8 @@ extern BEECRYPTAPI const hashFunction md5;
|
|||
* \retval 0 on success.
|
||||
*/
|
||||
BEECRYPTAPI
|
||||
void md5Process(md5Param* mp);
|
||||
void md5Process(md5Param* mp)
|
||||
/*@*/;
|
||||
|
||||
/*!\fn int md5Reset(md5Param* mp)
|
||||
* \brief This function resets the parameter block so that it's ready for a
|
||||
|
@ -82,7 +83,8 @@ void md5Process(md5Param* mp);
|
|||
* \retval 0 on success.
|
||||
*/
|
||||
BEECRYPTAPI
|
||||
int md5Reset (md5Param* mp);
|
||||
int md5Reset (md5Param* mp)
|
||||
/*@*/;
|
||||
|
||||
/*!\fn int md5Update(md5Param* mp, const byte* data, size_t size)
|
||||
* \brief This function should be used to pass successive blocks of data
|
||||
|
@ -93,7 +95,8 @@ int md5Reset (md5Param* mp);
|
|||
* \retval 0 on success.
|
||||
*/
|
||||
BEECRYPTAPI
|
||||
int md5Update (md5Param* mp, const byte* data, size_t size);
|
||||
int md5Update (md5Param* mp, const byte* data, size_t size)
|
||||
/*@*/;
|
||||
|
||||
/*!\fn int md5Digest(md5Param* mp, byte* digest)
|
||||
* \brief This function finishes the current hash computation and copies
|
||||
|
@ -103,7 +106,8 @@ int md5Update (md5Param* mp, const byte* data, size_t size);
|
|||
* \retval 0 on success.
|
||||
*/
|
||||
BEECRYPTAPI
|
||||
int md5Digest (md5Param* mp, byte* digest);
|
||||
int md5Digest (md5Param* mp, byte* digest)
|
||||
/*@*/;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
@ -36,15 +36,20 @@ extern "C" {
|
|||
#endif
|
||||
|
||||
BEECRYPTAPI
|
||||
memchunk* memchunkAlloc(size_t);
|
||||
memchunk* memchunkAlloc(size_t)
|
||||
/*@*/;
|
||||
BEECRYPTAPI
|
||||
void memchunkWipe(memchunk*);
|
||||
void memchunkWipe(memchunk*)
|
||||
/*@*/;
|
||||
BEECRYPTAPI
|
||||
void memchunkFree(memchunk*);
|
||||
void memchunkFree(memchunk*)
|
||||
/*@*/;
|
||||
BEECRYPTAPI
|
||||
memchunk* memchunkResize(memchunk*, size_t);
|
||||
memchunk* memchunkResize(memchunk*, size_t)
|
||||
/*@*/;
|
||||
BEECRYPTAPI
|
||||
memchunk* memchunkClone(const memchunk*);
|
||||
memchunk* memchunkClone(const memchunk*)
|
||||
/*@*/;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
217
beecrypt/mp.h
217
beecrypt/mp.h
|
@ -78,14 +78,16 @@ extern "C" {
|
|||
# define mpcopy(size, dst, src) memcpy(dst, src, MP_WORDS_TO_BYTES(size))
|
||||
#else
|
||||
BEECRYPTAPI
|
||||
void mpcopy(size_t size, mpw* dest, const mpw* src);
|
||||
void mpcopy(size_t size, mpw* dest, const mpw* src)
|
||||
/*@*/;
|
||||
#endif
|
||||
|
||||
#ifndef ASM_MPMOVE
|
||||
# define mpmove(size, dst, src) memmove(dst, src, MP_WORDS_TO_BYTES(size))
|
||||
#else
|
||||
BEECRYPTAPI
|
||||
void mpmove(size_t size, mpw* dest, const mpw* src);
|
||||
void mpmove(size_t size, mpw* dest, const mpw* src)
|
||||
/*@*/;
|
||||
#endif
|
||||
|
||||
/*!\fn void mpzero(size_t size, mpw* data)
|
||||
|
@ -94,7 +96,8 @@ void mpmove(size_t size, mpw* dest, const mpw* src);
|
|||
* \param data The multi-precision integer data.
|
||||
*/
|
||||
BEECRYPTAPI
|
||||
void mpzero(size_t size, mpw* data);
|
||||
void mpzero(size_t size, mpw* data)
|
||||
/*@*/;
|
||||
|
||||
/*!\fn void mpfill(size_t size, mpw* data, mpw fill)
|
||||
* \brief This function fills each word of a multi-precision integer with a
|
||||
|
@ -104,7 +107,8 @@ void mpzero(size_t size, mpw* data);
|
|||
* \param fill The value fill the data with.
|
||||
*/
|
||||
BEECRYPTAPI
|
||||
void mpfill(size_t size, mpw* data, mpw fill);
|
||||
void mpfill(size_t size, mpw* data, mpw fill)
|
||||
/*@*/;
|
||||
|
||||
/*!\fn int mpodd(size_t size, const mpw* data)
|
||||
* \brief This functions tests if a multi-precision integer is odd.
|
||||
|
@ -114,7 +118,8 @@ void mpfill(size_t size, mpw* data, mpw fill);
|
|||
* \retval 0 if even
|
||||
*/
|
||||
BEECRYPTAPI
|
||||
int mpodd (size_t size, const mpw* data);
|
||||
int mpodd (size_t size, const mpw* data)
|
||||
/*@*/;
|
||||
|
||||
/*!\fn int mpeven(size_t size, const mpw* data)
|
||||
* \brief This function tests if a multi-precision integer is even.
|
||||
|
@ -124,7 +129,8 @@ int mpodd (size_t size, const mpw* data);
|
|||
* \retval 0 if odd
|
||||
*/
|
||||
BEECRYPTAPI
|
||||
int mpeven(size_t size, const mpw* data);
|
||||
int mpeven(size_t size, const mpw* data)
|
||||
/*@*/;
|
||||
|
||||
/*!\fn int mpz(size_t size, const mpw* data)
|
||||
* \brief This function tests if a multi-precision integer is zero.
|
||||
|
@ -134,7 +140,8 @@ int mpeven(size_t size, const mpw* data);
|
|||
* \retval 0 if not zero
|
||||
*/
|
||||
BEECRYPTAPI
|
||||
int mpz (size_t size, const mpw* data);
|
||||
int mpz (size_t size, const mpw* data)
|
||||
/*@*/;
|
||||
|
||||
/*!\fn int mpnz(size_t size, const mpw* data)
|
||||
* \brief This function tests if a multi-precision integer is not zero.
|
||||
|
@ -144,7 +151,8 @@ int mpz (size_t size, const mpw* data);
|
|||
* \retval 0 if zero
|
||||
*/
|
||||
BEECRYPTAPI
|
||||
int mpnz (size_t size, const mpw* data);
|
||||
int mpnz (size_t size, const mpw* data)
|
||||
/*@*/;
|
||||
|
||||
/*!\fn int mpeq(size_t size, const mpw* xdata, const mpw* ydata)
|
||||
* \brief This function tests if two multi-precision integers of the same size
|
||||
|
@ -156,7 +164,8 @@ int mpnz (size_t size, const mpw* data);
|
|||
* \retval 0 if not equal
|
||||
*/
|
||||
BEECRYPTAPI
|
||||
int mpeq (size_t size, const mpw* xdata, const mpw* ydata);
|
||||
int mpeq (size_t size, const mpw* xdata, const mpw* ydata)
|
||||
/*@*/;
|
||||
|
||||
/*!\fn int mpne(size_t size, const mpw* xdata, const mpw* ydata)
|
||||
* \brief This function tests if two multi-precision integers of the same size
|
||||
|
@ -168,7 +177,8 @@ int mpeq (size_t size, const mpw* xdata, const mpw* ydata);
|
|||
* \retval 0 if equal
|
||||
*/
|
||||
BEECRYPTAPI
|
||||
int mpne (size_t size, const mpw* xdata, const mpw* ydata);
|
||||
int mpne (size_t size, const mpw* xdata, const mpw* ydata)
|
||||
/*@*/;
|
||||
|
||||
/*!\fn int mpgt(size_t size, const mpw* xdata, const mpw* ydata)
|
||||
* \brief This function tests if the first of two multi-precision integers
|
||||
|
@ -181,7 +191,8 @@ int mpne (size_t size, const mpw* xdata, const mpw* ydata);
|
|||
* \retval 0 if less or equal
|
||||
*/
|
||||
BEECRYPTAPI
|
||||
int mpgt (size_t size, const mpw* xdata, const mpw* ydata);
|
||||
int mpgt (size_t size, const mpw* xdata, const mpw* ydata)
|
||||
/*@*/;
|
||||
|
||||
/*!\fn int mplt(size_t size, const mpw* xdata, const mpw* ydata)
|
||||
* \brief This function tests if the first of two multi-precision integers
|
||||
|
@ -194,7 +205,8 @@ int mpgt (size_t size, const mpw* xdata, const mpw* ydata);
|
|||
* \retval 0 if greater or equal
|
||||
*/
|
||||
BEECRYPTAPI
|
||||
int mplt (size_t size, const mpw* xdata, const mpw* ydata);
|
||||
int mplt (size_t size, const mpw* xdata, const mpw* ydata)
|
||||
/*@*/;
|
||||
|
||||
/*!\fn int mpge(size_t size, const mpw* xdata, const mpw* ydata)
|
||||
* \brief This function tests if the first of two multi-precision integers
|
||||
|
@ -207,7 +219,8 @@ int mplt (size_t size, const mpw* xdata, const mpw* ydata);
|
|||
* \retval 0 if less
|
||||
*/
|
||||
BEECRYPTAPI
|
||||
int mpge (size_t size, const mpw* xdata, const mpw* ydata);
|
||||
int mpge (size_t size, const mpw* xdata, const mpw* ydata)
|
||||
/*@*/;
|
||||
|
||||
/*!\fn int mple(size_t size, const mpw* xdata, const mpw* ydata)
|
||||
* \brief This function tests if the first of two multi-precision integers
|
||||
|
@ -220,7 +233,8 @@ int mpge (size_t size, const mpw* xdata, const mpw* ydata);
|
|||
* \retval 0 if greater
|
||||
*/
|
||||
BEECRYPTAPI
|
||||
int mple (size_t size, const mpw* xdata, const mpw* ydata);
|
||||
int mple (size_t size, const mpw* xdata, const mpw* ydata)
|
||||
/*@*/;
|
||||
|
||||
/*!\fn int mpeqx(size_t xsize, const mpw* xdata, size_t ysize, const mpw* ydata)
|
||||
* \brief This function tests if two multi-precision integers of different
|
||||
|
@ -233,7 +247,8 @@ int mple (size_t size, const mpw* xdata, const mpw* ydata);
|
|||
* \retval 0 if not equal
|
||||
*/
|
||||
BEECRYPTAPI
|
||||
int mpeqx(size_t xsize, const mpw* xdata, size_t ysize, const mpw* ydata);
|
||||
int mpeqx(size_t xsize, const mpw* xdata, size_t ysize, const mpw* ydata)
|
||||
/*@*/;
|
||||
|
||||
/*!\fn int mpnex(size_t xsize, const mpw* xdata, size_t ysize, const mpw* ydata)
|
||||
* \brief This function tests if two multi-precision integers of different
|
||||
|
@ -246,7 +261,8 @@ int mpeqx(size_t xsize, const mpw* xdata, size_t ysize, const mpw* ydata);
|
|||
* \retval 0 if not equal
|
||||
*/
|
||||
BEECRYPTAPI
|
||||
int mpnex(size_t xsize, const mpw* xdata, size_t ysize, const mpw* ydata);
|
||||
int mpnex(size_t xsize, const mpw* xdata, size_t ysize, const mpw* ydata)
|
||||
/*@*/;
|
||||
|
||||
/*!\fn int mpgtx(size_t xsize, const mpw* xdata, size_t ysize, const mpw* ydata)
|
||||
* \brief This function tests if the first of two multi-precision integers
|
||||
|
@ -260,7 +276,8 @@ int mpnex(size_t xsize, const mpw* xdata, size_t ysize, const mpw* ydata);
|
|||
* \retval 0 if less or equal
|
||||
*/
|
||||
BEECRYPTAPI
|
||||
int mpgtx(size_t xsize, const mpw* xdata, size_t ysize, const mpw* ydata);
|
||||
int mpgtx(size_t xsize, const mpw* xdata, size_t ysize, const mpw* ydata)
|
||||
/*@*/;
|
||||
|
||||
/*!\fn int mpltx(size_t xsize, const mpw* xdata, size_t ysize, const mpw* ydata)
|
||||
* \brief This function tests if the first of two multi-precision integers
|
||||
|
@ -274,7 +291,8 @@ int mpgtx(size_t xsize, const mpw* xdata, size_t ysize, const mpw* ydata);
|
|||
* \retval 0 if greater or equal
|
||||
*/
|
||||
BEECRYPTAPI
|
||||
int mpltx(size_t xsize, const mpw* xdata, size_t ysize, const mpw* ydata);
|
||||
int mpltx(size_t xsize, const mpw* xdata, size_t ysize, const mpw* ydata)
|
||||
/*@*/;
|
||||
|
||||
/*!\fn int mpgex(size_t xsize, const mpw* xdata, size_t ysize, const mpw* ydata)
|
||||
* \brief This function tests if the first of two multi-precision integers
|
||||
|
@ -288,7 +306,8 @@ int mpltx(size_t xsize, const mpw* xdata, size_t ysize, const mpw* ydata);
|
|||
* \retval 0 if less
|
||||
*/
|
||||
BEECRYPTAPI
|
||||
int mpgex(size_t xsize, const mpw* xdata, size_t ysize, const mpw* ydata);
|
||||
int mpgex(size_t xsize, const mpw* xdata, size_t ysize, const mpw* ydata)
|
||||
/*@*/;
|
||||
|
||||
/*!\fn int mplex(size_t xsize, const mpw* xdata, size_t ysize, const mpw* ydata)
|
||||
* \brief This function tests if the first of two multi-precision integers
|
||||
|
@ -302,7 +321,8 @@ int mpgex(size_t xsize, const mpw* xdata, size_t ysize, const mpw* ydata);
|
|||
* \retval 0 if greater
|
||||
*/
|
||||
BEECRYPTAPI
|
||||
int mplex(size_t xsize, const mpw* xdata, size_t ysize, const mpw* ydata);
|
||||
int mplex(size_t xsize, const mpw* xdata, size_t ysize, const mpw* ydata)
|
||||
/*@*/;
|
||||
|
||||
/*!\fn int mpisone(size_t size, const mpw* data)
|
||||
* \brief This functions tests if the value of a multi-precision integer is
|
||||
|
@ -313,7 +333,8 @@ int mplex(size_t xsize, const mpw* xdata, size_t ysize, const mpw* ydata);
|
|||
* \retval 0 if not one
|
||||
*/
|
||||
BEECRYPTAPI
|
||||
int mpisone(size_t size, const mpw* data);
|
||||
int mpisone(size_t size, const mpw* data)
|
||||
/*@*/;
|
||||
|
||||
/*!\fn int mpistwo(size_t size, const mpw* data)
|
||||
* \brief This function tests if the value of a multi-precision integer is
|
||||
|
@ -324,9 +345,10 @@ int mpisone(size_t size, const mpw* data);
|
|||
* \retval 0 if not two
|
||||
*/
|
||||
BEECRYPTAPI
|
||||
int mpistwo(size_t size, const mpw* data);
|
||||
int mpistwo(size_t size, const mpw* data)
|
||||
/*@*/;
|
||||
|
||||
/*!\fn int mpleone(size_t size, const mpw* data);
|
||||
/*!\fn int mpleone(size_t size, const mpw* data)
|
||||
* \brief This function tests if the value of a multi-precision integer is
|
||||
* less than or equal to one.
|
||||
* \param size The size of the multi-precision integer.
|
||||
|
@ -335,9 +357,10 @@ int mpistwo(size_t size, const mpw* data);
|
|||
* \retval 0 if greater than one.
|
||||
*/
|
||||
BEECRYPTAPI
|
||||
int mpleone(size_t size, const mpw* data);
|
||||
int mpleone(size_t size, const mpw* data)
|
||||
/*@*/;
|
||||
|
||||
/*!\fn int mpeqmone(size_t size, const mpw* xdata, const mpw* ydata);
|
||||
/*!\fn int mpeqmone(size_t size, const mpw* xdata, const mpw* ydata)
|
||||
* \brief This function tests if multi-precision integer x is equal to y
|
||||
* minus one.
|
||||
* \param size The size of the multi-precision integers.
|
||||
|
@ -347,7 +370,8 @@ int mpleone(size_t size, const mpw* data);
|
|||
* \retval 0 if greater than one.
|
||||
*/
|
||||
BEECRYPTAPI
|
||||
int mpeqmone(size_t size, const mpw* xdata, const mpw* ydata);
|
||||
int mpeqmone(size_t size, const mpw* xdata, const mpw* ydata)
|
||||
/*@*/;
|
||||
|
||||
/*!\fn int mpmsbset(size_t size, const mpw* data)
|
||||
* \brief This function tests if the most significant bit of a multi-precision
|
||||
|
@ -358,7 +382,8 @@ int mpeqmone(size_t size, const mpw* xdata, const mpw* ydata);
|
|||
* \retval 0 if not set
|
||||
*/
|
||||
BEECRYPTAPI
|
||||
int mpmsbset(size_t size, const mpw* data);
|
||||
int mpmsbset(size_t size, const mpw* data)
|
||||
/*@*/;
|
||||
|
||||
/*!\fn int mplsbset(size_t size, const mpw* data)
|
||||
* \brief This function tests if the leiast significant bit of a multi-precision
|
||||
|
@ -369,7 +394,8 @@ int mpmsbset(size_t size, const mpw* data);
|
|||
* \retval 0 if not set
|
||||
*/
|
||||
BEECRYPTAPI
|
||||
int mplsbset(size_t size, const mpw* data);
|
||||
int mplsbset(size_t size, const mpw* data)
|
||||
/*@*/;
|
||||
|
||||
/*!\fn void mpsetmsb(size_t size, mpw* data)
|
||||
* \brief This function sets the most significant bit of a multi-precision
|
||||
|
@ -378,7 +404,8 @@ int mplsbset(size_t size, const mpw* data);
|
|||
* \param data The multi-precision integer data.
|
||||
*/
|
||||
BEECRYPTAPI
|
||||
void mpsetmsb(size_t size, mpw* data);
|
||||
void mpsetmsb(size_t size, mpw* data)
|
||||
/*@*/;
|
||||
|
||||
/*!\fn void mpsetlsb(size_t size, mpw* data)
|
||||
* \brief This function sets the least significant bit of a multi-precision
|
||||
|
@ -387,7 +414,8 @@ void mpsetmsb(size_t size, mpw* data);
|
|||
* \param data The multi-precision integer data.
|
||||
*/
|
||||
BEECRYPTAPI
|
||||
void mpsetlsb(size_t size, mpw* data);
|
||||
void mpsetlsb(size_t size, mpw* data)
|
||||
/*@*/;
|
||||
|
||||
/*!\fn void mpclrmsb(size_t size, mpw* data)
|
||||
* \brief This function clears the most significant bit of a multi-precision
|
||||
|
@ -396,7 +424,8 @@ void mpsetlsb(size_t size, mpw* data);
|
|||
* \param data The multi-precision integer data.
|
||||
*/
|
||||
BEECRYPTAPI
|
||||
void mpclrmsb(size_t size, mpw* data);
|
||||
void mpclrmsb(size_t size, mpw* data)
|
||||
/*@*/;
|
||||
|
||||
/*!\fn void mpclrlsb(size_t size, mpw* data)
|
||||
* \brief This function clears the least significant bit of a multi-precision
|
||||
|
@ -405,7 +434,8 @@ void mpclrmsb(size_t size, mpw* data);
|
|||
* \param data The multi-precision integer data.
|
||||
*/
|
||||
BEECRYPTAPI
|
||||
void mpclrlsb(size_t size, mpw* data);
|
||||
void mpclrlsb(size_t size, mpw* data)
|
||||
/*@*/;
|
||||
|
||||
/*!\fn mpand(size_t size, mpw* xdata, const mpw* ydata)
|
||||
* \brief This function computes the bit-wise AND of two multi-precision
|
||||
|
@ -415,7 +445,8 @@ void mpclrlsb(size_t size, mpw* data);
|
|||
* \param ydata The multi-precision integer data.
|
||||
*/
|
||||
BEECRYPTAPI
|
||||
void mpand(size_t size, mpw* xdata, const mpw* ydata);
|
||||
void mpand(size_t size, mpw* xdata, const mpw* ydata)
|
||||
/*@*/;
|
||||
|
||||
/*!\fn void mpor(size_t size, mpw* xdata, const mpw* ydata)
|
||||
* \brief This function computes the bit-wise OR of two multi-precision
|
||||
|
@ -425,7 +456,8 @@ void mpand(size_t size, mpw* xdata, const mpw* ydata);
|
|||
* \param ydata The multi-precision integer data.
|
||||
*/
|
||||
BEECRYPTAPI
|
||||
void mpor(size_t size, mpw* xdata, const mpw* ydata);
|
||||
void mpor(size_t size, mpw* xdata, const mpw* ydata)
|
||||
/*@*/;
|
||||
|
||||
/*!\fn void mpxor(size_t size, mpw* xdata, const mpw* ydata)
|
||||
* \brief This function computes the bit-wise XOR of two multi-precision
|
||||
|
@ -435,7 +467,8 @@ void mpor(size_t size, mpw* xdata, const mpw* ydata);
|
|||
* \param ydata The multi-precision integer data.
|
||||
*/
|
||||
BEECRYPTAPI
|
||||
void mpxor(size_t size, mpw* xdata, const mpw* ydata);
|
||||
void mpxor(size_t size, mpw* xdata, const mpw* ydata)
|
||||
/*@*/;
|
||||
|
||||
/*!\fn mpnot(size_t size, mpw* data)
|
||||
* \brief This function flips all bits of a multi-precision integer.
|
||||
|
@ -443,7 +476,8 @@ void mpxor(size_t size, mpw* xdata, const mpw* ydata);
|
|||
* \param data The multi-precision integer data.
|
||||
*/
|
||||
BEECRYPTAPI
|
||||
void mpnot(size_t size, mpw* data);
|
||||
void mpnot(size_t size, mpw* data)
|
||||
/*@*/;
|
||||
|
||||
/*!\fn void mpsetw(size_t size, mpw* xdata, mpw y)
|
||||
* \brief This function sets the value of a multi-precision integer to the
|
||||
|
@ -454,7 +488,8 @@ void mpnot(size_t size, mpw* data);
|
|||
* \param y The multi-precision word.
|
||||
*/
|
||||
BEECRYPTAPI
|
||||
void mpsetw(size_t size, mpw* xdata, mpw y);
|
||||
void mpsetw(size_t size, mpw* xdata, mpw y)
|
||||
/*@*/;
|
||||
|
||||
/*!\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
|
||||
|
@ -465,7 +500,8 @@ void mpsetw(size_t size, mpw* xdata, mpw y);
|
|||
* \param ysize The size of the second multi-precision integer.
|
||||
* \param ydata The second multi-precision integer.
|
||||
*/
|
||||
void mpsetx(size_t xsize, mpw* xdata, size_t ysize, const mpw* ydata);
|
||||
void mpsetx(size_t xsize, mpw* xdata, size_t ysize, const mpw* ydata)
|
||||
/*@*/;
|
||||
|
||||
/*!\fn int mpaddw(size_t size, mpw* xdata, mpw y)
|
||||
* \brief This function adds one word to a multi-precision integer.
|
||||
|
@ -476,7 +512,8 @@ void mpsetx(size_t xsize, mpw* xdata, size_t ysize, const mpw* ydata);
|
|||
* \return The carry-over value of the operation; this value is either 0 or 1.
|
||||
*/
|
||||
BEECRYPTAPI
|
||||
int mpaddw(size_t size, mpw* xdata, mpw y);
|
||||
int mpaddw(size_t size, mpw* xdata, mpw y)
|
||||
/*@*/;
|
||||
|
||||
/*!\fn int mpadd(size_t size, mpw* xdata, const mpw* ydata)
|
||||
* \brief This function adds two multi-precision integers of equal size.
|
||||
|
@ -487,7 +524,8 @@ int mpaddw(size_t size, mpw* xdata, mpw y);
|
|||
* \return The carry-over value of the operation; this value is either 0 or 1.
|
||||
*/
|
||||
BEECRYPTAPI
|
||||
int mpadd (size_t size, mpw* xdata, const mpw* ydata);
|
||||
int mpadd (size_t size, mpw* xdata, const mpw* ydata)
|
||||
/*@*/;
|
||||
|
||||
/*!\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.
|
||||
|
@ -499,7 +537,8 @@ int mpadd (size_t size, mpw* xdata, const mpw* ydata);
|
|||
* \return The carry-over value of the operation; this value is either 0 or 1.
|
||||
*/
|
||||
BEECRYPTAPI
|
||||
int mpaddx(size_t xsize, mpw* xdata, size_t ysize, const mpw* ydata);
|
||||
int mpaddx(size_t xsize, mpw* xdata, size_t ysize, const mpw* ydata)
|
||||
/*@*/;
|
||||
|
||||
/*!\fn int mpsubw(size_t size, mpw* xdata, mpw y)
|
||||
* \brief This function subtracts one word to a multi-precision integer.
|
||||
|
@ -510,7 +549,8 @@ int mpaddx(size_t xsize, mpw* xdata, size_t ysize, const mpw* ydata);
|
|||
* \return The carry-over value of the operation; this value is either 0 or 1.
|
||||
*/
|
||||
BEECRYPTAPI
|
||||
int mpsubw(size_t size, mpw* xdata, mpw y);
|
||||
int mpsubw(size_t size, mpw* xdata, mpw y)
|
||||
/*@*/;
|
||||
|
||||
/*!\fn int mpsub(size_t size, mpw* xdata, const mpw* ydata)
|
||||
* \brief This function subtracts two multi-precision integers of equal size.
|
||||
|
@ -521,7 +561,8 @@ int mpsubw(size_t size, mpw* xdata, mpw y);
|
|||
* \return The carry-over value of the operation; this value is either 0 or 1.
|
||||
*/
|
||||
BEECRYPTAPI
|
||||
int mpsub (size_t size, mpw* xdata, const mpw* ydata);
|
||||
int mpsub (size_t size, mpw* xdata, const mpw* ydata)
|
||||
/*@*/;
|
||||
|
||||
/*!\fn int mpsubx(size_t xsize, mpw* xdata, size_t ysize, const mpw* ydata)
|
||||
* \brief This function subtracts two multi-precision integers of different
|
||||
|
@ -533,10 +574,12 @@ int mpsub (size_t size, mpw* xdata, const mpw* ydata);
|
|||
* \return The carry-over value of the operation; this value is either 0 or 1.
|
||||
*/
|
||||
BEECRYPTAPI
|
||||
int mpsubx(size_t xsize, mpw* xdata, size_t ysize, const mpw* ydata);
|
||||
int mpsubx(size_t xsize, mpw* xdata, size_t ysize, const mpw* ydata)
|
||||
/*@*/;
|
||||
|
||||
BEECRYPTAPI
|
||||
int mpmultwo(size_t size, mpw* data);
|
||||
int mpmultwo(size_t size, mpw* data)
|
||||
/*@*/;
|
||||
|
||||
/*!\fn void mpneg(size_t size, mpw* data)
|
||||
* \brief This function negates a multi-precision integer.
|
||||
|
@ -544,7 +587,8 @@ int mpmultwo(size_t size, mpw* data);
|
|||
* \param data The multi-precision integer data.
|
||||
*/
|
||||
BEECRYPTAPI
|
||||
void mpneg(size_t size, mpw* data);
|
||||
void mpneg(size_t size, mpw* data)
|
||||
/*@*/;
|
||||
|
||||
/*!\fn size_t mpsize(size_t size, const mpw* data)
|
||||
* \brief This function returns the true size of a multi-precision
|
||||
|
@ -553,7 +597,8 @@ void mpneg(size_t size, mpw* data);
|
|||
* \param data The multi-precision integer data.
|
||||
*/
|
||||
BEECRYPTAPI
|
||||
size_t mpsize(size_t size, const mpw* data);
|
||||
size_t mpsize(size_t size, const mpw* data)
|
||||
/*@*/;
|
||||
|
||||
/*!\fn size_t mpbits(size_t size, const mpw* data)
|
||||
* \brief This function returns the number of significant bits
|
||||
|
@ -562,31 +607,40 @@ size_t mpsize(size_t size, const mpw* data);
|
|||
* \param data The multi-precision integer data.
|
||||
*/
|
||||
BEECRYPTAPI
|
||||
size_t mpbits(size_t size, const mpw* data);
|
||||
size_t mpbits(size_t size, const mpw* data)
|
||||
/*@*/;
|
||||
|
||||
BEECRYPTAPI
|
||||
size_t mpmszcnt(size_t size, const mpw* data);
|
||||
size_t mpmszcnt(size_t size, const mpw* data)
|
||||
/*@*/;
|
||||
|
||||
BEECRYPTAPI
|
||||
size_t mplszcnt(size_t size, const mpw* data);
|
||||
size_t mplszcnt(size_t size, const mpw* data)
|
||||
/*@*/;
|
||||
|
||||
BEECRYPTAPI
|
||||
void mplshift(size_t size, mpw* data, size_t count);
|
||||
void mplshift(size_t size, mpw* data, size_t count)
|
||||
/*@*/;
|
||||
|
||||
BEECRYPTAPI
|
||||
void mprshift(size_t size, mpw* data, size_t count);
|
||||
void mprshift(size_t size, mpw* data, size_t count)
|
||||
/*@*/;
|
||||
|
||||
BEECRYPTAPI
|
||||
size_t mprshiftlsz(size_t size, mpw* data);
|
||||
size_t mprshiftlsz(size_t size, mpw* data)
|
||||
/*@*/;
|
||||
|
||||
BEECRYPTAPI
|
||||
size_t mpnorm(size_t size, mpw* data);
|
||||
size_t mpnorm(size_t size, mpw* data)
|
||||
/*@*/;
|
||||
|
||||
BEECRYPTAPI
|
||||
void mpdivtwo (size_t size, mpw* data);
|
||||
void mpdivtwo (size_t size, mpw* data)
|
||||
/*@*/;
|
||||
|
||||
BEECRYPTAPI
|
||||
void mpsdivtwo(size_t size, mpw* data);
|
||||
void mpsdivtwo(size_t size, mpw* data)
|
||||
/*@*/;
|
||||
|
||||
/*!\fn mpw mpsetmul(size_t size, mpw* result, const mpw* data, mpw y)
|
||||
* \brief This function performs a multi-precision multiply-setup.
|
||||
|
@ -603,7 +657,8 @@ void mpsdivtwo(size_t size, mpw* data);
|
|||
* \return The carry-over multi-precision word.
|
||||
*/
|
||||
BEECRYPTAPI
|
||||
mpw mpsetmul (size_t size, mpw* result, const mpw* data, mpw y);
|
||||
mpw mpsetmul (size_t size, mpw* result, const mpw* data, mpw y)
|
||||
/*@*/;
|
||||
|
||||
/*!\fn mpw mpaddmul(size_t size, mpw* result, const mpw* data, mpw y)
|
||||
* \brief This function performs a mult-precision multiply-accumulate.
|
||||
|
@ -619,70 +674,86 @@ mpw mpsetmul (size_t size, mpw* result, const mpw* data, mpw y);
|
|||
* \retval The carry-over multi-precision word.
|
||||
*/
|
||||
BEECRYPTAPI
|
||||
mpw mpaddmul (size_t size, mpw* result, const mpw* data, mpw y);
|
||||
mpw mpaddmul (size_t size, mpw* result, const mpw* data, mpw y)
|
||||
/*@*/;
|
||||
|
||||
/*!\fn void mpaddsqrtrc(size_t size, mpw* result, const mpw* data)
|
||||
* \brief This function is used in the calculation of a multi-precision
|
||||
* squaring.
|
||||
*/
|
||||
BEECRYPTAPI
|
||||
void mpaddsqrtrc(size_t size, mpw* result, const mpw* data);
|
||||
void mpaddsqrtrc(size_t size, mpw* result, const mpw* data)
|
||||
/*@*/;
|
||||
|
||||
/*!\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);
|
||||
void mpmul(mpw* result, size_t xsize, const mpw* xdata, size_t ysize, const mpw* ydata)
|
||||
/*@*/;
|
||||
|
||||
/*!\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);
|
||||
void mpsqr(mpw* result, size_t size, const mpw* data)
|
||||
/*@*/;
|
||||
|
||||
BEECRYPTAPI
|
||||
void mpgcd_w(size_t size, const mpw* xdata, const mpw* ydata, mpw* result, mpw* wksp);
|
||||
void mpgcd_w(size_t size, const mpw* xdata, const mpw* ydata, mpw* result, mpw* wksp)
|
||||
/*@*/;
|
||||
|
||||
BEECRYPTAPI
|
||||
int mpextgcd_w(size_t size, const mpw* xdata, const mpw* ydata, mpw* result, mpw* wksp);
|
||||
int mpextgcd_w(size_t size, const mpw* xdata, const mpw* ydata, mpw* result, mpw* wksp)
|
||||
/*@*/;
|
||||
|
||||
BEECRYPTAPI
|
||||
mpw mppndiv(mpw xhi, mpw xlo, mpw y);
|
||||
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* wksp)
|
||||
/*@*/;
|
||||
|
||||
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* wksp)
|
||||
/*@*/;
|
||||
|
||||
/*
|
||||
* Output Routines
|
||||
*/
|
||||
|
||||
BEECRYPTAPI
|
||||
void mpprint(size_t size, const mpw* data);
|
||||
void mpprint(size_t size, const mpw* data)
|
||||
/*@*/;
|
||||
|
||||
BEECRYPTAPI
|
||||
void mpprintln(size_t size, const mpw* data);
|
||||
void mpprintln(size_t size, const mpw* data)
|
||||
/*@*/;
|
||||
|
||||
BEECRYPTAPI
|
||||
void mpfprint(FILE* f, size_t size, const mpw* data);
|
||||
void mpfprint(FILE* f, size_t size, const mpw* data)
|
||||
/*@*/;
|
||||
|
||||
BEECRYPTAPI
|
||||
void mpfprintln(FILE* f, size_t size, const mpw* data);
|
||||
void mpfprintln(FILE* f, size_t size, const mpw* data)
|
||||
/*@*/;
|
||||
|
||||
/*
|
||||
* Conversion Routines
|
||||
*/
|
||||
|
||||
BEECRYPTAPI
|
||||
int os2ip(mpw* idata, size_t isize, const byte* osdata, size_t ossize);
|
||||
int os2ip(mpw* idata, size_t isize, const byte* osdata, size_t ossize)
|
||||
/*@*/;
|
||||
|
||||
BEECRYPTAPI
|
||||
int i2osp(byte* osdata, size_t ossize, const mpw* idata, size_t isize);
|
||||
int i2osp(byte* osdata, size_t ossize, const mpw* idata, size_t isize)
|
||||
/*@*/;
|
||||
|
||||
BEECRYPTAPI
|
||||
int hs2ip(mpw* idata, size_t isize, const char* hsdata, size_t hssize);
|
||||
int hs2ip(mpw* idata, size_t isize, const char* hsdata, size_t hssize)
|
||||
/*@*/;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
@ -69,85 +69,116 @@ extern "C" {
|
|||
#endif
|
||||
|
||||
BEECRYPTAPI
|
||||
void mpbzero(mpbarrett*);
|
||||
void mpbzero(mpbarrett*)
|
||||
/*@*/;
|
||||
BEECRYPTAPI
|
||||
void mpbinit(mpbarrett*, size_t);
|
||||
void mpbinit(mpbarrett*, size_t)
|
||||
/*@*/;
|
||||
BEECRYPTAPI
|
||||
void mpbfree(mpbarrett*);
|
||||
void mpbfree(mpbarrett*)
|
||||
/*@*/;
|
||||
BEECRYPTAPI
|
||||
void mpbcopy(mpbarrett*, const mpbarrett*);
|
||||
void mpbcopy(mpbarrett*, const mpbarrett*)
|
||||
/*@*/;
|
||||
BEECRYPTAPI
|
||||
void mpbwipe(mpbarrett*);
|
||||
void mpbwipe(mpbarrett*)
|
||||
/*@*/;
|
||||
|
||||
BEECRYPTAPI
|
||||
void mpbset(mpbarrett*, size_t, const mpw*);
|
||||
void mpbset(mpbarrett*, size_t, const mpw*)
|
||||
/*@*/;
|
||||
|
||||
BEECRYPTAPI
|
||||
int mpbsetbin(mpbarrett*, const byte*, size_t);
|
||||
int mpbsetbin(mpbarrett*, const byte*, size_t)
|
||||
/*@*/;
|
||||
BEECRYPTAPI
|
||||
int mpbsethex(mpbarrett*, const char*);
|
||||
int mpbsethex(mpbarrett*, const char*)
|
||||
/*@*/;
|
||||
|
||||
BEECRYPTAPI
|
||||
void mpbsubone(const mpbarrett*, mpw*);
|
||||
void mpbsubone(const mpbarrett*, mpw*)
|
||||
/*@*/;
|
||||
|
||||
BEECRYPTAPI
|
||||
void mpbmu_w(mpbarrett*, mpw*);
|
||||
void mpbmu_w(mpbarrett*, mpw*)
|
||||
/*@*/;
|
||||
|
||||
BEECRYPTAPI
|
||||
void mpbrnd_w (const mpbarrett*, randomGeneratorContext*, mpw*, mpw*);
|
||||
void mpbrnd_w (const mpbarrett*, randomGeneratorContext*, mpw*, mpw*)
|
||||
/*@*/;
|
||||
BEECRYPTAPI
|
||||
void mpbrndodd_w(const mpbarrett*, randomGeneratorContext*, mpw*, mpw*);
|
||||
void mpbrndodd_w(const mpbarrett*, randomGeneratorContext*, mpw*, mpw*)
|
||||
/*@*/;
|
||||
BEECRYPTAPI
|
||||
void mpbrndinv_w(const mpbarrett*, randomGeneratorContext*, mpw*, mpw*, mpw*);
|
||||
void mpbrndinv_w(const mpbarrett*, randomGeneratorContext*, mpw*, mpw*, mpw*)
|
||||
/*@*/;
|
||||
|
||||
BEECRYPTAPI
|
||||
void mpbneg_w(const mpbarrett*, const mpw*, mpw*);
|
||||
void mpbneg_w(const mpbarrett*, const mpw*, mpw*)
|
||||
/*@*/;
|
||||
BEECRYPTAPI
|
||||
void mpbmod_w(const mpbarrett*, const mpw*, mpw*, mpw*);
|
||||
void mpbmod_w(const mpbarrett*, const mpw*, mpw*, mpw*)
|
||||
/*@*/;
|
||||
|
||||
BEECRYPTAPI
|
||||
void mpbaddmod_w(const mpbarrett*, size_t, const mpw*, size_t, const mpw*, mpw*, mpw*);
|
||||
void mpbaddmod_w(const mpbarrett*, size_t, const mpw*, size_t, const mpw*, mpw*, mpw*)
|
||||
/*@*/;
|
||||
BEECRYPTAPI
|
||||
void mpbsubmod_w(const mpbarrett*, size_t, const mpw*, size_t, const mpw*, mpw*, mpw*);
|
||||
void mpbsubmod_w(const mpbarrett*, size_t, const mpw*, size_t, const mpw*, mpw*, mpw*)
|
||||
/*@*/;
|
||||
BEECRYPTAPI
|
||||
void mpbmulmod_w(const mpbarrett*, size_t, const mpw*, size_t, const mpw*, mpw*, mpw*);
|
||||
void mpbmulmod_w(const mpbarrett*, size_t, const mpw*, size_t, const mpw*, mpw*, mpw*)
|
||||
/*@*/;
|
||||
BEECRYPTAPI
|
||||
void mpbsqrmod_w(const mpbarrett*, size_t, const mpw*, mpw*, mpw*);
|
||||
void mpbsqrmod_w(const mpbarrett*, size_t, const mpw*, mpw*, mpw*)
|
||||
/*@*/;
|
||||
BEECRYPTAPI
|
||||
void mpbpowmod_w(const mpbarrett*, size_t, const mpw*, size_t, const mpw*, mpw*, mpw*);
|
||||
void mpbpowmod_w(const mpbarrett*, size_t, const mpw*, size_t, const mpw*, mpw*, mpw*)
|
||||
/*@*/;
|
||||
BEECRYPTAPI
|
||||
void mpbpowmodsld_w(const mpbarrett*, const mpw*, size_t, const mpw*, mpw*, mpw*);
|
||||
void mpbpowmodsld_w(const mpbarrett*, const mpw*, size_t, const mpw*, mpw*, mpw*)
|
||||
/*@*/;
|
||||
BEECRYPTAPI
|
||||
void mpbtwopowmod_w(const mpbarrett*, size_t, const mpw*, mpw*, mpw*);
|
||||
void mpbtwopowmod_w(const mpbarrett*, size_t, const mpw*, mpw*, mpw*)
|
||||
/*@*/;
|
||||
|
||||
/* 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*, 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*, 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*, randomGeneratorContext*, int, mpw*)
|
||||
/*@*/;
|
||||
|
||||
/* the next routines take mpnumbers as parameters */
|
||||
|
||||
BEECRYPTAPI
|
||||
void mpbnrnd(const mpbarrett*, randomGeneratorContext*, mpnumber*);
|
||||
void mpbnrnd(const mpbarrett*, randomGeneratorContext*, mpnumber*)
|
||||
/*@*/;
|
||||
|
||||
BEECRYPTAPI
|
||||
void mpbnmulmod(const mpbarrett*, const mpnumber*, const mpnumber*, mpnumber*);
|
||||
void mpbnmulmod(const mpbarrett*, const mpnumber*, const mpnumber*, mpnumber*)
|
||||
/*@*/;
|
||||
BEECRYPTAPI
|
||||
void mpbnsqrmod(const mpbarrett*, const mpnumber*, mpnumber*);
|
||||
void mpbnsqrmod(const mpbarrett*, const mpnumber*, mpnumber*)
|
||||
/*@*/;
|
||||
|
||||
BEECRYPTAPI
|
||||
void mpbnpowmod (const mpbarrett*, const mpnumber*, const mpnumber*, mpnumber*);
|
||||
void mpbnpowmod (const mpbarrett*, const mpnumber*, const mpnumber*, mpnumber*)
|
||||
/*@*/;
|
||||
BEECRYPTAPI
|
||||
void mpbnpowmodsld(const mpbarrett*, const mpw*, const mpnumber*, mpnumber*);
|
||||
void mpbnpowmodsld(const mpbarrett*, const mpw*, const mpnumber*, mpnumber*)
|
||||
/*@*/;
|
||||
|
||||
BEECRYPTAPI
|
||||
size_t mpbbits(const mpbarrett*);
|
||||
size_t mpbbits(const mpbarrett*)
|
||||
/*@*/;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
@ -73,37 +73,50 @@ extern "C" {
|
|||
#endif
|
||||
|
||||
BEECRYPTAPI
|
||||
void mpnzero(mpnumber*);
|
||||
void mpnzero(mpnumber*)
|
||||
/*@*/;
|
||||
BEECRYPTAPI
|
||||
void mpnsize(mpnumber*, size_t);
|
||||
void mpnsize(mpnumber*, size_t)
|
||||
/*@*/;
|
||||
BEECRYPTAPI
|
||||
void mpninit(mpnumber*, size_t, const mpw*);
|
||||
void mpninit(mpnumber*, size_t, const mpw*)
|
||||
/*@*/;
|
||||
BEECRYPTAPI
|
||||
void mpnfree(mpnumber*);
|
||||
void mpnfree(mpnumber*)
|
||||
/*@*/;
|
||||
BEECRYPTAPI
|
||||
void mpncopy(mpnumber*, const mpnumber*);
|
||||
void mpncopy(mpnumber*, const mpnumber*)
|
||||
/*@*/;
|
||||
BEECRYPTAPI
|
||||
void mpnwipe(mpnumber*);
|
||||
void mpnwipe(mpnumber*)
|
||||
/*@*/;
|
||||
|
||||
BEECRYPTAPI
|
||||
void mpnset (mpnumber*, size_t, const mpw*);
|
||||
void mpnset (mpnumber*, size_t, const mpw*)
|
||||
/*@*/;
|
||||
BEECRYPTAPI
|
||||
void mpnsetw (mpnumber*, mpw);
|
||||
void mpnsetw (mpnumber*, mpw)
|
||||
/*@*/;
|
||||
|
||||
BEECRYPTAPI
|
||||
int mpnsetbin(mpnumber*, const byte*, size_t);
|
||||
int mpnsetbin(mpnumber*, const byte*, size_t)
|
||||
/*@*/;
|
||||
BEECRYPTAPI
|
||||
int mpnsethex(mpnumber*, const char*);
|
||||
int mpnsethex(mpnumber*, const char*)
|
||||
/*@*/;
|
||||
|
||||
BEECRYPTAPI
|
||||
int mpninv(mpnumber*, const mpnumber*, const mpnumber*);
|
||||
int mpninv(mpnumber*, const mpnumber*, const mpnumber*)
|
||||
/*@*/;
|
||||
|
||||
/*!\brief Truncate the mpnumber to the specified number of (least significant) bits.
|
||||
*/
|
||||
BEECRYPTAPI
|
||||
size_t mpntrbits(mpnumber*, size_t);
|
||||
size_t mpntrbits(mpnumber*, size_t)
|
||||
/*@*/;
|
||||
BEECRYPTAPI
|
||||
size_t mpnbits(const mpnumber*);
|
||||
size_t mpnbits(const mpnumber*)
|
||||
/*@*/;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
@ -710,6 +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)
|
||||
/*@*/
|
||||
{
|
||||
register size_t size = p->size;
|
||||
register size_t msbclr = MP_WORDS_TO_BITS(size) - bits;
|
||||
|
|
|
@ -37,20 +37,27 @@ extern "C" {
|
|||
#endif
|
||||
|
||||
BEECRYPTAPI
|
||||
int mpptrials (size_t);
|
||||
int mpptrials (size_t)
|
||||
/*@*/;
|
||||
BEECRYPTAPI
|
||||
int mppmilrab_w (const mpbarrett*, randomGeneratorContext*, int, mpw*);
|
||||
int mppmilrab_w (const mpbarrett*, randomGeneratorContext*, int, mpw*)
|
||||
/*@*/;
|
||||
|
||||
BEECRYPTAPI
|
||||
int mpprnd_w (mpbarrett*, randomGeneratorContext*, size_t, int, const mpnumber*, mpw*);
|
||||
int mpprnd_w (mpbarrett*, randomGeneratorContext*, size_t, int, const mpnumber*, mpw*)
|
||||
/*@*/;
|
||||
BEECRYPTAPI
|
||||
int mpprndr_w (mpbarrett*, randomGeneratorContext*, size_t, int, const mpnumber*, const mpnumber*, const mpnumber*, mpw*);
|
||||
int mpprndr_w (mpbarrett*, randomGeneratorContext*, size_t, int, const mpnumber*, const mpnumber*, const mpnumber*, mpw*)
|
||||
/*@*/;
|
||||
BEECRYPTAPI
|
||||
void mpprndsafe_w (mpbarrett*, randomGeneratorContext*, size_t, int, mpw*);
|
||||
void mpprndsafe_w (mpbarrett*, randomGeneratorContext*, size_t, int, mpw*)
|
||||
/*@*/;
|
||||
BEECRYPTAPI
|
||||
void mpprndcon_w (mpbarrett*, randomGeneratorContext*, size_t, int, const mpnumber*, const mpnumber*, const mpnumber*, mpnumber*, mpw*);
|
||||
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*, randomGeneratorContext*, size_t, int, const mpbarrett*, const mpnumber*, mpnumber*, int, mpw*)
|
||||
/*@*/;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
@ -49,6 +49,7 @@
|
|||
const randomGenerator mtprng = { "Mersenne Twister", sizeof(mtprngParam), (randomGeneratorSetup) mtprngSetup, (randomGeneratorSeed) mtprngSeed, (randomGeneratorNext) mtprngNext, (randomGeneratorCleanup) mtprngCleanup };
|
||||
|
||||
static void mtprngReload(mtprngParam* mp)
|
||||
/*@*/
|
||||
{
|
||||
register uint32_t *p0 = mp->state;
|
||||
register uint32_t *p2 = p0+2, *pM = p0+M, s0, s1;
|
||||
|
|
|
@ -62,22 +62,26 @@ extern BEECRYPTAPI const randomGenerator mtprng;
|
|||
/*
|
||||
*/
|
||||
BEECRYPTAPI
|
||||
int mtprngSetup (mtprngParam* mp);
|
||||
int mtprngSetup (mtprngParam* mp)
|
||||
/*@*/;
|
||||
|
||||
/*
|
||||
*/
|
||||
BEECRYPTAPI
|
||||
int mtprngSeed (mtprngParam* mp, const byte* data, size_t size);
|
||||
int mtprngSeed (mtprngParam* mp, const byte* data, size_t size)
|
||||
/*@*/;
|
||||
|
||||
/*
|
||||
*/
|
||||
BEECRYPTAPI
|
||||
int mtprngNext (mtprngParam* mp, byte* data, size_t size);
|
||||
int mtprngNext (mtprngParam* mp, byte* data, size_t size)
|
||||
/*@*/;
|
||||
|
||||
/*
|
||||
*/
|
||||
BEECRYPTAPI
|
||||
int mtprngCleanup(mtprngParam* mp);
|
||||
int mtprngCleanup(mtprngParam* mp)
|
||||
/*@*/;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
@ -18,7 +18,8 @@ extern "C" {
|
|||
* \param emsize
|
||||
*/
|
||||
BEECRYPTAPI
|
||||
int pkcs1_emsa_encode_digest(hashFunctionContext* ctxt, byte* emdata, size_t emsize);
|
||||
int pkcs1_emsa_encode_digest(hashFunctionContext* ctxt, byte* emdata, size_t emsize)
|
||||
/*@*/;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
@ -17,7 +17,8 @@ extern "C" {
|
|||
#define PKCS12_ID_MAC 0x3
|
||||
|
||||
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);
|
||||
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)
|
||||
/*@*/;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
@ -49,7 +49,8 @@ extern "C" {
|
|||
*/
|
||||
BEECRYPTAPI
|
||||
int rsapub(const mpbarrett* n, const mpnumber* e,
|
||||
const mpnumber* m, mpnumber* c);
|
||||
const mpnumber* m, mpnumber* 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.
|
||||
|
@ -68,7 +69,8 @@ int rsapub(const mpbarrett* n, const mpnumber* e,
|
|||
*/
|
||||
BEECRYPTAPI
|
||||
int rsapri(const mpbarrett* n, const mpnumber* d,
|
||||
const mpnumber* c, mpnumber* m);
|
||||
const mpnumber* c, mpnumber* 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)
|
||||
*
|
||||
|
@ -95,7 +97,8 @@ int rsapri(const mpbarrett* n, const mpnumber* d,
|
|||
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);
|
||||
const mpnumber* c, mpnumber* m)
|
||||
/*@*/;
|
||||
|
||||
/*!\fn int rsavrfy(const mpbarrett* n, const mpnumber* e, const mpnumber* m, const mpnumber* c)
|
||||
* \brief This function performs a raw RSA verification.
|
||||
|
@ -112,7 +115,8 @@ int rsapricrt(const mpbarrett* n, const mpbarrett* p, const mpbarrett* q,
|
|||
*/
|
||||
BEECRYPTAPI
|
||||
int rsavrfy(const mpbarrett* n, const mpnumber* e,
|
||||
const mpnumber* m, const mpnumber* c);
|
||||
const mpnumber* m, const mpnumber* c)
|
||||
/*@*/;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
@ -90,13 +90,17 @@ extern "C" {
|
|||
#endif
|
||||
|
||||
BEECRYPTAPI
|
||||
int rsakpMake(rsakp*, randomGeneratorContext*, size_t);
|
||||
int rsakpMake(rsakp*, randomGeneratorContext*, size_t)
|
||||
/*@*/;
|
||||
BEECRYPTAPI
|
||||
int rsakpInit(rsakp*);
|
||||
int rsakpInit(rsakp*)
|
||||
/*@*/;
|
||||
BEECRYPTAPI
|
||||
int rsakpFree(rsakp*);
|
||||
int rsakpFree(rsakp*)
|
||||
/*@*/;
|
||||
BEECRYPTAPI
|
||||
int rsakpCopy(rsakp*, const rsakp*);
|
||||
int rsakpCopy(rsakp*, const rsakp*)
|
||||
/*@*/;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
@ -52,11 +52,14 @@ extern "C" {
|
|||
#endif
|
||||
|
||||
BEECRYPTAPI
|
||||
int rsapkInit(rsapk*);
|
||||
int rsapkInit(rsapk*)
|
||||
/*@*/;
|
||||
BEECRYPTAPI
|
||||
int rsapkFree(rsapk*);
|
||||
int rsapkFree(rsapk*)
|
||||
/*@*/;
|
||||
BEECRYPTAPI
|
||||
int rsapkCopy(rsapk*, const rsapk*);
|
||||
int rsapkCopy(rsapk*, const rsapk*)
|
||||
/*@*/;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
@ -237,6 +237,7 @@ int sha1Update(sha1Param* sp, const byte* data, size_t size)
|
|||
}
|
||||
|
||||
static void sha1Finish(sha1Param* sp)
|
||||
/*@*/
|
||||
{
|
||||
register byte *ptr = ((byte *) sp->data) + sp->offset++;
|
||||
|
||||
|
|
|
@ -73,7 +73,8 @@ extern BEECRYPTAPI const hashFunction sha1;
|
|||
* \param sp The hash function's parameter block.
|
||||
*/
|
||||
BEECRYPTAPI
|
||||
void sha1Process(sha1Param* sp);
|
||||
void sha1Process(sha1Param* sp)
|
||||
/*@*/;
|
||||
|
||||
/*!\fn int sha1Reset(sha1Param* sp)
|
||||
* \brief This function resets the parameter block so that it's ready for a
|
||||
|
@ -82,7 +83,8 @@ void sha1Process(sha1Param* sp);
|
|||
* \retval 0 on success.
|
||||
*/
|
||||
BEECRYPTAPI
|
||||
int sha1Reset (sha1Param* sp);
|
||||
int sha1Reset (sha1Param* sp)
|
||||
/*@*/;
|
||||
|
||||
/*!\fn int sha1Update(sha1Param* sp, const byte* data, size_t size)
|
||||
* \brief This function should be used to pass successive blocks of data
|
||||
|
@ -93,7 +95,8 @@ int sha1Reset (sha1Param* sp);
|
|||
* \retval 0 on success.
|
||||
*/
|
||||
BEECRYPTAPI
|
||||
int sha1Update (sha1Param* sp, const byte* data, size_t size);
|
||||
int sha1Update (sha1Param* sp, const byte* data, size_t size)
|
||||
/*@*/;
|
||||
|
||||
/*!\fn int sha1Digest(sha1Param* sp, byte* digest)
|
||||
* \brief This function finishes the current hash computation and copies
|
||||
|
@ -103,7 +106,8 @@ int sha1Update (sha1Param* sp, const byte* data, size_t size);
|
|||
* \retval 0 on success.
|
||||
*/
|
||||
BEECRYPTAPI
|
||||
int sha1Digest (sha1Param* sp, byte* digest);
|
||||
int sha1Digest (sha1Param* sp, byte* digest)
|
||||
/*@*/;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
@ -225,6 +225,7 @@ int sha256Update(register sha256Param* sp, const byte* data, size_t size)
|
|||
}
|
||||
|
||||
static void sha256Finish(register sha256Param* sp)
|
||||
/*@*/
|
||||
{
|
||||
register byte *ptr = ((byte *) sp->data) + sp->offset++;
|
||||
|
||||
|
|
|
@ -72,7 +72,8 @@ extern BEECRYPTAPI const hashFunction sha256;
|
|||
* \param sp The hash function's parameter block.
|
||||
*/
|
||||
BEECRYPTAPI
|
||||
void sha256Process(sha256Param* sp);
|
||||
void sha256Process(sha256Param* sp)
|
||||
/*@*/;
|
||||
|
||||
/*!\fn int sha256Reset(sha256Param* sp)
|
||||
* \brief This function resets the parameter block so that it's ready for a
|
||||
|
@ -81,7 +82,8 @@ void sha256Process(sha256Param* sp);
|
|||
* \retval 0 on success.
|
||||
*/
|
||||
BEECRYPTAPI
|
||||
int sha256Reset (sha256Param* sp);
|
||||
int sha256Reset (sha256Param* sp)
|
||||
/*@*/;
|
||||
|
||||
/*!\fn int sha256Update(sha256Param* sp, const byte* data, size_t size)
|
||||
* \brief This function should be used to pass successive blocks of data
|
||||
|
@ -92,7 +94,8 @@ int sha256Reset (sha256Param* sp);
|
|||
* \retval 0 on success.
|
||||
*/
|
||||
BEECRYPTAPI
|
||||
int sha256Update (sha256Param* sp, const byte* data, size_t size);
|
||||
int sha256Update (sha256Param* sp, const byte* data, size_t size)
|
||||
/*@*/;
|
||||
|
||||
/*!\fn int sha256Digest(sha256Param* sp, byte* digest)
|
||||
* \brief This function finishes the current hash computation and copies
|
||||
|
@ -102,7 +105,8 @@ int sha256Update (sha256Param* sp, const byte* data, size_t size);
|
|||
* \retval 0 on success.
|
||||
*/
|
||||
BEECRYPTAPI
|
||||
int sha256Digest (sha256Param* sp, byte* digest);
|
||||
int sha256Digest (sha256Param* sp, byte* digest)
|
||||
/*@*/;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
@ -49,7 +49,8 @@ extern "C" {
|
|||
#endif
|
||||
|
||||
BEECRYPTAPI
|
||||
javalong timestamp(void);
|
||||
javalong timestamp(void)
|
||||
/*@*/;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue