91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 39KB
    文件類型: .rar
    金幣: 2
    下載: 0 次
    發(fā)布日期: 2021-05-29
  • 語言: 其他
  • 標(biāo)簽: 同態(tài)加密??

資源簡介

同態(tài)加密/解密C代碼,已經(jīng)編譯通過!fhe-enc,fhe-dec 同態(tài)加密/解密C代碼,已經(jīng)編譯通過!fhe-enc,fhe-dec

資源截圖

代碼片段和文件信息



#include?
#include?


#include?



NTL_START_IMPL


long?ZZ::HexOutput?=?0;

const?ZZ&?ZZ::zero()
{
???static?ZZ?z;
???return?z;
}


const?ZZ&?ZZ_expo(long?e)
{
???static?ZZ?expo_helper;
???conv(expo_helper?e);
???return?expo_helper;
}




void?AddMod(ZZ&?x?const?ZZ&?a?long?b?const?ZZ&?n)
{
???static?ZZ?B;
???conv(B?b);
???AddMod(x?a?B?n);
}


void?SubMod(ZZ&?x?const?ZZ&?a?long?b?const?ZZ&?n)
{
???static?ZZ?B;
???conv(B?b);
???SubMod(x?a?B?n);
}

void?SubMod(ZZ&?x?long?a?const?ZZ&?b?const?ZZ&?n)
{
???static?ZZ?A;
???conv(A?a);
???SubMod(x?A?b?n);
}



//?******?input?and?output

static?long?iodigits?=?0;
static?long?ioradix?=?0;

//?iodigits?is?the?greatest?integer?such?that?10^{iodigits}?//?ioradix?=?10^{iodigits}

static?void?InitZZIO()
{
???long?x;

???x?=?(NTL_WSP_BOUND-1)/10;
???iodigits?=?0;
???ioradix?=?1;

???while?(x)?{
??????x?=?x?/?10;
??????iodigits++;
??????ioradix?=?ioradix?*?10;
???}

???if?(iodigits?<=?0)?Error(“problem?with?I/O“);
}


static?long?HexTwoChars(long?&byte?istream&?s)
{
??byte?=?CharToIntVal(s.peek());
??if?(byte??15)
????return?0;??//?didn‘t?read?anything?from?stream

??s.get();
??long?c2?=?CharToIntVal(s.peek());
??if?(c2??15)
????return?1;??//?read?only?one?character

??s.get();
??byte?<<=?4;
??byte?+=?c2;
??return?2;????//?read?two?characters
}

static?void?HexReadFromStream(istream&?s?ZZ&?a)
{
??const?long?bufLen?=?256;?//?read?upto?256?bytes?at?a?time
??static?ZZ?b;
??static?unsigned?char?buf[bufLen];

??long?nRead;
??long?bufIdx?=?bufLen-1;
??long?c?=?CharToIntVal(s.peek());
??if?(c??15)?Error(“HexReadFromStream:?bad?ZZ?input“);

??a?=?0;
??while?((nRead=HexTwoChars(cs))?==?2)?{?//?read?next?1-2?chars?from?stream
????buf[bufIdx]?=?(unsigned?char)?c;
????if?(bufIdx?==?0)?{?//?buffer?is?full?process?it
??????ZZFromBytes(b?buf?bufLen);
??????a?<<=?bufLen*8;??//?shift?a?to?left?then?add?b
??????a?+=?b;
??????bufIdx?=?bufLen-1;
????}
????else?bufIdx--;
??}

??if?(bufIdx?????long?nBytes?=?bufLen-bufIdx-1;
????ZZFromBytes(b?&buf[bufIdx+1]?nBytes);
????a?<<=?nBytes*8;
????a?+=?b;????
??}

??if?(nRead?==?1)?{?//?one?more?character?to?process
????a?<<=?4;
????a?+=?c;
??}
}


istream&?operator>>(istream&?s?ZZ&?x)
{
???long?c;
???long?cval;
???long?sign;
???long?ndigits;
???long?acc;
???static?ZZ?a;

???if?(!s)?Error(“bad?ZZ?input?(no?stream?found)“);
???if?(!iodigits)?InitZZIO();

???SkipWhiteSpace(s);
???c?=?s.peek();

???if?(c?==?‘-‘)?{
??????sign?=?-1;
??????s.get();
??????c?=?s.peek();
???}
???else
??????sign?=?1;

???cval?=?CharToIntVal(c);
???if?(cval??9)?Error(“bad?ZZ?input?(first?digit?not?int?[0-9])“);

???if?(c?==?‘0‘)?{?//?check?if?the?next?char?is?‘x‘?else?ignore?leading?0
?????s.get();
?????c?=?s.peek();
?????if?(c?==?‘x‘?||?c?==?‘X‘)?{?//?hexadecimal?number
???????s.get();
???????HexReadFromStream(s?a);
???????if?(sign?==?-1)?negate(

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----

?????文件????????764??2010-08-04?16:40??同態(tài)加解密\fhe-dec.cc

?????文件???????5154??2010-08-04?16:40??同態(tài)加解密\fhe-enc.cc

?????文件???????9389??2010-08-04?16:40??同態(tài)加解密\fhe-keygen.cc

?????文件??????10294??2010-08-04?16:40??同態(tài)加解密\fhe-recrypt.cc

?????文件???????5997??2010-08-04?16:40??同態(tài)加解密\fhe-utils.cc

?????文件???????5872??2010-08-04?16:41??同態(tài)加解密\fhe.h

?????文件????????547??2010-07-19?21:31??同態(tài)加解密\makefile

?????文件????????203??2010-07-22?15:18??同態(tài)加解密\mkflags

?????文件????????652??2010-08-04?16:40??同態(tài)加解密\randomStuff.cc

?????文件???????1540??2010-08-04?16:40??同態(tài)加解密\randomStuff.h

?????文件???????3386??2018-08-10?17:01??同態(tài)加解密\test-recrypt.cc

?????文件???????3355??2010-08-04?16:40??同態(tài)加解密\test-recrypt.cc.bak

?????文件??????44093??2010-07-19?16:50??同態(tài)加解密\ZZ.c

?????文件??????46837??2010-07-19?16:51??同態(tài)加解密\ZZ.h

?????目錄??????????0??2019-01-02?10:28??同態(tài)加解密

-----------?---------??----------?-----??----

???????????????138083????????????????????15


評論

共有 條評論