<html>
<head>
<title>/vobs/ttcn/TCC_Common/Libraries/TCCUsefulFunctions_CNL113472/src/TCCSecurity.cc - TCCUsefulFunctions</title>
<link rel="stylesheet" type="text/css" href="../styles/main.css">
<script language=JavaScript src="../javascript/main.js"></script></head>
<body class="FramedContentPage" onLoad="NDOnLoad()">
<script language=JavaScript>
<!--
if (browserType) {document.write("<div class=" + browserType + ">");if (browserVer) {document.write("<div class=" + browserVer + ">"); }}// --></script>

<!--  Generated by Natural Docs, version 1.4 -->
<!--  http://www.naturaldocs.org  -->

<!-- saved from url=(0026)http://www.naturaldocs.org -->




<div id=Content>
<div class="CFile">
<div class=CTopic id=MainTopic>
<h1 class=CTitle>
<a name="TCCSecurity.cc"></a>TCCSecurity.cc</h1>
<div class=CBody>
<!--START_ND_SUMMARY-->
<div class=Summary>
<div class=STitle>Summary</div>
<div class=SBorder>
<table border=0 cellspacing=0 cellpadding=0 class=STable>
<tr class="SMain">
<td class=SEntry>
<a href="#TCCSecurity.cc" >TCCSecurity.cc</a></td>
<td class=SDescription></td></tr>
<tr class="SGroup">
<td class=SEntry>
<a href="#Functions" >Functions</a></td>
<td class=SDescription></td></tr>
<tr class="SFunction SIndent1 SMarked">
<td class=SEntry>
<a href="#f__calculateDigestResponse" >f__calculateDigestResponse</a></td>
<td class=SDescription>Calculate digest response</td></tr>
<tr class="SFunction SIndent1">
<td class=SEntry>
<a href="#f__calculateDigestHA1" >f__calculateDigestHA1</a></td>
<td class=SDescription>Calculate digest H(A1) hash</td></tr>
<tr class="SFunction SIndent1 SMarked">
<td class=SEntry>
<a href="#f__TCCSecurity__hex2char" >f__TCCSecurity__hex2char</a></td>
<td class=SDescription>Computes the 8 bit ASCII representation of an hexstring</td></tr>
<tr class="SFunction SIndent1">
<td class=SEntry>
<a href="#f__calculateMD5" >f__calculateMD5</a></td>
<td class=SDescription>Compute MD5 hash value</td></tr>
<tr class="SFunction SIndent1 SMarked">
<td class=SEntry>
<a href="#f__IMSAKA__f1" >f__IMSAKA__f1</a></td>
<td class=SDescription>Computes network authentication code MAC-A from key K, random challenge RAND, sequence number SQN and authentication management field AMF.</td></tr>
<tr class="SFunction SIndent1">
<td class=SEntry>
<a href="#f__IMSAKA__f2" >f__IMSAKA__f2</a></td>
<td class=SDescription>Takes key K and random challenge RAND, and returns response RES.</td></tr>
<tr class="SFunction SIndent1 SMarked">
<td class=SEntry>
<a href="#f__IMSAKA__f3" >f__IMSAKA__f3</a></td>
<td class=SDescription>Takes key K and random challenge RAND, and returns confidentiality key CK.</td></tr>
<tr class="SFunction SIndent1">
<td class=SEntry>
<a href="#f__IMSAKA__f4" >f__IMSAKA__f4</a></td>
<td class=SDescription>Takes key K and random challenge RAND, and returns integrity key IK.</td></tr>
<tr class="SFunction SIndent1 SMarked">
<td class=SEntry>
<a href="#f__IMSAKA__f2345" >f__IMSAKA__f2345</a></td>
<td class=SDescription>Takes key K and random challenge RAND, and returns AK, CK, RES</td></tr>
<tr class="SFunction SIndent1">
<td class=SEntry>
<a href="#f__IMSAKA__f5" >f__IMSAKA__f5</a></td>
<td class=SDescription>Takes key K and random challenge RAND, and returns anonymity key AK.</td></tr>
<tr class="SFunction SIndent1 SMarked">
<td class=SEntry>
<a href="#f__IMSAKA__f1star" >f__IMSAKA__f1star</a></td>
<td class=SDescription>Computes resynch authentication code MAC-S from key K, random challenge RAND, sequence number SQN and authentication management field AMF.</td></tr>
<tr class="SFunction SIndent1">
<td class=SEntry>
<a href="#f__IMSAKA__f5star" >f__IMSAKA__f5star</a></td>
<td class=SDescription>Takes key K and random challenge RAND, and returns resynch anonymity key AK.</td></tr>
<tr class="SFunction SIndent1 SMarked">
<td class=SEntry>
<a href="#f__EAPSIM__A3A8" >f__EAPSIM__A3A8</a></td>
<td class=SDescription>Takes key Ki and random challenge RAND, and returns Kc and SRES keys</td></tr>
<tr class="SFunction SIndent1">
<td class=SEntry>
<a href="#f__IMSAKA__calculateAUTN" >f__IMSAKA__calculateAUTN</a></td>
<td class=SDescription>Computes authentication token AUTN from anonymity key AK, random challenge RAND, sequence number SQN and authentication management field AMF.</td></tr>
<tr class="SFunction SIndent1 SMarked">
<td class=SEntry>
<a href="#f__calculateHMACMD5" >f__calculateHMACMD5</a></td>
<td class=SDescription>Calculate the HMAC MD5 value of a message with specified 64 bit key.</td></tr>
<tr class="SFunction SIndent1">
<td class=SEntry>
<a href="#f__calculate__HMAC__MD5" >f__calculate__HMAC__MD5</a></td>
<td class=SDescription>Calculate the HMAC MD5 value of a message with specified key.</td></tr>
<tr class="SFunction SIndent1 SMarked">
<td class=SEntry>
<a href="#f__calculate__HMAC__SHA1" >f__calculate__HMAC__SHA1</a></td>
<td class=SDescription>Calculate the HMAC SHA1 value of a message with specified key.</td></tr>
<tr class="SFunction SIndent1">
<td class=SEntry>
<a href="#f__calculate128__EEA3" >f__calculate128__EEA3</a></td>
<td class=SDescription>Purpose: Encrypt TTCN-3 message using the confidentiality algorithm 128-EEA3</td></tr>
<tr class="SFunction SIndent1 SMarked">
<td class=SEntry>
<a href="#f__calculate128__EIA3" >f__calculate128__EIA3</a></td>
<td class=SDescription>Purpose: Calculate 32 bit message authentication code (MAC) using integrity algorithm 128-EIA3 for TTCN-3 message</td></tr></table></div></div>
<!--END_ND_SUMMARY--></div></div></div>

<div class="CGroup">
<div class=CTopic>
<h3 class=CTitle>
<a name="Functions"></a>Functions</h3></div></div>

<div class="CFunction">
<div class=CTopic>
<h3 class=CTitle>
<a name="f__calculateDigestResponse"></a>f__calculateDigestResponse</h3>
<div class=CBody>
<h4 class=CHeading>Purpose</h4>
<p>Calculate digest response</p>
<h4 class=CHeading>Parameters</h4>
<table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList>
<tr>
<td class=CDLEntry>nonce</td>
<td class=CDLDescription>
<b>in</b>
<b>charstring</b> -   a server-specified data string which may `                                 be uniquely generated each time a 401 response is made</td></tr>
<tr>
<td class=CDLEntry>cnonce</td>
<td class=CDLDescription>
<b>in</b>
<b>charstring</b> -  client nonce</td></tr>
<tr>
<td class=CDLEntry>user</td>
<td class=CDLDescription>
<b>in</b>
<b>charstring</b> -    user name</td></tr>
<tr>
<td class=CDLEntry>realm</td>
<td class=CDLDescription>
<b>in</b>
<b>charstring</b> -   user realm</td></tr>
<tr>
<td class=CDLEntry>passwd</td>
<td class=CDLDescription>
<b>in</b>
<b>charstring</b> -  user password</td></tr>
<tr>
<td class=CDLEntry>alg</td>
<td class=CDLDescription>
<b>in</b>
<b>charstring</b> -     a string indicating a pair of algorithms used to produce the digest and a checksum</td></tr>
<tr>
<td class=CDLEntry>nonceCount</td>
<td class=CDLDescription>
<b>in</b>
<b>charstring</b> - nonce count (8 hex digits)</td></tr>
<tr>
<td class=CDLEntry>method</td>
<td class=CDLDescription>
<b>in</b>
<b>charstring</b> -  method (from the request)</td></tr>
<tr>
<td class=CDLEntry>qop</td>
<td class=CDLDescription>
<b>in</b>
<b>charstring</b> -     qop-value: &ldquo;&rdquo;, &ldquo;auth&rdquo;, &ldquo;auth-int&rdquo;</td></tr>
<tr>
<td class=CDLEntry>URI</td>
<td class=CDLDescription>
<b>in</b>
<b>charstring</b> -     digest URI</td></tr>
<tr>
<td class=CDLEntry>HEntity</td>
<td class=CDLDescription>
<b>in</b>
<b>charstring</b> - H(entity body) if qop=&rdquo;auth-int&rdquo;</td></tr></table>
<h4 class=CHeading>Return Value</h4>
<table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList>
<tr>
<td class=CDLEntry>charstring</td>
<td class=CDLDescription>digest response</td></tr></table>
<h4 class=CHeading>Errors</h4>
<p>-</p>
<h4 class=CHeading>Detailed description</h4>
<p>Support HTTP authentication (detailed description in RFC 2617) using uses one-way hash (md5) specified in RFC 1321.&nbsp; When a request arrives to server for an access-protected object, it responds an &ldquo;401 Unauthorized&rdquo; status code and a WWW-Authenticate header (encapsulate nonce and other necessary parameters).&nbsp; The client is expected to retry the request, passing an Authorization header with response field calculated with f_calculateDigestResponse().</p>
<p>Overview: <a href="http://en.wikipedia.org/wiki/Digest_access_authentication" class=LURL target=_top>http://en.wikipedia.org<wbr>/wiki<wbr>/Digest_access_authentication</a></p></div></div></div>

<div class="CFunction">
<div class=CTopic>
<h3 class=CTitle>
<a name="f__calculateDigestHA1"></a>f__calculateDigestHA1</h3>
<div class=CBody>
<h4 class=CHeading>Purpose</h4>
<p>Calculate digest H(A1) hash</p>
<h4 class=CHeading>Parameters</h4>
<table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList>
<tr>
<td class=CDLEntry>nonce</td>
<td class=CDLDescription>
<b>in</b>
<b>charstring</b> -   a server-specified data string which may `                                 be uniquely generated each time a 401 response is made</td></tr>
<tr>
<td class=CDLEntry>cnonce</td>
<td class=CDLDescription>
<b>in</b>
<b>charstring</b> -  client nonce</td></tr>
<tr>
<td class=CDLEntry>user</td>
<td class=CDLDescription>
<b>in</b>
<b>charstring</b> -    user name</td></tr>
<tr>
<td class=CDLEntry>realm</td>
<td class=CDLDescription>
<b>in</b>
<b>charstring</b> -   user realm</td></tr>
<tr>
<td class=CDLEntry>passwd</td>
<td class=CDLDescription>
<b>in</b>
<b>charstring</b> -  user password</td></tr>
<tr>
<td class=CDLEntry>alg</td>
<td class=CDLDescription>
<b>in</b>
<b>charstring</b> -     a string indicating a pair of algorithms used to produce the digest and a checksum</td></tr></table>
<h4 class=CHeading>Return Value</h4>
<table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList>
<tr>
<td class=CDLEntry>charstring</td>
<td class=CDLDescription>digest response</td></tr></table>
<h4 class=CHeading>Errors</h4>
<p>-</p>
<h4 class=CHeading>Detailed description</h4>
<p>Overview: <a href="http://en.wikipedia.org/wiki/Digest_access_authentication" class=LURL target=_top>http://en.wikipedia.org<wbr>/wiki<wbr>/Digest_access_authentication</a></p></div></div></div>

<div class="CFunction">
<div class=CTopic>
<h3 class=CTitle>
<a name="f__TCCSecurity__hex2char"></a>f__TCCSecurity__hex2char</h3>
<div class=CBody>
<h4 class=CHeading>Purpose</h4>
<p>Computes the 8 bit ASCII representation of an hexstring</p>
<h4 class=CHeading>Parameters</h4>
<table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList>
<tr>
<td class=CDLEntry>hex</td>
<td class=CDLDescription>
<b>in</b> &lt;char*&gt; -  input value</td></tr>
<tr>
<td class=CDLEntry>str</td>
<td class=CDLDescription>
<b>out</b> &lt;char*&gt; - output value</td></tr></table>
<h4 class=CHeading>Return Value</h4>
<p>-</p>
<h4 class=CHeading>Errors</h4>
<p>-</p>
<h4 class=CHeading>Detailed description</h4>
<p>-</p></div></div></div>

<div class="CFunction">
<div class=CTopic>
<h3 class=CTitle>
<a name="f__calculateMD5"></a>f__calculateMD5</h3>
<div class=CBody>
<h4 class=CHeading>Purpose</h4>
<p>Compute MD5 hash value</p>
<h4 class=CHeading>Parameters</h4>
<table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList>
<tr>
<td class=CDLEntry>pszHashInput</td>
<td class=CDLDescription>
<b>in</b>
<b>charstring</b> -  input value to compute hash of</td></tr></table>
<h4 class=CHeading>Return Value</h4>
<table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList>
<tr>
<td class=CDLEntry>hashValue</td>
<td class=CDLDescription>
<b>out</b>
<b>charstring</b> -  hexa hash value of input</td></tr></table>
<h4 class=CHeading>Errors</h4>
<p>-</p>
<h4 class=CHeading>Detailed description</h4>
<p>-</p></div></div></div>

<div class="CFunction">
<div class=CTopic>
<h3 class=CTitle>
<a name="f__IMSAKA__f1"></a>f__IMSAKA__f1</h3>
<div class=CBody>
<h4 class=CHeading>Purpose</h4>
<p>Computes network authentication code MAC-A from key K, random challenge RAND, sequence number SQN and authentication management field AMF.</p>
<h4 class=CHeading>Parameters</h4>
<table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList>
<tr>
<td class=CDLEntry>pl__OP</td>
<td class=CDLDescription>
<b>in</b>
<b>octetstring</b> - the operator variant algorithm configuration field</td></tr>
<tr>
<td class=CDLEntry>pl__k</td>
<td class=CDLDescription>
<b>in</b>
<b>octetstring</b> -  key</td></tr>
<tr>
<td class=CDLEntry>pl__rand</td>
<td class=CDLDescription>
<b>in</b>
<b>octetstring</b> -  random challenge</td></tr>
<tr>
<td class=CDLEntry>pl__sqn</td>
<td class=CDLDescription>
<b>in</b>
<b>octetstring</b> -  sequence number</td></tr>
<tr>
<td class=CDLEntry>pl__amf</td>
<td class=CDLDescription>
<b>in</b>
<b>octetstring</b> -  authentication management field</td></tr></table>
<h4 class=CHeading>Return Value</h4>
<table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList>
<tr>
<td class=CDLEntry>octetstring</td>
<td class=CDLDescription>network authentication code MAC-A</td></tr></table>
<h4 class=CHeading>Errors</h4>
<p>-</p>
<h4 class=CHeading>Detailed description</h4>
<p>-</p></div></div></div>

<div class="CFunction">
<div class=CTopic>
<h3 class=CTitle>
<a name="f__IMSAKA__f2"></a>f__IMSAKA__f2</h3>
<div class=CBody>
<h4 class=CHeading>Purpose</h4>
<p>Takes key K and random challenge RAND, and returns response RES.</p>
<h4 class=CHeading>Parameters</h4>
<table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList>
<tr>
<td class=CDLEntry>pl__OP</td>
<td class=CDLDescription>
<b>in</b>
<b>octetstring</b> - the operator variant algorithm configuration field</td></tr>
<tr>
<td class=CDLEntry>pl__k</td>
<td class=CDLDescription>
<b>in</b>
<b>octetstring</b> -  key</td></tr>
<tr>
<td class=CDLEntry>pl__rand</td>
<td class=CDLDescription>
<b>in</b>
<b>octetstring</b> -  random challenge</td></tr></table>
<h4 class=CHeading>Return Value</h4>
<table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList>
<tr>
<td class=CDLEntry>octetstring</td>
<td class=CDLDescription>response RES</td></tr></table>
<h4 class=CHeading>Errors</h4>
<p>-</p>
<h4 class=CHeading>Detailed description</h4>
<p>-</p></div></div></div>

<div class="CFunction">
<div class=CTopic>
<h3 class=CTitle>
<a name="f__IMSAKA__f3"></a>f__IMSAKA__f3</h3>
<div class=CBody>
<h4 class=CHeading>Purpose</h4>
<p>Takes key K and random challenge RAND, and returns confidentiality key CK.</p>
<h4 class=CHeading>Parameters</h4>
<table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList>
<tr>
<td class=CDLEntry>pl__OP</td>
<td class=CDLDescription>
<b>in</b>
<b>octetstring</b> - the operator variant algorithm configuration field</td></tr>
<tr>
<td class=CDLEntry>pl__k</td>
<td class=CDLDescription>
<b>in</b>
<b>octetstring</b> -  key</td></tr>
<tr>
<td class=CDLEntry>pl__rand</td>
<td class=CDLDescription>
<b>in</b>
<b>octetstring</b> -  random challenge</td></tr></table>
<h4 class=CHeading>Return Value</h4>
<table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList>
<tr>
<td class=CDLEntry>octetstring</td>
<td class=CDLDescription>confidentiality key CK</td></tr></table>
<h4 class=CHeading>Errors</h4>
<p>-</p>
<h4 class=CHeading>Detailed description</h4>
<p>-</p></div></div></div>

<div class="CFunction">
<div class=CTopic>
<h3 class=CTitle>
<a name="f__IMSAKA__f4"></a>f__IMSAKA__f4</h3>
<div class=CBody>
<h4 class=CHeading>Purpose</h4>
<p>Takes key K and random challenge RAND, and returns integrity key IK.</p>
<h4 class=CHeading>Parameters</h4>
<table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList>
<tr>
<td class=CDLEntry>pl__OP</td>
<td class=CDLDescription>
<b>in</b>
<b>octetstring</b> - the operator variant algorithm configuration field</td></tr>
<tr>
<td class=CDLEntry>pl__k</td>
<td class=CDLDescription>
<b>in</b>
<b>octetstring</b> -  key</td></tr>
<tr>
<td class=CDLEntry>pl__rand</td>
<td class=CDLDescription>
<b>in</b>
<b>octetstring</b> -  random challenge</td></tr></table>
<h4 class=CHeading>Return Value</h4>
<table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList>
<tr>
<td class=CDLEntry>octetstring</td>
<td class=CDLDescription>integrity key IK</td></tr></table>
<h4 class=CHeading>Errors</h4>
<p>-</p>
<h4 class=CHeading>Detailed description</h4>
<p>-</p></div></div></div>

<div class="CFunction">
<div class=CTopic>
<h3 class=CTitle>
<a name="f__IMSAKA__f2345"></a>f__IMSAKA__f2345</h3>
<div class=CBody>
<h4 class=CHeading>Purpose</h4>
<p>Takes key K and random challenge RAND, and returns AK, CK, RES</p>
<h4 class=CHeading>Parameters</h4>
<table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList>
<tr>
<td class=CDLEntry>pl__OP</td>
<td class=CDLDescription>
<b>in</b>
<b>octetstring</b> - the operator variant algorithm configuration field</td></tr>
<tr>
<td class=CDLEntry>pl__k</td>
<td class=CDLDescription>
<b>in</b>
<b>octetstring</b> -  key</td></tr>
<tr>
<td class=CDLEntry>pl__rand</td>
<td class=CDLDescription>
<b>in</b>
<b>octetstring</b> -  random challenge</td></tr></table>
<h4 class=CHeading>Return Value</h4>
<p>TCCSecurity_Keys typed value Errors: -</p>
<h4 class=CHeading>Detailed description</h4>
<p>-</p></div></div></div>

<div class="CFunction">
<div class=CTopic>
<h3 class=CTitle>
<a name="f__IMSAKA__f5"></a>f__IMSAKA__f5</h3>
<div class=CBody>
<h4 class=CHeading>Purpose</h4>
<p>Takes key K and random challenge RAND, and returns anonymity key AK.</p>
<h4 class=CHeading>Parameters</h4>
<table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList>
<tr>
<td class=CDLEntry>pl__OP</td>
<td class=CDLDescription>
<b>in</b>
<b>octetstring</b> - the operator variant algorithm configuration field</td></tr>
<tr>
<td class=CDLEntry>pl__k</td>
<td class=CDLDescription>
<b>in</b>
<b>octetstring</b> -  key</td></tr>
<tr>
<td class=CDLEntry>pl__rand</td>
<td class=CDLDescription>
<b>in</b>
<b>octetstring</b> -  random challenge</td></tr></table>
<h4 class=CHeading>Return Value</h4>
<table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList>
<tr>
<td class=CDLEntry>octetstring</td>
<td class=CDLDescription>anonymity key AK</td></tr></table>
<h4 class=CHeading>Errors</h4>
<p>-</p>
<h4 class=CHeading>Detailed description</h4>
<p>-</p></div></div></div>

<div class="CFunction">
<div class=CTopic>
<h3 class=CTitle>
<a name="f__IMSAKA__f1star"></a>f__IMSAKA__f1star</h3>
<div class=CBody>
<h4 class=CHeading>Purpose</h4>
<p>Computes resynch authentication code MAC-S from key K, random challenge RAND, sequence number SQN and authentication management field AMF.</p>
<h4 class=CHeading>Parameters</h4>
<table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList>
<tr>
<td class=CDLEntry>pl__OP</td>
<td class=CDLDescription>
<b>in</b>
<b>octetstring</b> - the operator variant algorithm configuration field</td></tr>
<tr>
<td class=CDLEntry>pl__k</td>
<td class=CDLDescription>
<b>in</b>
<b>octetstring</b> -  key</td></tr>
<tr>
<td class=CDLEntry>pl__rand</td>
<td class=CDLDescription>
<b>in</b>
<b>octetstring</b> -  random challenge</td></tr>
<tr>
<td class=CDLEntry>pl__sqn</td>
<td class=CDLDescription>
<b>in</b>
<b>octetstring</b> -  sequence number</td></tr>
<tr>
<td class=CDLEntry>pl__amf</td>
<td class=CDLDescription>
<b>in</b>
<b>octetstring</b> -  authentication management field</td></tr></table>
<h4 class=CHeading>Return Value</h4>
<table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList>
<tr>
<td class=CDLEntry>octetstring</td>
<td class=CDLDescription>resynch authentication code MAC-S</td></tr></table>
<h4 class=CHeading>Errors</h4>
<p>-</p>
<h4 class=CHeading>Detailed description</h4>
<p>-</p></div></div></div>

<div class="CFunction">
<div class=CTopic>
<h3 class=CTitle>
<a name="f__IMSAKA__f5star"></a>f__IMSAKA__f5star</h3>
<div class=CBody>
<h4 class=CHeading>Purpose</h4>
<p>Takes key K and random challenge RAND, and returns resynch anonymity key AK.</p>
<h4 class=CHeading>Parameters</h4>
<table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList>
<tr>
<td class=CDLEntry>pl__OP</td>
<td class=CDLDescription>
<b>in</b>
<b>octetstring</b> - the operator variant algorithm configuration field</td></tr>
<tr>
<td class=CDLEntry>pl__k</td>
<td class=CDLDescription>
<b>in</b>
<b>octetstring</b> -  key</td></tr>
<tr>
<td class=CDLEntry>pl__rand</td>
<td class=CDLDescription>
<b>in</b>
<b>octetstring</b> -  random challenge</td></tr></table>
<h4 class=CHeading>Return Value</h4>
<table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList>
<tr>
<td class=CDLEntry>octetstring</td>
<td class=CDLDescription>resynch anonymity key AK</td></tr></table>
<h4 class=CHeading>Errors</h4>
<p>-</p>
<h4 class=CHeading>Detailed description</h4>
<p>-</p></div></div></div>

<div class="CFunction">
<div class=CTopic>
<h3 class=CTitle>
<a name="f__EAPSIM__A3A8"></a>f__EAPSIM__A3A8</h3>
<div class=CBody>
<h4 class=CHeading>Purpose</h4>
<p>Takes key Ki and random challenge RAND, and returns Kc and SRES keys</p>
<h4 class=CHeading>Parameters</h4>
<table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList>
<tr>
<td class=CDLEntry>pl__Ki</td>
<td class=CDLDescription>
<b>in</b>
<b>octetstring</b> - the shared key</td></tr>
<tr>
<td class=CDLEntry>pl__rand</td>
<td class=CDLDescription>
<b>in</b>
<b>octetstring</b> -  random challenge</td></tr>
<tr>
<td class=CDLEntry>pl__sres</td>
<td class=CDLDescription>
<b>out</b>
<b>octetstring</b> -  authentication result param</td></tr>
<tr>
<td class=CDLEntry>pl__Kc</td>
<td class=CDLDescription>
<b>out</b>
<b>octetstring</b> - encryption key</td></tr></table>
<h4 class=CHeading>Return Value</h4>
<p>-</p>
<h4 class=CHeading>Errors</h4>
<p>-</p>
<h4 class=CHeading>Detailed description</h4>
<p>-</p></div></div></div>

<div class="CFunction">
<div class=CTopic>
<h3 class=CTitle>
<a name="f__IMSAKA__calculateAUTN"></a>f__IMSAKA__calculateAUTN</h3>
<div class=CBody>
<h4 class=CHeading>Purpose</h4>
<p>Computes authentication token AUTN from anonymity key AK, random challenge RAND, sequence number SQN and authentication management field AMF.</p>
<h4 class=CHeading>Parameters</h4>
<table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList>
<tr>
<td class=CDLEntry>pl__SQN</td>
<td class=CDLDescription>
<b>in</b>
<b>octetstring</b> - sequence number</td></tr>
<tr>
<td class=CDLEntry>pl__AK</td>
<td class=CDLDescription>
<b>in</b>
<b>octetstring</b> -  anonymity key</td></tr>
<tr>
<td class=CDLEntry>pl__AMF</td>
<td class=CDLDescription>
<b>in</b>
<b>octetstring</b> - authentication management field</td></tr>
<tr>
<td class=CDLEntry>pl__MAC</td>
<td class=CDLDescription>
<b>in</b>
<b>octetstring</b> - encryption key</td></tr></table>
<h4 class=CHeading>Return Value</h4>
<table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList>
<tr>
<td class=CDLEntry>octetstring</td>
<td class=CDLDescription>Authentication token - AUTN</td></tr></table>
<h4 class=CHeading>Errors</h4>
<p>-</p>
<h4 class=CHeading>Detailed description</h4>
<p>-</p></div></div></div>

<div class="CFunction">
<div class=CTopic>
<h3 class=CTitle>
<a name="f__calculateHMACMD5"></a>f__calculateHMACMD5</h3>
<div class=CBody>
<h4 class=CHeading>Purpose</h4>
<p>Calculate the HMAC MD5 value of a message with specified 64 bit key.</p>
<h4 class=CHeading>Parameters</h4>
<table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList>
<tr>
<td class=CDLEntry>msg</td>
<td class=CDLDescription>
<b>in</b>
<b>octetstring</b> - message to be hashed</td></tr>
<tr>
<td class=CDLEntry>key</td>
<td class=CDLDescription>
<b>in</b>
<b>OCT_64</b>      - 64 bit key of the hash function</td></tr></table>
<h4 class=CHeading>Return Value</h4>
<table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList>
<tr>
<td class=CDLEntry>octetstring</td>
<td class=CDLDescription>Hash value (16 octet - 128 bit)</td></tr></table>
<h4 class=CHeading>Errors</h4>
<p>-</p>
<h4 class=CHeading>Detailed description</h4>
<ul>
<li>(should be kept because of backward compatibility reasons)</li>
<li>HMAC() is an openssl specific function, should be found under openssl/hmac.h</li>
<li>key can only be 64 bit (any other case please use f_calculate_HMAC_MD5)</li>
<li>the length of generated hash value can only be 128 bit (any other case please use f_calculate_HMAC_MD5)</li></ul></div></div></div>

<div class="CFunction">
<div class=CTopic>
<h3 class=CTitle>
<a name="f__calculate__HMAC__MD5"></a>f__calculate__HMAC__MD5</h3>
<div class=CBody>
<h4 class=CHeading>Purpose</h4>
<p>Calculate the HMAC MD5 value of a message with specified key.</p>
<h4 class=CHeading>Parameters</h4>
<table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList>
<tr>
<td class=CDLEntry>pl_key</td>
<td class=CDLDescription>
<b>in</b>
<b>octetstring</b>   - key of the hash function</td></tr>
<tr>
<td class=CDLEntry>pl_input</td>
<td class=CDLDescription>
<b>in</b>
<b>octetstring</b> - message to be hashed</td></tr>
<tr>
<td class=CDLEntry>pl_length</td>
<td class=CDLDescription>
<b>in</b>
<b>integer</b>    - length of the output hash value (should be 16 in most of the cases)</td></tr></table>
<h4 class=CHeading>Return Value</h4>
<table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList>
<tr>
<td class=CDLEntry>octetstring</td>
<td class=CDLDescription>Hash value</td></tr></table>
<h4 class=CHeading>Errors</h4>
<p>-</p>
<h4 class=CHeading>Detailed description</h4>
<ul>
<li>HMAC() is an openssl specific function, should be found under openssl/hmac.h</li></ul></div></div></div>

<div class="CFunction">
<div class=CTopic>
<h3 class=CTitle>
<a name="f__calculate__HMAC__SHA1"></a>f__calculate__HMAC__SHA1</h3>
<div class=CBody>
<h4 class=CHeading>Purpose</h4>
<p>Calculate the HMAC SHA1 value of a message with specified key.</p>
<h4 class=CHeading>Parameters</h4>
<table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList>
<tr>
<td class=CDLEntry>pl_key</td>
<td class=CDLDescription>
<b>in</b>
<b>octetstring</b>   - key of the hash function</td></tr>
<tr>
<td class=CDLEntry>pl_input</td>
<td class=CDLDescription>
<b>in</b>
<b>octetstring</b> - message to be hashed</td></tr>
<tr>
<td class=CDLEntry>pl_length</td>
<td class=CDLDescription>
<b>in</b>
<b>integer</b>    - length of the output hash value (should be 16 in most of the cases)</td></tr></table>
<h4 class=CHeading>Return Value</h4>
<table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList>
<tr>
<td class=CDLEntry>octetstring</td>
<td class=CDLDescription>Hash value</td></tr></table>
<h4 class=CHeading>Errors</h4>
<p>-</p>
<h4 class=CHeading>Detailed description</h4>
<ul>
<li>HMAC() is an openssl specific function, should be found under openssl/hmac.h</li></ul></div></div></div>

<div class="CFunction">
<div class=CTopic>
<h3 class=CTitle>
<a name="f__calculate128__EEA3"></a>f__calculate128__EEA3</h3>
<div class=CBody>
<p>Purpose: Encrypt TTCN-3 message using the confidentiality algorithm 128-EEA3</p>
<h4 class=CHeading>Parameters</h4>
<table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList>
<tr>
<td class=CDLEntry>key</td>
<td class=CDLDescription>
<b>in</b>
<b>OCT__16</b>   - confidentiality key</td></tr>
<tr>
<td class=CDLEntry>count</td>
<td class=CDLDescription>
<b>in</b>
<b>OCT__4</b>    - counter</td></tr>
<tr>
<td class=CDLEntry>bearer</td>
<td class=CDLDescription>
<b>in</b>
<b>INT__5</b>    - bearer identity</td></tr>
<tr>
<td class=CDLEntry>direction</td>
<td class=CDLDescription>
<b>in</b>
<b>BIT__1</b>    - direction of transmission</td></tr>
<tr>
<td class=CDLEntry>msg</td>
<td class=CDLDescription>
<b>in</b>
<b>BIT__1__65504</b> - input bit stream (message to be encrypted)</td></tr></table>
<h4 class=CHeading>Return Value</h4>
<table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList>
<tr>
<td class=CDLEntry>BIT__1__65504</td>
<td class=CDLDescription>output bit stream (encrypted message)</td></tr></table>
<h4 class=CHeading>Errors</h4>
<p>-</p>
<h4 class=CHeading>Detailed description</h4>
<p>-</p></div></div></div>

<div class="CFunction">
<div class=CTopic>
<h3 class=CTitle>
<a name="f__calculate128__EIA3"></a>f__calculate128__EIA3</h3>
<div class=CBody>
<p>Purpose: Calculate 32 bit message authentication code (MAC) using integrity algorithm 128-EIA3 for TTCN-3 message</p>
<h4 class=CHeading>Parameters</h4>
<table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList>
<tr>
<td class=CDLEntry>key</td>
<td class=CDLDescription>
<b>in</b>
<b>OCT__16</b>   - integrity key key</td></tr>
<tr>
<td class=CDLEntry>count</td>
<td class=CDLDescription>
<b>in</b>
<b>OCT__4</b>    - counter</td></tr>
<tr>
<td class=CDLEntry>bearer</td>
<td class=CDLDescription>
<b>in</b>
<b>INT__5</b>    - bearer identity</td></tr>
<tr>
<td class=CDLEntry>direction</td>
<td class=CDLDescription>
<b>in</b>
<b>BIT__1</b>    - direction of transmission</td></tr>
<tr>
<td class=CDLEntry>msg</td>
<td class=CDLDescription>
<b>in</b>
<b>BIT__1__65504</b> - input bit stream (the message)</td></tr></table>
<h4 class=CHeading>Return Value</h4>
<table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList>
<tr>
<td class=CDLEntry>BIT__32</td>
<td class=CDLDescription>message authentication code (MAC)</td></tr></table>
<h4 class=CHeading>Errors</h4>
<p>-</p>
<h4 class=CHeading>Detailed description</h4>
<p>-</p></div></div></div>

</div>
<!--Content-->



<!--START_ND_TOOLTIPS-->
<!--END_ND_TOOLTIPS-->

<script language=JavaScript>
<!--
if (browserType) {if (browserVer) {document.write("</div>"); }document.write("</div>");}// --></script></body></html>