Unnamed Fossil Project

Check-in [01260c9d72]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:updated
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:01260c9d72504193286b1a1077efa059f57b4318
User & Date: alexey@sudachen.name 2011-12-09 13:12:46
Context
2011-12-19
00:38
updated check-in: 36317ee219 user: alexey@sudachen.name tags: trunk
2011-12-09
13:12
updated check-in: 01260c9d72 user: alexey@sudachen.name tags: trunk
2011-11-26
00:28
updated check-in: 21f1495322 user: alexey@sudachen.name tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to pefile.hc.

745
746
747
748
749
750
751
752

      
    return 0;
  }
#endif
  ;

#endif /* C_once_EA617668_2E48_4AC6_9079_699B387A0662 */










>
745
746
747
748
749
750
751
752
753
      
    return 0;
  }
#endif
  ;

#endif /* C_once_EA617668_2E48_4AC6_9079_699B387A0662 */


Changes to tests/hmacmd5.c.

1

2
3

4
5
6
7
8
9
10


#include "../libyoyo.hc"



/*
 * RFC 2202 test vectors
 */
byte_t Data_Key[7][26] =
  {
    { "\x0B\x0B\x0B\x0B\x0B\x0B\x0B\x0B\x0B\x0B\x0B\x0B\x0B\x0B\x0B\x0B" },

>

<
>







1
2
3

4
5
6
7
8
9
10
11

#define _LIBYOYO
#include "../libyoyo.hc"

#include "../libcrypt.hc"

/*
 * RFC 2202 test vectors
 */
byte_t Data_Key[7][26] =
  {
    { "\x0B\x0B\x0B\x0B\x0B\x0B\x0B\x0B\x0B\x0B\x0B\x0B\x0B\x0B\x0B\x0B" },

Changes to tests/md5.c.

1

2

3
4
5
6
7
8
9


#include "../libyoyo.hc"


int main(int argc, char **argv)
  {
    YOYO_BUFFER *bf;
    byte_t sign[16] = {0};
    
    

>

>







1
2
3
4
5
6
7
8
9
10
11

#define _LIBYOYO
#include "../libyoyo.hc"
#include "../libcrypt.hc"

int main(int argc, char **argv)
  {
    YOYO_BUFFER *bf;
    byte_t sign[16] = {0};
    
    

Changes to tests/rsa.c.

1

2
3
4
5
6
7
8
..
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27


#include "../libyoyo.hc"
#include "../bigint.hc"

enum { MAX_ITER_COUNT = 3 };

int main(int argc, char **argv)
  {
................................................................................
    bits = Str_To_Int(Prog_Argument_Dflt(0,"128"));
    data = Bigint_Expand(0,(bits+sizeof(halflong_t)*8-1)/(sizeof(halflong_t)*8));
    System_Random(data->value,data->digits*sizeof(halflong_t));
    Bigint_Rshift_1(data);
    //data = Bigint_Random(bits-1);
    puts(Bigint_Encode_16(data));
    
    __Raise_User_Error("test");
    
    for ( i = 0; i < MAX_ITER_COUNT; ++i ) __Auto_Release
      {
        YOYO_BIGINT *data_e, *data_x;
        YOYO_BIGINT *p, *e, *m;
        Bigint_Generate_Rsa_Key_Pair(&e,&p,&m,bits);
        data_e = Bigint_Expmod(data,p,m);

>







 







|







1
2
3
4
5
6
7
8
9
..
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28

#define _LIBYOYO
#include "../libyoyo.hc"
#include "../bigint.hc"

enum { MAX_ITER_COUNT = 3 };

int main(int argc, char **argv)
  {
................................................................................
    bits = Str_To_Int(Prog_Argument_Dflt(0,"128"));
    data = Bigint_Expand(0,(bits+sizeof(halflong_t)*8-1)/(sizeof(halflong_t)*8));
    System_Random(data->value,data->digits*sizeof(halflong_t));
    Bigint_Rshift_1(data);
    //data = Bigint_Random(bits-1);
    puts(Bigint_Encode_16(data));
    
    //__Raise_User_Error("test");
    
    for ( i = 0; i < MAX_ITER_COUNT; ++i ) __Auto_Release
      {
        YOYO_BIGINT *data_e, *data_x;
        YOYO_BIGINT *p, *e, *m;
        Bigint_Generate_Rsa_Key_Pair(&e,&p,&m,bits);
        data_e = Bigint_Expmod(data,p,m);

Changes to yoyo.hc.

202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
....
1508
1509
1510
1511
1512
1513
1514


1515
1516
1517
1518
1519
1520
1521
....
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
# define __Yo_FILE__ __FILE__
# define __Yo_Expr__(Expr) #Expr
# define Yo_Raise(Error,Msg,File,Line) _Yo_Raise(Error,Msg,File,Line)
# define Yo_Fatal(Error,Msg,File,Line) _Yo_Fatal(Error,Msg,File,Line)
#else
# define __Yo_FILE__ 0
# define __Yo_Expr__(Expr) 0
# define Yo_Raise(Error,Msg,File,Line) _Yo_Raise(Error,0,0,0)
# define Yo_Fatal(Error,Msg,File,Line) _Yo_Fatal(Error,0,0,0)
#endif

#define YOYO_COMPOSE2(a,b) a##b
#define YOYO_COMPOSE3(a,b,c) a##b##_##c
#define YOYO_ID(Name,Line) YOYO_COMPOSE3(_YoYo_Label_,Name,Line)
#define YOYO_LOCAL_ID(Name) YOYO_ID(Name,__LINE__)

................................................................................

#ifdef _YOYO_CORE_BUILTIN
void _Yo_Raise(int err,char *msg,char *filename,int lineno)
  {
    YOYO_C_SUPPORT_INFO *nfo = Yo_Tls_Get(Yo_Csup_Nfo_Tls);
    STRICT_REQUIRE( !nfo || nfo->jb_top < nfo->jb_count );
    


    if ( err == YO_RERAISE_CURRENT_ERROR && (!nfo || !nfo->err.code) )
      return;
    
    if ( nfo && nfo->jb_top >= 0 && !nfo->stats.unwinding )
      {
        int i; 
        char *old_msg = nfo->err.msg;
................................................................................
#define __Pool_Ptr(Ptr,Free)            Yo_Pool_Ptr(Ptr,Free)
#define __Release(Pooled)               Yo_Release(Pooled)
#define __Retain(Pooled)                Yo_Retain(Pooled)
#define __Purge(TholdPtr)               Yo_Pool_Purge(TholdPtr,YOYO_DEFAULT_PURGE_CAP)
#define __Refe(Ptr)                     Yo_Refe(Ptr)
#define __Unrefe(Ptr)                   Yo_Unrefe(Ptr)
#define __Raise(Err,Msg)                Yo_Raise(Err,Msg,__Yo_FILE__,__LINE__)
#define __Raise_User_Error(Msg)         Yo_Raise(YOYO_ERROR_USER,Msg,__Yo_FILE__,__LINE__)
#define __Raise_Format(Err,Fmt)         Yo_Raise(Err,(Yo_Format Fmt),__Yo_FILE__,__LINE__)
#define __Raise_If_Occured()            Yo_Raise_If_Occured()
#define __Fatal(Ctx)                    Yo_Fatal(YOYO_FATAL_ERROR,Ctx,__Yo_FILE__,__LINE__)
#define __Fatal_Format(x)               Yo_Fatal(YOYO_FATAL_ERROR,Yo_Format_Npl x,__Yo_FILE__,__LINE__)
#define __Format                        Yo_Format
#define __Format_Npl                    Yo_Format_Npl
#define __Format_Error()                Yo_Error_Format()







|
|







 







>
>







 







|







202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
....
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
....
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
# define __Yo_FILE__ __FILE__
# define __Yo_Expr__(Expr) #Expr
# define Yo_Raise(Error,Msg,File,Line) _Yo_Raise(Error,Msg,File,Line)
# define Yo_Fatal(Error,Msg,File,Line) _Yo_Fatal(Error,Msg,File,Line)
#else
# define __Yo_FILE__ 0
# define __Yo_Expr__(Expr) 0
# define Yo_Raise(Error,Msg,File,Line) _Yo_Raise(Error,Msg,0,0)
# define Yo_Fatal(Error,Msg,File,Line) _Yo_Fatal(Error,Msg,0,0)
#endif

#define YOYO_COMPOSE2(a,b) a##b
#define YOYO_COMPOSE3(a,b,c) a##b##_##c
#define YOYO_ID(Name,Line) YOYO_COMPOSE3(_YoYo_Label_,Name,Line)
#define YOYO_LOCAL_ID(Name) YOYO_ID(Name,__LINE__)

................................................................................

#ifdef _YOYO_CORE_BUILTIN
void _Yo_Raise(int err,char *msg,char *filename,int lineno)
  {
    YOYO_C_SUPPORT_INFO *nfo = Yo_Tls_Get(Yo_Csup_Nfo_Tls);
    STRICT_REQUIRE( !nfo || nfo->jb_top < nfo->jb_count );
    
    printf("err: %d, msg: %s, filename: %s, lineno: %d\n",err,msg,filename,lineno);
    
    if ( err == YO_RERAISE_CURRENT_ERROR && (!nfo || !nfo->err.code) )
      return;
    
    if ( nfo && nfo->jb_top >= 0 && !nfo->stats.unwinding )
      {
        int i; 
        char *old_msg = nfo->err.msg;
................................................................................
#define __Pool_Ptr(Ptr,Free)            Yo_Pool_Ptr(Ptr,Free)
#define __Release(Pooled)               Yo_Release(Pooled)
#define __Retain(Pooled)                Yo_Retain(Pooled)
#define __Purge(TholdPtr)               Yo_Pool_Purge(TholdPtr,YOYO_DEFAULT_PURGE_CAP)
#define __Refe(Ptr)                     Yo_Refe(Ptr)
#define __Unrefe(Ptr)                   Yo_Unrefe(Ptr)
#define __Raise(Err,Msg)                Yo_Raise(Err,Msg,__Yo_FILE__,__LINE__)
#define __Raise_User_Error(Msg_)        Yo_Raise(YOYO_ERROR_USER,Msg_,__Yo_FILE__,__LINE__)
#define __Raise_Format(Err,Fmt)         Yo_Raise(Err,(Yo_Format Fmt),__Yo_FILE__,__LINE__)
#define __Raise_If_Occured()            Yo_Raise_If_Occured()
#define __Fatal(Ctx)                    Yo_Fatal(YOYO_FATAL_ERROR,Ctx,__Yo_FILE__,__LINE__)
#define __Fatal_Format(x)               Yo_Fatal(YOYO_FATAL_ERROR,Yo_Format_Npl x,__Yo_FILE__,__LINE__)
#define __Format                        Yo_Format
#define __Format_Npl                    Yo_Format_Npl
#define __Format_Error()                Yo_Error_Format()