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
  • /
  • ntruhrss701
  • /
  • m4f
  • /
  • poly_s3_inv_jumpdivsteps.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:1d89c446ec1f3039b7d6ecff157d3d60047a27da
directory badge Iframe embedding
swh:1:dir:a6444f08b9a843ba17dc39e96e03d8d90295f559
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 ...
poly_s3_inv_jumpdivsteps.c
// #include <stdint.h>
#include "poly.h"

#define p 700
#define p_minus_1 (p-1)
#define _p 704 // for jumpdivsteps
#define over_divsteps ((_p-p)*2+1)
#define reverse_head (p-1+over_divsteps)

extern int jump1408divsteps_mod3_64(int minusdelta, uint32_t *M, uint32_t *f, uint32_t *g);

static inline uint8_t __mod3(uint8_t a) { /* a between 0 and 9 */
    int16_t t, c;
    a = (a >> 2) + (a & 3); /* between 0 and 4 */
    t = a - 3;
    c = t >> 5;
    return (uint8_t) (t ^ (c & (a ^ t)));
}

void poly_S3_inv_jumpdivsteps(poly *r, const poly *a){
    uint8_t f[_p]={0},g[_p]={0},M[_p*2]={0};
    int i;
    int minusdelta=-1;

    for(i=0; i<=p; i++) f[i]=1;
    for(i=0;i<p;i++) g[i]= a->coeffs[p_minus_1-i];

    minusdelta = jump1408divsteps_mod3_64(minusdelta,(uint32_t*)M,(uint32_t*)f,(uint32_t*)g);

    for(i=0;i<p;i++){
        r->coeffs[i] = __mod3(M[reverse_head-i]*f[0]);
    }
    r->coeffs[p] = 0;
    
    // return minusdelta == -over_divsteps ? 0 : 1;
}

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