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

Bit Limit of Input Value #39

Open
ShiroNekoHouse opened this issue May 3, 2020 · 0 comments
Open

Bit Limit of Input Value #39

ShiroNekoHouse opened this issue May 3, 2020 · 0 comments

Comments

@ShiroNekoHouse
Copy link

ShiroNekoHouse commented May 3, 2020

I want to input a big number with a bitlength larger than 64 as the value of X[i] in otmain.cpp, using Set() function :
`
uint32_t bitlength=128;
//......
uint64_t matValue0=50;
uint64_t matValue1=60;

    for(uint32_t i = 0; i < nsndvals; i++) {
        X[i] = new CBitVector();
        X[i]->Create(numOTs, bitlength);
        for(uint32_t j = 0; j<numOTs;j++){
	        X[i]->Set(i==0?matValue0:matValue1,j);
        }
    }

`

S7Y@E(F@5M_7XSS%8@YRS_E

It seems that the value of Set() function has a limit of no more than sizeof(T)*8, which means 64 bits here....Otherwise it may cause an overflow.
template<class T> void Set(T val, std::size_t pos, std::size_t len) { assert(len <= sizeof(T) * 8); SetBits((BYTE*) &val, pos, len); }
So how can I input the value of X[i] with big number larger than 64 bits?
Thank you!!

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