src/wcc.c.in [27:85]: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - /* Perform sha256 of EC Points and Id. Map to an integer modulo the curve order. */ void WCC_ZZZ_Hq(int sha, octet *A,octet *B,octet *C,octet *D,octet *h) { BIG_XXX q,hs; // hv has to store two points in G1, One in G2 and the Id length char hv[2000]; octet HV= {0,sizeof(hv),hv}; char ht[WCC_PFS_ZZZ]; octet HT= {0,sizeof(ht),ht}; BIG_XXX_rcopy(q,CURVE_Order_ZZZ); #ifdef DEBUG printf("WCC_ZZZ_Hq: A: "); OCT_output(A); printf("\n"); printf("WCC_ZZZ_Hq: B: "); OCT_output(B); printf("\n"); printf("WCC_ZZZ_Hq: C: "); OCT_output(C); printf("\n"); printf("WCC_ZZZ_Hq: D: "); OCT_output(D); printf("\n"); #endif OCT_joctet(&HV,A); OCT_joctet(&HV,B); OCT_joctet(&HV,C); OCT_joctet(&HV,D); mhashit(sha,0,&HV,&HT); BIG_XXX_fromBytes(hs,HT.val); BIG_XXX_mod(hs,q); OCT_clear(&HT); BIG_XXX_toBytes(h->val,hs); h->len=WCC_PGS_ZZZ; } /* Calculate a value in G1. VG1 = s*H1(ID) where ID is the identity */ int WCC_ZZZ_GET_G1_MULTIPLE(octet *S,octet *HID,octet *VG1) { BIG_XXX s; ECP_ZZZ P; ECP_ZZZ_mapit(&P,HID); BIG_XXX_fromBytes(s,S->val); PAIR_ZZZ_G1mul(&P,s); ECP_ZZZ_toOctet(VG1,&P,false); return 0; } /* Calculate a value in G2. VG2 = s*H2(ID) where ID is the identity */ int WCC_ZZZ_GET_G2_MULTIPLE(octet *S,octet *HID,octet *VG2) { BIG_XXX s; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - src/wcc192.c.in [27:85]: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - /* Perform sha256 of EC Points and Id. Map to an integer modulo the curve order. */ void WCC_ZZZ_Hq(int sha, octet *A,octet *B,octet *C,octet *D,octet *h) { BIG_XXX q,hs; // hv has to store two points in G1, One in G2 and the Id length char hv[2000]; octet HV= {0,sizeof(hv),hv}; char ht[WCC_PFS_ZZZ]; octet HT= {0,sizeof(ht),ht}; BIG_XXX_rcopy(q,CURVE_Order_ZZZ); #ifdef DEBUG printf("WCC_ZZZ_Hq: A: "); OCT_output(A); printf("\n"); printf("WCC_ZZZ_Hq: B: "); OCT_output(B); printf("\n"); printf("WCC_ZZZ_Hq: C: "); OCT_output(C); printf("\n"); printf("WCC_ZZZ_Hq: D: "); OCT_output(D); printf("\n"); #endif OCT_joctet(&HV,A); OCT_joctet(&HV,B); OCT_joctet(&HV,C); OCT_joctet(&HV,D); mhashit(sha,0,&HV,&HT); BIG_XXX_fromBytes(hs,HT.val); BIG_XXX_mod(hs,q); OCT_clear(&HT); BIG_XXX_toBytes(h->val,hs); h->len=WCC_PGS_ZZZ; } /* Calculate a value in G1. VG1 = s*H1(ID) where ID is the identity */ int WCC_ZZZ_GET_G1_MULTIPLE(octet *S,octet *HID,octet *VG1) { BIG_XXX s; ECP_ZZZ P; ECP_ZZZ_mapit(&P,HID); BIG_XXX_fromBytes(s,S->val); PAIR_ZZZ_G1mul(&P,s); ECP_ZZZ_toOctet(VG1,&P,false); return 0; } /* Calculate a value in G2. VG2 = s*H2(ID) where ID is the identity */ int WCC_ZZZ_GET_G2_MULTIPLE(octet *S,octet *HID,octet *VG2) { BIG_XXX s; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -