btashton opened a new pull request #749:
URL: https://github.com/apache/incubator-nuttx-apps/pull/749


   ## Summary
   This adds the initial support for the libtommath and libtomcrypt libraries.  
These are setting the foundation for being able to run the dropbear ssh 
server/client on NuttX.
   
   ## Impact
   
   ## Testing
   
   Simple crypto test
   ```
   nsh> echo "hello world" > /tmp/pt.txt
   nsh> ltcrypt aes /tmp/pt.txt /tmp/ct.bin
   
   Enter key: nsh> hexdump /tmp/ct.bin
   /tmp/ct.bin at 00000000:
   0000: e3 89 05 22 d7 c1 cb 54 b5 2a b2 40 a9 c1 b6 22 ..."...T.*.@..."
   0010: d9 83 ac 24 09 79 ca 47 db 3c c9 9e             ...$.y.G.<..
   nsh> ltcrypt -d aes /tmp/ct.bin /dev/console
   
   Enter key:
   hello world
   nsh> 
   ```
   
   
   ```
   nsh> tommath_test
   Digit size 64 Bit 
   Size of mp_digit: 8
   Size of mp_word: 16
   MP_DIGIT_BIT: 60
   MP_PREC: 32
   SEED: 0x11a
   
   TEST feature_detection
   
   
   
   TEST trivial_stuff
   
   
   
   TEST mp_get_set_i32
   
   
   
   TEST mp_get_set_i64
   
   
   
   TEST mp_and
   
   
   
   TEST mp_cnt_lsb
   
   
   
   TEST mp_complement
   
   
   
   TEST mp_decr
   
   
   
   TEST mp_div_3
   
        9984
   Passed div_3 testing
   
   TEST mp_dr_reduce
   
   31 digit modulus.... passed
   
   TEST mp_pack_unpack
   
   
   
   TEST mp_fread_fwrite
   
   
   
   TEST mp_get_u32
   
   
   
   TEST mp_get_u64
   
    r = 0x7fffffffffffffff i = 62
   
   TEST mp_get_ul
   
    t = 0x7fffffffffffffff i = 62
   
   TEST mp_log_u32
   
   
   
   TEST mp_incr
   
   
   
   TEST mp_invmod
   
   
   
   TEST mp_is_square
   
      999
   
   
   
   TEST mp_kronecker
   
   
   
   TEST mp_montgomery_reduce
   
    digit size: 1000
   
   
   
   TEST mp_root_u32
   
   
   
   TEST mp_or
   
   
   
   TEST mp_prime_is_prime
   
   Testing mp_prime_is_prime() with Arnault's pseudoprime  803...901 
   
   Testing mp_prime_is_prime() with certified prime 2^1119 + 53
   
   Testing (    safe-prime):       127 bits    
   
   
   
   TEST mp_prime_next_prime
   
   
   
   TEST mp_prime_rand
   
   Testing (not safe-prime):       127 bits    
   
   
   TEST mp_rand
   
   
   
   TEST mp_read_radix
   
    '123456' a == 123456, length = 7
    '-123456' a == -123456, length = 8
    '0' a == 0, length = 2
   
   
   TEST mp_read_write_ubin
   
   mp_to_ubin_size  113
   mp_to_ubin len = 113
   
   
   TEST mp_read_write_sbin
   
   mp_to_sbin_size  114
   mp_to_sbin len = 114
   
   
   TEST mp_reduce_2k
   
     128 bits(1)(2)........
   
   TEST mp_reduce_2k_l
   
   
   
   TEST mp_set_double
   
   
   
   TEST mp_signed_rsh
   
   
   
   TEST mp_sqrt
   
      999
   
   TEST mp_sqrtmod_prime
   
   
   
   TEST mp_xor
   
   
   
   TEST s_mp_balance_mul
   
   
   
   TEST s_mp_karatsuba_mul
   
   
   
   TEST s_mp_karatsuba_sqr
   
   
   
   TEST s_mp_toom_mul
   
   
   
   TEST s_mp_toom_sqr
   
   
   
   Tests OK/NOP/FAIL: 42/0/0
   ```
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to