Skip to main content
  • Home
  • Development
  • Documentation
  • Donate
  • Operational login
  • Browse the archive

swh logo
SoftwareHeritage
Software
Heritage
Archive
Features
  • Search

  • Downloads

  • Save code now

  • Add forge now

  • Help

  • a3483c2
  • /
  • ntrulpr761
  • /
  • m4f
  • /
  • Rq_mult.c
Raw File Download
Permalinks

To reference or cite the objects present in the Software Heritage archive, permalinks based on SoftWare Hash IDentifiers (SWHIDs) must be used.
Select below a type of object currently browsed in order to display its associated SWHID and permalink.

  • content
  • directory
content badge Iframe embedding
swh:1:cnt:4a5e2fd892b1498c18c0211686c51aca730c7236
directory badge Iframe embedding
swh:1:dir:5f3a51315c7e41718a82b21f7948f737326c1616
Citations

This interface enables to generate software citations, provided that the root directory of browsed objects contains a citation.cff or codemeta.json file.
Select below a type of object currently browsed in order to generate citations for them.

  • content
  • directory
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Rq_mult.c
#include "Rq_mult.h"


/*************************************************
* Name:        Rq_mult_small
*
* Description: Computes polynomial multiplication in Z_q/(X^p-X-1)
*              with selected implementation.
*
* Arguments:
* Fq *h          : pointer to the output polynomial in R_q
* const Fq *f    : pointer to the input polynomial in R_q
* const small *g : pointer to the input polynomial in R_q
**************************************************/
void Rq_mult_small(Fq *h,const Fq *f,const small *g)
{
  Fq g_modq[1530], fg[1530];

  byteToShort_761(h, g);
  Good17x9_Rader17(g_modq, h);
  ntt9_rader(g_modq);
  Good17x9_Rader17(fg, f);
  ntt9_rader(fg);
  polymul_10x10_153_mr(fg, g_modq);
  intt9_rader(fg);
  iRader17_iGood17x9(g_modq, fg);
  mod_reduce_761(h, g_modq);

}

/*************************************************
* Name:        Rq_mult_twice
*
* Description: Computes two polynomial multiplications in Z_q/(X^p-X-1)
*              with selected implementation.
*
* Arguments:
* Fq *bG          : pointer to the output polynomial in R_q
* Fq *bA          : pointer to the output polynomial in R_q
* const Fq *G    : pointer to the input polynomial in R_q
* const Fq *A    : pointer to the input polynomial in R_q
* const small *b : pointer to the input polynomial in R_q
**************************************************/
void Rq_mult_twice(Fq *bG, Fq *bA, const Fq *G, const Fq *A, const small *b){

  Fq b_modq[1530], G_modq[1530], A_modq[1530];
  byteToShort_761(bG, b);
  Good17x9_Rader17(b_modq, bG);
  ntt9_rader(b_modq);
  Good17x9_Rader17(G_modq, G);
  ntt9_rader(G_modq);
  Good17x9_Rader17(A_modq, A);
  ntt9_rader(A_modq);
  polymul_10x10_153_mr(G_modq, b_modq);
  polymul_10x10_153_mr(A_modq, b_modq);
  intt9_rader(G_modq);
  iRader17_iGood17x9(b_modq, G_modq);
  mod_reduce_761(bG, b_modq);
  intt9_rader(A_modq);
  iRader17_iGood17x9(b_modq, A_modq);
  mod_reduce_761(bA, b_modq);
}

Software Heritage — Copyright (C) 2015–2025, The Software Heritage developers. License: GNU AGPLv3+.
The source code of Software Heritage itself is available on our development forge.
The source code files archived by Software Heritage are available under their own copyright and licenses.
Terms of use: Archive access, API— Contact— JavaScript license information— Web API

back to top