Bitcoin Forum
June 17, 2024, 04:51:34 PM *
News: Voting for pizza day contest
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: libsecp256k1: converting a 5x52 field into a 10x26 field  (Read 328 times)
rico666 (OP)
Legendary
*
Offline Offline

Activity: 1120
Merit: 1037


฿ → ∞


View Profile WWW
March 21, 2017, 06:16:39 PM
 #1

I'm having trouble to achieve a meaningful conversion from a 5x52 field representation to a 10x26 representation.

A mere

Code:
static void hrd256k1_fe_52to26(const hrd256k1_fe *in, hrd256k1_fe32 *out) {
  out->n[1] = in->n[0] & 0x3FFFFFFU;
  out->n[0] = in->n[0] >> 26;
  out->n[3] = in->n[1] & 0x3FFFFFFU;
  out->n[2] = in->n[1] >> 26;
  out->n[5] = in->n[2] & 0x3FFFFFFU;
  out->n[4] = in->n[2] >> 26;
  out->n[7] = in->n[3] & 0x3FFFFFFU;
  out->n[6] = in->n[3] >> 26;
  out->n[9] = in->n[4] & 0x3FFFFFFU;
  out->n[8] = in->n[4] >> 26;
}

doesn't seem to cut it, unless the originating field has been normalized. Am I doing it wrong? Am I overlooking something or should it work and I'm being bitten by something else?


Rico

all non self-referential signatures except mine are lame ... oh wait ...   ·  LBC Thread (News)  ·  Past BURST Activities
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!