Giter VIP home page Giter VIP logo

Comments (1)

guidovranken avatar guidovranken commented on August 18, 2024

Fixed for the initial test cases but here are several more:

#include <relic_conf.h>
#include <relic.h>

int main(void)
{
    if ( core_init() != RLC_OK ) abort();

    bn_t A, B, T, R;

    bn_null(A); bn_new(A);
    bn_null(B); bn_new(B);
    bn_null(T); bn_new(T);
    bn_null(R); bn_new(R);

    const char* s1 = "-40000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000";
    const char* s2 = "1000000008085565626950052485339";

    bn_read_str(A, s1, strlen(s1), 10);
    bn_read_str(B, s2, strlen(s2), 10);

    bn_mod_pre_pmers(T, B);
    bn_mod_pmers(R, A, B, T);

    bn_free(A);
    bn_free(B);
    bn_free(R);
    return 0;
}
#include <relic_conf.h>
#include <relic.h>

int main(void)
{
    if ( core_init() != RLC_OK ) abort();

    bn_t A, B, R;

    bn_null(A); bn_new(A);
    bn_null(B); bn_new(B);
    bn_null(R); bn_new(R);

    const char* s1 = "-84188714582398424282924837971525302416121644922532904925719910019730366406692145110910451835370677729009982225231537055482344448449494885992079184439080332650492164152024663316259825979114307745219612418660284477206115556017824207836080543415311256999882374573159840575656433390608937570598427225641138811639454618650623237752360321314683560644900656599159998199749784085136636574828755016837198390014053526162457207985313600482369516893453082425634394004035335600569252309342416667058081447309620082759166647721269538581019712937621797680559640478496612342652277971109816641580333453482774934852375430692160643135049372888765762165530901971661913725898008658893736894874410534574770449458104177534565559388040836484430924799911717958648713731258999232626735298645735304006829211593568383492884994715657316401309906170433440078999797386221264638417290776658723938149657917146350646324468364465878782400130619013500564960683051374492818846097783886050431223924920699908387300315865416213231111936508705291748466891577917854198678534647458343121019346820914608258814413442523087232358976263373209362231989459316427654414280233542798437213660397336495805933003144615626216049445562764275564828503587502395165374737568774205340587663190940331526317941044593632864632144165988778533616246667557287090971693878867492395002278968114321981230329283446451073926284733984950374113246880140663243845491443596667469929782549825438957838178740840746290917393928846712857736826153391806687725210764591297970686102806697348325779234582508868778839501393805462143256161991386601225931803177511244663297274967418506906266916109930198988848122532326574508661086728535806312040359321477852460341601556456821094939468762188063205348209305385548433547694225729904545303508164657500258806738689379264053590776128829553009925193782431877555300022969045813190025846726122856689053438166852880708223696488750669697316370921052677402039092729424126274483962879414581976975356285057961826549432614715834366979652717717215386096642885981603909015660729590204835586680218489427212462405730888900102452764241395089004219157215756345661327922021225621250219058168656225771985211325604168363967789471992209627972563557139641630308154822856005581588974718094696685636924336678523303672869195685245680408395385497659076056116488370533082414805096459600494622216377813638298446871252424195649712";
    const char* s2 = "100300000000000000000255";

    bn_read_str(A, s1, strlen(s1), 10);
    bn_read_str(B, s2, strlen(s2), 10);

    bn_mod_monty_conv(R, A, B);

    bn_free(A);
    bn_free(B);
    bn_free(R);
    return 0;
}

from relic.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.