Skip to content

Bit Limit of Input Value #39

@ShiroNekoHouse

Description

@ShiroNekoHouse

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!!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions