MCPcopy Create free account
hub / github.com/Meituan-Dianping/SQLAdvisor / Agree

Method Agree

extra/yassl/taocrypt/src/dh.cpp:74–87  ·  view source on GitHub ↗

Generate Agreement

Source from the content-addressed store, hash-verified

72
73// Generate Agreement
74void DH::Agree(byte* agree, const byte* priv, const byte* otherPub, word32
75 otherSz)
76{
77 const word32 bc(p_.ByteCount());
78 Integer x(priv, bc);
79 Integer y;
80 if (otherSz)
81 y.Decode(otherPub, otherSz);
82 else
83 y.Decode(otherPub, bc);
84
85 Integer z(a_exp_b_mod_c(y, x, p_));
86 z.Encode(agree, bc);
87}
88
89
90DH::DH(Source& source)

Callers 3

bench_dhFunction · 0.80
dh_testFunction · 0.80
makeAgreementMethod · 0.80

Calls 2

EncodeMethod · 0.80
DecodeMethod · 0.45

Tested by 1

dh_testFunction · 0.64