dh.h

来自「各种加密算法的源代码」· C头文件 代码 · 共 28 行

H
28
字号
#ifndef DH_H
#define DH_H

#include "bignum.h"

class DH
{
public:
    DH(const bignum &p, const bignum &g);
    DH(RandomNumberGenerator &rng, unsigned int pbits);
    DH(RandomNumberGenerator &rng, unsigned int pbits, unsigned qbits);

    DH(BufferedTransformation &bt);
    void DEREncode(BufferedTransformation &bt) const;

    // this is the length of both publicValue and agreedKey
    unsigned int OutputLength() const {return p.ByteCount();}

    void Setup(RandomNumberGenerator &rng, byte *publicValue);
    void Agree(const byte *otherPublicValue, byte *agreedKey) const;

private:
    bignum p, g, x;
};

#endif

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?