8000 crypto, refactor: fix compile error on low version gcc. · fibjs/fibjs@9172dcf · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Commit 9172dcf

Browse files
committed
crypto, refactor: fix compile error on low version gcc.
1 parent 0bb9277 commit 9172dcf

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#include "defs.h"
1111
#include <exlib/include/utils.h>
1212
#include <blst/include/bbs.h>
13+
#include <memory>
1314

1415
namespace fibjs {
1516

fibjs/src/crypto/bbs/Proof.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class Proof {
2020
Buffer* buf = Buffer::Cast(sig);
2121

2222
decoder dec(buf->data(), buf->length());
23-
ssize_t sz = dec.decode(&abar, &bbar, &c, &r2hat, &r3hat);
23+
intptr_t sz = dec.decode(&abar, &bbar, &c, &r2hat, &r3hat);
2424
if (sz < 0)
2525
return false;
2626

fibjs/src/crypto/bbs/encode.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -238,16 +238,16 @@ class decoder {
238238

239239
public:
240240
template <typename... Ts>
241-
ssize_t decode(Ts&&... ts)
241+
intptr_t decode(Ts&&... ts)
242242
{
243243
size_t sz = (codec_impl::codec_length(*ts) + ...);
244244
if (sz > m_size)
245-
return m_size - sz;
245+
return (intptr_t)m_size - (intptr_t)sz;
246246

247247
(codec_impl::decode_one(m_data, ts), ...);
248248
m_size -= sz;
249249

250-
return m_size;
250+
return (intptr_t)m_size;
251251
}
252252

253253
private:

0 commit comments

Comments
 (0)
0