CryptoLib icon indicating copy to clipboard operation
CryptoLib copied to clipboard

API Review and Update

Open szemerick opened this issue 3 years ago • 2 comments

High level comments / recommendations to be addressed in review:

  • Take a look and use "const" where possible
  • Should we stick with double pointers? Maybe also provide a single pointer option? Capture why somewhere
  • Should all the currently available extern calls be available or a small subset?
  • Is there a case to take SA_PLAINTEXT and other things defined in crypto_config.h and change them to enums vs #defines?

Function APIs:

  • Crypto_TC_ApplySecurity
    • Should the p_in_frame be a const pointer?
    • What assumptions can be made about the pp_enc_frame double pointer? Is this assumed pre-allocated to maximum length?
  • Crypto_TC_ProcessSecurity
    • Should int* len_ingest actually be a uint16_t?
    • Should TC_t* be used or simply a uint8_t array?
  • Crypto_TM_ApplySecurity
    • Should we be using SecurityAssociation_t* or simply providing the uint8_t array and assuming use of an internally stored active TM SPI?
  • Crypto_TM_ProcessSecurity
    • Should uint16_t len_ingest be a pointer or just passing the actual value across the board for the APIs?

szemerick avatar Sep 12 '22 17:09 szemerick

Take a look and use "const" where possible

jlucas9 avatar Apr 13 '23 19:04 jlucas9

Should we stick with double pointers? Maybe also provide a single pointer option?

jlucas9 avatar Jun 16 '23 18:06 jlucas9