diff options
Diffstat (limited to 'beecrypt/dhaes.h')
-rw-r--r-- | beecrypt/dhaes.h | 48 |
1 files changed, 36 insertions, 12 deletions
diff --git a/beecrypt/dhaes.h b/beecrypt/dhaes.h index 21bb8f308..96439a943 100644 --- a/beecrypt/dhaes.h +++ b/beecrypt/dhaes.h @@ -31,24 +31,48 @@ typedef struct { - dldp_p param; - hashFunctionContext hash; - blockCipherContext cipher; - keyedHashFunctionContext mac; - randomGeneratorContext rng; -} dhaes_p; + const dldp_p* param; + const hashFunction* hash; + const blockCipher* cipher; + const keyedHashFunction* mac; + int cipherkeybits; + int mackeybits; +} dhaes_pParameters; + +typedef struct +{ + dldp_p param; + mp32number pub; + mp32number pri; + hashFunctionContext hash; + blockCipherContext cipher; + keyedHashFunctionContext mac; + int cipherkeybits; + int mackeybits; +} dhaes_pContext; BEEDLLAPI -int dhaes_usable(const blockCipher*, const keyedHashFunction*, const hashFunction*); +int dhaes_pUsable(const dhaes_pParameters*) + /*@*/; BEEDLLAPI -int dhaes_pInit(dhaes_p*, const dldp_p*, const blockCipher*, const keyedHashFunction*, const hashFunction*, const randomGenerator*); +int dhaes_pContextInit (dhaes_pContext* ctxt, const dhaes_pParameters*) + /*@modifies ctxt */; BEEDLLAPI -int dhaes_pFree(dhaes_p*); - +int dhaes_pContextInitDecrypt(dhaes_pContext* ctxt, const dhaes_pParameters*, const mp32number*) + /*@modifies ctxt */; BEEDLLAPI -memchunk* dhaes_pEncrypt(dhaes_p*, const mp32number*, mp32number*, mp32number*, const memchunk*); +int dhaes_pContextInitEncrypt(dhaes_pContext* ctxt, const dhaes_pParameters*, const mp32number*) + /*@modifies ctxt */; BEEDLLAPI -memchunk* dhaes_pDecrypt(dhaes_p*, const mp32number*, const mp32number*, const mp32number*, const memchunk*); +int dhaes_pContextFree (/*@only@*/ dhaes_pContext* ctxt) + /*@modifies ctxt */; + +BEEDLLAPI /*@only@*/ /*@null@*/ +memchunk* dhaes_pContextEncrypt(dhaes_pContext* ctxt, mp32number* ephemeralPublicKey, mp32number*, const memchunk*, randomGeneratorContext*) + /*@modifies ctxt, ephemeralPublicKey */; +BEEDLLAPI /*@only@*/ /*@null@*/ +memchunk* dhaes_pContextDecrypt(dhaes_pContext* ctxt, const mp32number*, const mp32number*, const memchunk*) + /*@modifies ctxt */; #endif |