Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question about SECRETKEY_B_BYTES #59

Open
wangwwz opened this issue Jun 27, 2022 · 0 comments
Open

Question about SECRETKEY_B_BYTES #59

wangwwz opened this issue Jun 27, 2022 · 0 comments

Comments

@wangwwz
Copy link

wangwwz commented Jun 27, 2022

These macros are defined in P610_internal.h

#define SECRETKEY_A_BYTES       ((OALICE_BITS + 7) / 8)
#define SECRETKEY_B_BYTES       ((OBOB_BITS - 1 + 7) / 8)
#define FP2_ENCODED_BYTES       2*((NBITS_FIELD + 7) / 8)

#ifdef COMPRESS
    #define MASK2_BOB               0x07
    #define MASK3_BOB               0xFF
    #define ORDER_A_ENCODED_BYTES   SECRETKEY_A_BYTES
    #define ORDER_B_ENCODED_BYTES   (SECRETKEY_B_BYTES + 1)

I wonder why SECRETKEY_A_BYTES = (OALICE_BITS + 7) / 8 but SECRETKEY_B_BYTES = (OBOB_BITS + 6) / 8. What's more, ORDER_B_ENCODED_BYTES is defined as SECRETKEY_B_BYTES + 1 in P610_internal.h but in other Pxxx_internal.h ORDER_B_ENCODED_BYTES is just SECRETKEY_B_BYTES. According to my understanding, SECRETKEY_B_BYTES should be defined as (OBOB_BITS + 7) / 8 so that the ORDER_B_ENCODED_BYTES in P610_internal.h does not need to be especially defined.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant