comp.lang.ada
 help / color / mirror / Atom feed
* Type Transcriptions
@ 2014-04-21  7:21 Shark8
  2014-04-21 16:54 ` Brad Moore
  0 siblings, 1 reply; 9+ messages in thread
From: Shark8 @ 2014-04-21  7:21 UTC (permalink / raw)


I recently started a little project intended to implement TLS 1.2 in Ada 
2012 and SPARK; reading through the RFC and transcribing the types has 
been relatively straightforward.

However there is one hiccup; a certain class of record-type is dependent 
on the values in another record, yet distinctly separate; ex:


       struct {
          opaque nonce_explicit[SecurityParameters.record_iv_length];
          aead-ciphered struct {
              opaque content[TLSCompressed.length];
          };
       } GenericAEADCipher;

where SecurityParameters is

       struct {
           ConnectionEnd          entity;
           PRFAlgorithm           prf_algorithm;
           BulkCipherAlgorithm    bulk_cipher_algorithm;
           CipherType             cipher_type;
           uint8                  enc_key_length;
           uint8                  block_length;
           uint8                  fixed_iv_length;
           uint8                  record_iv_length;
           MACAlgorithm           mac_algorithm;
           uint8                  mac_length;
           uint8                  mac_key_length;
           CompressionMethod      compression_algorithm;
           opaque                 master_secret[48];
           opaque                 client_random[32];
           opaque                 server_random[32];
       } SecurityParameters;

Now I've already transcribed the SecurityParameters parameters record, 
but it seems to me that since these other types are dependent on the 
SecurityParameters, I could change it into a generic package with the 
record's current components being input parameters.

Any advice on which route to take would be greatly appreciated.

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2014-04-22  8:57 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-21  7:21 Type Transcriptions Shark8
2014-04-21 16:54 ` Brad Moore
2014-04-21 18:11   ` Yannick Duchêne (Hibou57)
2014-04-21 18:51     ` Shark8
2014-04-21 19:42       ` Jeffrey Carter
2014-04-22  6:06         ` Shark8
2014-04-21 20:33       ` Ludovic Brenta
2014-04-21 22:46         ` Adam Beneschan
2014-04-22  8:57         ` Shark8

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox