comp.lang.ada
 help / color / mirror / Atom feed
From: Shark8 <OneWingedShark@gmail.com>
Subject: Type Transcriptions
Date: Mon, 21 Apr 2014 01:21:13 -0600
Date: 2014-04-21T01:21:13-06:00	[thread overview]
Message-ID: <JF35v.73812$%x6.48858@fx16.iad> (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.

             reply	other threads:[~2014-04-21  7:21 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-21  7:21 Shark8 [this message]
2014-04-21 16:54 ` Type Transcriptions 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
replies disabled

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