From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!news.glorb.com!peer01.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!post01.iad.highwinds-media.com!fx16.iad.POSTED!not-for-mail From: Shark8 User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:31.0) Gecko/20100101 Thunderbird/31.0a1 MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Type Transcriptions Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Message-ID: X-Complaints-To: abuse@teranews.com NNTP-Posting-Date: Mon, 21 Apr 2014 07:21:13 UTC Organization: TeraNews.com Date: Mon, 21 Apr 2014 01:21:13 -0600 X-Received-Bytes: 2333 X-Received-Body-CRC: 2864296769 Xref: news.eternal-september.org comp.lang.ada:19467 Date: 2014-04-21T01:21:13-06:00 List-Id: 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.