RSA Working Group Robert W. Baldwin Internet Draft RSA Data Security Expiration Date: December 25, 1999 June 25, 1999 Category: Informational TESTING THE BSAFE CRYPTOGRAPHIC SECURITY COMPONENTS Status of This Memo This document is an Internet-Draft and is in full conformance with all provisions of Section 10 of RFC2026 except that the right to produce derivative works is not granted. Internet-Drafts are working documents of the Internet Engineering Task Force (IETF), its areas, and its working groups. Note that other groups may also distribute working documents as Internet- Drafts. Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress." The list of current Internet-Drafts can be accessed at http://www.ietf.org/1id-abstracts.html. The list of Internet-Draft Shadow Directories can be accessed at http://www.ietf.org/shadow.html. This memo provides information for the Internet community. This memo does not specify an Internet standard of any kind. Distribution of this memo is unlimited. Abstract This Internet-Draft describes how to test the correct operation of a cryptographic module that conforms to the API described in draft- baldwin-bsafe-00.txt. It covers test vectors, functional tests, and error case tests. Performance and stress testing is not included. In each test the expected results are described. Copyright Notice Copyright (C) The Internet Society (1999). All Rights Reserved Baldwin Informational, Expires 12/25/1999 1 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Table of Contents 1. Introduction 2. Understanding the Test Descriptions 3. Security Considerations 4. Reference Section 5. Author's Address 6. Trademark and Patent Issues 7. Copyright Section 8. Test Cases 1 Introduction This Internet-Draft is being distributed to members of the Internet community in order to solicit their reactions to the proposals contained in it. While the issues discussed may not be directly relevant to the research problems of the Internet, they may be interesting to a number of researchers and implementers. This is the companion document for draft-baldwin-bsafe-00.txt. Whereas that document described an application programming interface (API) for a general purpose cryptographic security module, this document describes a collection of test cases to confirm that an implementation of the API is correct. These test cases are not complete, but they form a good basis for accepting the correctness of an implementation. 1.1 Organization The next section presents information to help the reader understand the test case descriptions. Test case descriptions are in the last section of this document. 2 Understanding the Test Descriptions This section provides background information to help understand the test case descriptions. It covers the general concepts that are found in most calls to the API and topics such as memory allocation, and expected values that are specific to the testing system. 2.1 Status and Error Codes All API calls return a status code that is non-zero when an unusual event or error happens. The test cases are described in terms of a symbol called "_Status" that is set to the API return value, and a symbol called "_ExpectedStatus" that is set to the expected return code. The expected value is either set to zero or to one of the Baldwin Informational, Expires 12/25/1999 2 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 error symbols, such as BE_KEY_LEN, that are defined in the API specification. 2.2 The Chooser When an algorithm object is initialized by calling a function such as B_EncryptInit, a list of algorithm methods, called the chooser, is passed to that function. The initialization routine searches the chooser list for low-level functions used to implement the algorithm. For example, the algorithm object for DES-based password encryption, called AI_MD5WithDES_CBCPad, is implemented by methods called AM_DES_ENCRYPT and AM_MD5. The AMs are listed in the chooser. The test descriptions use the symbol "_Chooser" to represent the list of AMs set up for calls to the initialize routines. The list is terminated by the symbol "NULL_PTR", which is a value defined in the API specification. For example, Set "_Chooser" to "AM_MD5", "AM_DES_ENCRYPT", "NULL_PTR". The default Chooser includes all AMs and is called DEMO_ALGORITHM_CHOOSER. It is referenced in the test cases by a phrase such as: Set "_Chooser" to DEMO_ALGORITHM_CHOOSER. 2.3 The Surrender Context Some cryptographic operations can take a long time to complete, so BSAFE includes a mechanism, the surrender context, that allows the user to abort such operations. The surrender context contains a function pointer and a data pointer. During a long operation, the API routine calls the surrender context function and the data pointer is passed to it. If the function returns a non-zero value, the operation aborts. The test cases in this document describe this mechanism in terms of the symbol "_SurrenderContext". Most cases set this symbol to NULL_PTR, which in an acceptable value to pass to the API routines. When the surrender function is being tested, the cases contain a phrase such as: Set "_SurrenderContext" to track calls. This means that "_SurrenderContext" should point to a surrender context structure as defined in the API specification, and the function must track of the number of times it is called. That count is referred to by the phrase: "_counter" for "_SurrenderContext" Baldwin Informational, Expires 12/25/1999 3 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 To simulate a user abort after five calls, a phrase such as the following is used: Set "_counter" for "_SurrenderContext" to decimal value "0". Set "_SurrenderContext" to return error when counter reaches decimal value "5". 2.4 Info Structures When algorithm and key objects are initialized, they can be given parameters that control their behavior. These parameters are passed via "info structures" that are defined in the API specification. For example, when an algorithm of type AI_RC5_CBC is initialized by calling B_SetAlgorithmInfo, a pointer to an info structure is passed that contains the RC5 parameters, such as number of rounds, and word size. The test case descriptions use a phrase such as: info structure for "AI_RC5_CBC" to mean the appropriate structure from the API specification. In this case, it is a structure called A_RC5_CBC_PARAMS. To simplify the test description, the initialization of that structure is described as a list initialization. For example, the follow code fills in structure. Note that the first and fourth parameters are parsed as hexadecimal values, and the others are parsed as decimals. Set "_InfoPointer" to address of info structure for "AI_RC5_CBC" initialized from "10", "12", "32", "8899AABBCCDDEEFF". To check the value of information returned by B_GetAlgorithmInfo and B_GetKeyInfo, the test cases require a way to express the expected value; this is done using the phrase like: expected info structure for "AI_RC5_CBC" Later a statement checks the equality of the two structures. This means that the test environment assumes that there are two copies of each info structure. One is for setting and getting parameters, and the other for holding the expected value for later comparison. When no parameters are passed, the test is described by a sentence like: Set "_InfoPointer" to address of info structure for "AI_MD5" initialized from "NULL_PTR". What this means is that the "_InfoPointer" should be set to NULL_PTR before being passed to the initialization routine. Baldwin Informational, Expires 12/25/1999 4 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 2.5 Loading Buffers from Info Structures Some test cases attempt to manipulate and display information returned by the B_Get*Info API routines as data buffers. This is expressed by a sentence that begins with the word "Load," for example, Load buffer "infoBuf" from info structure for "AI_RC5_CBC". This is equivalent to saying: Set buffer "infoBuf" to hex value "100000000c000000200000008899AABBCCDDEEFF". When the info structure is a pointer to a byte array such as the initialization vector of a CBC cipher, the meaning of a load is straightforward. For complicated structures such as private keys, the resulting buffer is the concatenation of the bytes that make up the fields of the structure. Values that are integers use four bytes, and byte arrays such as public key exponents are copied with the least significant byte first. 2.6 Data Buffers To simplify handling data passed to the API calls, the test cases use the concept of named buffers. Buffer are created with a maximum size, for example: Create buffer "input" of decimal value "100" bytes. Buffers can be initialized from hexadecimal constants or ascii strings as, follows: Set buffer "input" to hex value "6665". Set buffer "input" to string value "BA". For hexadecimal values, pairs of characters become an eight-bit value, which is stored in successive memory locations. It is also possible to initialize one buffer from another, as follows. Set buffer "expected" to contents of buffer "input". These buffers keep track of the number of bytes that are initialized and the number that are free. Normally bytes are appended to output buffers and read from the beginning of input buffers. The special sentence: Finalize buffer "input". Baldwin Informational, Expires 12/25/1999 5 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 means that the number of initialized bytes will be set to zero when it is next used as an output buffer, but until then an operation like: Display buffer "input". will display all the initialized bytes even though the buffer has been finalized. The amount of initialized data in a buffer can be directly manipulated by a sentence like: Set length of buffer "input" to decimal value "10". This changes the initialized length of the buffer without changing the contents, which is particularly convenient for tests that are trying different input sizes. 2.7 Data Append and Extract Buffers can be manipulated by concatenation like: Append buffer "input" with hex value "6768". Sub-ranges of bytes in a buffer can be extracted. For example, the following sentence means that "toBuf" should be set to the first five bytes of "fromBuf". Set buffer "toBuf" to bytes extracted from buffer "fromBuf" starting at offset decimal value "0" extending for decimal value "5" bytes. 2.8 Incrementing and Decrementing Buffers In order to iterate over a range of values, such as key size, the test cases use a phrase such as: Increment buffer "keySize" by decimal value "8". The decimal value is converted to a 16-bit integer that is added to the first two bytes of the value in the buffer "keySize". Buffer values can be converted into integers that are passed as parameters to API calls or as part of the initialization of info structures. The bytes in the buffer are converted to unsigned integers treating them as least significant byte first. Thus, a two byte buffer containing the hexadecimal value "01" becomes the integer one, and "FF01" becomes five hundred and eleven. Baldwin Informational, Expires 12/25/1999 6 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 2.9 The ITEM structure The API specification includes a data structure called "ITEM" that expresses the location and length of an array of bytes. The routines, B_EncodeDigestInfo and B_DecodeDigestInfo, have parameters that are pointers to ITEM structures. This is expressed by the following phrase: address of ITEM describing buffer "digest" The ITEM structure would identify the start of the buffer and the number of initialized bytes. 2.10 Displaying and Checking Results The test case descriptions include expected results using sentences such as: Check equality of "_Status" with "_ExpectedStatus". Check equality of info structure for "infoType" with expected info structure for "infoType". Check equality of buffer "dataObject" with hex value "09aa". The equality checks can be over integer values like "_Status", buffers (expressed as hex or string values or the contents of a named buffer), or info structures. If any check fails the test case does not pass, though it may be worth continuing with the rest of the test case to get more information about the nature of the failure. To help with manual debugging of the test cases, there is often a sentence about displaying a value before checking it against an expected value. If everything is working, these could be ignored, but during testing they may be helpful. The following are examples of such sentences. Display "_counter" for "_SurrenderContext". Display "_Chooser". Display info structure for "infoType". Display buffer "digest". Display buffer "digest" as ascii string. 2.11 Loops Baldwin Informational, Expires 12/25/1999 7 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 To help test a range of parameters for the API calls, the test case descriptions include loops that can be nested. The number of times that a loop is iterated is specified and when the loop is done, it is helpful to display performance data such as execution times. Please refer to the following example: Begin a loop of decimal value "32" iterations. Set "_InfoPointer" to address of info structure for "AI_RSAKeyGen" initialized from contents of buffer "keySize", "010001". Call B_SetAlgorithmInfo passing "generateAlg" and "AI_RSAKeyGen" and "_InfoPointer". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment buffer "keySize" by decimal value "8". End the loop and display execution times. The preceding example tests initializing a key generator algorithm using different key sizes. 2.12 Memory Allocation Errors Several test cases confirm that the implementation behaves reasonably when the platform runs out of memory. Memory is allocated via a user supplied routine called "T_malloc" which returns zero if the allocation succeeded. To simulate memory errors the tests call for that routine to return an error or return its normal value. See the following example. Set "_T_malloc" to return errors. Set "_ExpectedStatus" to "BE_ALLOC". Call B_SetAlgorithmInfo passing "des" and "AI_DES_CBC_IV8" and "1122334455667788". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set "_T_malloc" to return normal. The preceding confirms that one API routine detects and reports memory allocation errors. 3 Security Considerations This document provides test cases that help ensure that an implementation of the cryptographic API described in draft-baldwin- bsafe-00.txt is behaving as expected. The security of applications built on top of that API will depend on its correctness, so testing is very important. In addition good software development practices should be followed such as code review, especially for new code introduced to fix bugs. The test cases are not exhaustive, so they cannot in themselves ensure correctness. Baldwin Informational, Expires 12/25/1999 8 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Other features of a well-written cryptographic module cannot be tested via its API. For example, all sensitive data such as keys should be zeroed as soon as possible to reduce the chances of leaking them inadvertently. Issues like these are beyond the scope of this document. 4 References Consult the following references for a better understanding of the algorithms and processes exercised by the test cases described in this document. draft-baldwin-bsafe-00.txt Baldwin, et al., BSAFE Cryptographic Security Components, May 1999. FIPS PUB 46-1 National Bureau of Standards. FIPS Publication 46-1: Data Encryption Standard, January 1988. FIPS PUB 81 National Bureau of Standards. FIPS Publication 81: DES Modes of Operation, December 1980. FIPS PUB 180-1 National Institute of Standards and Technology. FIPS Publication 180-1: Secure Hash, May 1993. FIPS PUB 186 National Institute of Standards and Technology. FIPS Publication 186: Digital Signature Standard, May 1994. P1363 Draft D1 IEEE. Standard Specifications for Public Key Cryptography, December 1997. RFC 1113 J. Linn. RFC 1113: Privacy Enhancement for Internet Electronic Mail: Part I, Message Encipherment and Authentication Procedures, August 1989. RFC 1319 B. Kaliski. The MD2 Message-Digest Algorithm, April 1992. RFC 1321 R. Rivest. The MD5 Message-Digest Algorithm, April 1992. RFC 1423 Baldwin Informational, Expires 12/25/1999 9 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 D. Balenson. RFC 1423: Privacy Enhancement for Internet Electronic Mail: Part III Algorithms, Modes, and Identifiers, February 1993. X.208 CCITT. Recommendation X.208: Specification of Basic Encoding Rules for Abstract Syntax Notation One (ASN.1), 1988. X.209 CCITT. Recommendation X.209: Specification of Abstract Syntax Notation One (ASN.1), 1988. X.509 CCITT. Recommendation X.509: The Directory Authentication Framework, 1988. X9.31 Draft Digital signatures Using Reversible Public Key Cryptography for the Financial Services Industry. December 1997. X9.44 Draft Key management using reversible public key cryptography for the financial services industry, January 1998. X9.52 Draft Triple Data Encryption Algorithm Modes of Operation, December 1997. X9.57 Draft ANSI. Certificate Management, N5-95, June 15, 1995. X9.62 Draft ANSI. The Elliptic Curve Digital Signature Algorithm (ECDSA), August 29, 1997. X9.63 Draft Public Key Cryptography for the Financial Services Industry: Elliptic Curve Key Agreement and Transport Protocol, December 1997. [NIST91] NIST. Special Publication 500-202: Stable Implementation Agreements for Open Systems Interconnection Protocols. Version 5, Edition 1, Part 1,. December 1991. PKCS Suite The following references are from the RSA Data Security Public-Key Cryptography Standards (PKCS) suite. Baldwin Informational, Expires 12/25/1999 10 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 PKCS documents are available by anonymous FTP from the host ftp.rsa.com in the files pub/pkcs/pkcs*.ps, or by sending electronic mail to pkcs@rsa.com. PKCS 1 RSA Data Security PKCS 1: RSA Encryption Standard, Version 1.5, November 1993. PKCS 3 RSA Data Security PKCS 3: Diffie-Hellman Key Agreement Standard, Version 1.4, November 1993. PKCS 5 RSA Data Security PKCS 5: Password-Based Encryption Standard, Version 1.5, November 1993. PKCS 7 RSA Data Security PKCS 7: Cryptographic Message Syntax Standard, Version 1.5, November 1993. PKCS 8 RSA Data Security PKCS 8: Private-Key Information Syntax Standard, Version 1.2, November 1993. 5 Author Information Robert W. Baldwin Plus Five Consulting, Inc. 990 Amarillo Avenue Palo Alto, CA 94303 Voice: +1 650-852-9675 Fax: +1 650-852-9675 Email: baldwin@plusfive.com, baldwin@lcs.mit.edu 6 Trademarks and Patents RC2, RC4, and RC5 are registered trademarks, and BCERT, BSAFE, MD2, MD4, MD5, PKCS, RC5, RC6, RSA Public Key Cryptosystem, S/MAIL and TIPEM are trademarks of RSA Data Security. The RSA Public Key Cryptosystem@ is protected by U.S. Patent 4,405,829. The RC5@ algorithm is protected by U.S. Patents 5,724,428, and 5,835,600. 7 Copyright Baldwin Informational, Expires 12/25/1999 11 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Copyright The Internet Society June 1999. All Rights Reserved. This document and translations of it may be copied and furnished to others, and derivative works that comment on or otherwise explain it or assist in its implementation may be prepared, copied, published and distributed, in whole or in part, without restriction of any kind, provided that the above copyright notice and this paragraph are included on all such copies and derivative works. However, this document itself may not be modified in any way, such as by removing the copyright notice or references to the Internet Society or other Internet organizations, except as needed for the purpose of developing Internet standards in which case the procedures for copyrights defined in the Internet Standards process must be followed, or as required to translate it into languages other than English. The limited permissions granted above are perpetual and will not be revoked by the Internet Society or its successors or assigns. This document and the information contained herein is provided on an "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNETENGINEERING TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. The IETF takes no position regarding the validity or scope of any intellectual property or other rights that might be claimed to pertain to the implementation or use of the technology described in this document or the extent to which any license under such rights might or might not be available; neither does it represent that it has made any effort to identify any such rights. Information on the IETF's procedures with respect to rights in standards-track and standards-related documentation can be found in BCP-11. Copies of claims of rights mad available for publication and any assurances of licenses to be made available, or the result of an attempt made to obtain a general license or permission for the use of such proprietary rights by implementers or users of this specification can be obtained from the IETF Secretariat. 8 Test Cases There are 179 test case descriptions. Each description begins with a phrase like: This is the start of test case "TVDES00". and ends with the phrase like: This is the end of test case "TVDES00". These phrases can be used to find and separate the cases. Baldwin Informational, Expires 12/25/1999 12 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 This is the start of test case "TV111300". Set "_ExpectedStatus" to zero. Set "_Chooser" to "NULL_PTR". Set "_SurrenderContext" to "NULL_PTR". Note: RFC 1113 vectors test Note: ------------------------------------------------------- Create algorithm object "rfc1113". Call B_CreateAlgorithmObject passing "rfc1113". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Create buffer "inputData" of decimal value "100" bytes. Create buffer "encodedData" of decimal value "100" bytes. Create buffer "decodedData" of decimal value "100" bytes. Create buffer "expectedResult" of decimal value "100" bytes. Note: Initialize, set up expected and input data Set "_InfoPointer" to address of info structure for "AI_RFC1113Recode" initialized from "NULL_PTR". Call B_SetAlgorithmInfo passing "rfc1113" and "AI_RFC1113Recode" and "_InfoPointer". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set buffer "expectedResult" with string value "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+ /". Set buffer "inputData" to hex value "00108310518720928b30d38f411 49351559761969b71d79f8218a39259a7a29aabb2dbafc31cb3d35db7e39ebbf 3dfbf". Call Call B_EncodeInit passing "rfc1113". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_EncodeUpdate passing "rfc1113" and address of next free byte in buffer "encodedData" and address of "_OutputLen" and length of free bytes in buffer "encodedData" and address of first initialized byte in buffer "inputData" and length of initialized bytes in buffer "inputData" Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "encodedData" by "_OutputLen". Call B_EncodeFinal passing "rfc1113" and address of next free byte in buffer "encodedData" and address of "_OutputLen" and Baldwin Informational, Expires 12/25/1999 13 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 length of free bytes in buffer "encodedData" Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "encodedData" by "_OutputLen". Finalize buffer "encodedData". Check equality of buffer "expectedResult" with contents of buffer "encodedData". Call Call B_DecodeInit passing "rfc1113". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_DecodeUpdate passing "rfc1113" and address of next free byte in buffer "decodedData" and address of "_OutputLen" and length of free bytes in buffer "decodedData" and address of first initialized byte in buffer "expectedResult" and length of initialized bytes in buffer "expectedResult" Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "decodedData" by "_OutputLen". Call B_DecodeFinal passing "rfc1113" and address of next free byte in buffer "decodedData" and address of "_OutputLen" and length of free bytes in buffer "decodedData" Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "decodedData" by "_OutputLen". Finalize buffer "decodedData". Check equality of buffer "decodedData" with contents of buffer "inputData". This is the end of test case "TV111300". This is the start of test case "TVDHKA01". Set "_ExpectedStatus" to zero. Set "_Chooser" to "NULL_PTR". Set "_SurrenderContext" to "NULL_PTR". Note: Test Diffie-Hellman Key Agreement using 1024 bit prime Note: A test vector consisting of a fixed prime and a fixed Note: base are Note: passed to both parties to generate 1020 bit private Note: exponents. Note: This information is provided in the form of a BER encoded Note: string. Note: The first party uses AI_MD5Random with a predetermined Baldwin Informational, Expires 12/25/1999 14 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Note: initialization Note: vector to generate its private key. Note: The second party uses AI_MD2Random with it own given Note: initialization vector Note: to generate its private key. Note: Both parties then exchange their public keys to compute Note: the shared Note: secret key. The generated secret keys are compared to Note: each other as well Note: the validated test vector. Note: Summary Note: Given 1024 bit prime and base, and two different Note: initialization vectors, Note: generate key pairs using MD5Random for first party and Note: MD2Random for Note: second party. Compare computed secret key to expected Note: test vector. Note: ------------------------------------------------------- Note: Start with the GlobalInit Set "_Chooser" to "AM_DH_KEY_AGREE", "NULL_PTR". Set "_Chooser" to "AM_MD2_RANDOM", "AM_MD5_RANDOM", "NULL_PTR". Note: Setup data objects Create algorithm object "DHAlgorithmA". Call B_CreateAlgorithmObject passing "DHAlgorithmA". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Create algorithm object "DHAlgorithmB". Call B_CreateAlgorithmObject passing "DHAlgorithmB". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Create buffer "MD5RandIV" of decimal value "200" bytes. Create buffer "MD2RandIV" of decimal value "200" bytes. Create buffer "outputA" of decimal value "500" bytes. Create buffer "outputB" of decimal value "500" bytes. Create buffer "BERString" of decimal value "700" bytes. Create buffer "publicKey1" of decimal value "500" bytes. Create buffer "publicKey2" of decimal value "500" bytes. Create buffer "sharedKey" of decimal value "500" bytes. Note: Input Test Vectors Set buffer "BERString" to hex value "3082011a06092a864886f70d010 3013082010b02818100dbcd42df86e82fb68043278858d367129f6c7bb36c90c 0732104ba84a39609d0e29ea6eb0ea5eb8627e0b158220fc142bb41e7c6043d6 Baldwin Informational, Expires 12/25/1999 15 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 977313265a979fb6704253010a166a94c2f31106bfe2fa0ff1c8a2b6f8bb61ed 59748c5a163df75c13a86922e7a0ee61cb9bd362fd356dcbbdf007f4b05bdce0 266547f884236c0f4130281802a88dee01f73b9d1ebaac980dd63da367413f7e 87eb53d1d676ec33c2aeec8178079e0a90af6e2915f8da4fb2a25473968010f0 2f0fa775fd71eac415f8e243e1ed54b6f594509130a9c1714d64e681660b353f 392a3f17d90a31665a7ddc7e4a33dc24ad0879414e7409213ea7cf841d872508 f387d9e1a3f9b9b124d9ee583020203fc". Set buffer "MD5RandIV" to hex value "23d986c764b8b77a2394f7a32f9 678a2395f8c4768d7c235". Set buffer "MD2RandIV" to hex value "1a9576d61839a56c71b68bb0960 e01f7e6a62d3083e31448a98d03e7". Note: Expected Output Test Vectors Set buffer "publicKey1" to hex value "5ac14c93fe7426b9e354b02756 b430aadc9a219bc37aa477293b0478e8ee96ac619009f3f3b509cb6cf8b3f053 a0362d607acf3c210746f91d62164b1cd16050ba7790129edd96d25da7057fb2 81a29724a4d9efb4a8c80e78ea50fd62fd8f2eb1a3267fcab766c7f33b7ff9aa a6d501b266421644ac8931a5dcd6fb22b56259". Set buffer "publicKey2" to hex value "cb7ce208f7df9e030948ae3b7e 4d3ca8a9b1b8ce7ea6347e52ba7236786a79c481d77d8851bb99ef0af0a8ee85 e1e1c1c85361258e7505f9a972c183086d011649df80b0cbbe017d2b4c509b02 610b8d733e235f86e3552c15eba074108a5b64d620e3e9f9effd93a1eecf56dc 898ed5d60fb78e31d334a033a83c76851d5246". Set buffer "sharedKey" to hex value "d2eade2c91679262c1ded50d9cd bc01a009527df57bad5c7f8349f9214cbe4576fdd8ab4480fef6ab54d32fd88e d1ab5e57fc0e1177632818f99bab51756e9138c403301e369af1be611095a5a5 b5b84e1c89353b300cec8ecd26c7297674b6aa9d9e6eae900d0a33a930ceda95 6541de57a0b7198df4999ba137ecfe5cc6d32". Note: Initialize an AI_MD5Random Algorithm for first party Create algorithm object "randomAlgorithm". Call B_CreateAlgorithmObject passing "randomAlgorithm". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set "_InfoPointer" to address of info structure for "AI_MD5Random" initialized from "NULL_PTR". Call B_SetAlgorithmInfo passing "randomAlgorithm" and "AI_MD5Random" and "_InfoPointer". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call Call B_RandomInit passing "randomAlgorithm" and "_Chooser" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_RandomUpdate passing "randomAlgorithm" and address of Baldwin Informational, Expires 12/25/1999 16 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 first initialized byte in "MD5RandIV" and length of initialized bytes in "MD5RandIV" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Note: Initialize an AI_MD2Random Algorithm for second party Create algorithm object "diffRandomAlgorithm". Call B_CreateAlgorithmObject passing "diffRandomAlgorithm". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set "_InfoPointer" to address of info structure for "AI_MD2Random" initialized from "NULL_PTR". Call B_SetAlgorithmInfo passing "diffRandomAlgorithm" and "AI_MD2Random" and "_InfoPointer". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call Call B_RandomInit passing "diffRandomAlgorithm" and "_Chooser" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_RandomUpdate passing "diffRandomAlgorithm" and address of first initialized byte in "MD2RandIV" and length of initialized bytes in "MD2RandIV" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Note: Setup key generator for first party. Set "_InfoPointer" to address of info structure for "AI_DHKeyAgreeBER" initialized from contents of buffer "BERString". Call B_SetAlgorithmInfo passing "DHAlgorithmA" and "AI_DHKeyAgreeBER" and "_InfoPointer". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Note: echo data from BER encoded string. Set "_InfoPointer" to address of info structure for "AI_DHKeyAgree". Call B_GetAlgorithmInfo passing "_InfoPointer" and "DHAlgorithmA" and "AI_DHKeyAgree". Display info structure for "AI_DHKeyAgree". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Baldwin Informational, Expires 12/25/1999 17 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Set "_ExpectedStatus" to zero. Note: Setup key generator for second party. Set "_InfoPointer" to address of info structure for "AI_DHKeyAgreeBER" initialized from contents of buffer "BERString". Call B_SetAlgorithmInfo passing "DHAlgorithmB" and "AI_DHKeyAgreeBER" and "_InfoPointer". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Note: Generate private and public keys for first party, and Note: test public key Note: against test vector. Call Call B_KeyAgreeInit passing "DHAlgorithmA" and "NULL_PTR" and "_Chooser" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_KeyAgreePhase1 passing "DHAlgorithmA" and address of next free byte in buffer "outputA" and address of "_OutputLen" and length of free bytes in buffer "outputA" and "randomAlgorithm" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "outputA" by "_OutputLen". Check equality of buffer "outputA" with contents of buffer "publicKey1". Note: Generate private and public keys for second party, and Note: test public key Note: against test vector. Call Call B_KeyAgreeInit passing "DHAlgorithmB" and "NULL_PTR" and "_Chooser" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_KeyAgreePhase1 passing "DHAlgorithmB" and address of next free byte in buffer "outputB" and address of "_OutputLen" and length of free bytes in buffer "outputB" and "diffRandomAlgorithm" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "outputB" by "_OutputLen". Check equality of buffer "outputB" with contents of buffer "publicKey2". Baldwin Informational, Expires 12/25/1999 18 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Note: First party is computing shared secret key. Call B_KeyAgreePhase2 passing "DHAlgorithmA" and address of next free byte in buffer "outputA" and address of "_OutputLen" and length of free bytes in buffer "outputA" and address of first initialized byte in buffer "outputB" and length of initialized bytes in buffer "outputB" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "outputA" by "_OutputLen". Note: test if first party has produced the correct shared Note: secret key Check equality of buffer "outputA" with contents of buffer "sharedKey". Note: Second party is computing shared secret key. Call B_KeyAgreePhase2 passing "DHAlgorithmB" and address of next free byte in buffer "outputB" and address of "_OutputLen" and length of free bytes in buffer "outputB" and address of first initialized byte in buffer "publicKey1" and length of initialized bytes in buffer "publicKey1" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "outputB" by "_OutputLen". Note: test if second party has produced the correct shared Note: secret key Note: DataEquals (outputA, @outputB) This is the end of test case "TVDHKA01". This is the start of test case "TVDHKA02". Set "_ExpectedStatus" to zero. Set "_Chooser" to "NULL_PTR". Set "_SurrenderContext" to "NULL_PTR". Note: Test Diffie-Hellman Key Agreement using 256 bit prime Note: A test vector consisting of a fixed prime and a fixed Note: base are Note: passed to both parties to generate 255 bit private Note: exponents. Note: This information is provided in the form of a BER encoded Note: string. Note: Both parties use the same AI_MD2Random stream to generate Note: their Note: private keys. This stream is first initialized with Baldwin Informational, Expires 12/25/1999 19 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Note: default vector, used Note: by the first party and then reused by the second party. Note: Both parties then exchange their public keys in order to Note: compute their shared Note: secret key. The generated secret keys are compared to Note: each other as well Note: the expected test vector. Note: Summary Note: Given 256 bit prime and base, both parties, using a Note: single MD2Random stream, Note: generate key pairs. The computed secret key are compared Note: to an expected Note: test output vector. Note: ------------------------------------------------------- Note: Start with the GlobalInit Set "_Chooser" to "AM_DH_KEY_AGREE", "AM_MD2_RANDOM", "NULL_PTR". Note: Setup data objects Create algorithm object "DHAlgorithmA". Call B_CreateAlgorithmObject passing "DHAlgorithmA". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Create algorithm object "DHAlgorithmB". Call B_CreateAlgorithmObject passing "DHAlgorithmB". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Create buffer "MD2RandIV" of decimal value "100" bytes. Create buffer "outputA" of decimal value "100" bytes. Create buffer "outputB" of decimal value "100" bytes. Create buffer "BERString" of decimal value "400" bytes. Create buffer "publicKey1" of decimal value "100" bytes. Create buffer "publicKey2" of decimal value "100" bytes. Create buffer "sharedKey" of decimal value "100" bytes. Note: Input Test Vectors Set buffer "BERString" to hex value "305606092a864886f70d0103013 049022100e258c44a865a04f557e37d29434d78483e007d1ff291650b88f2673 b37f9d73702200848be4dd9cb89f026f154f4cbf7647e889f5470cc32b203024 4ea155b4f7312020200ff". Set buffer "MD2RandIV" to hex value "". Note: Expected Output Test Vectors Set buffer "publicKey1" to hex value "2256491874c200af37d9a4f143 Baldwin Informational, Expires 12/25/1999 20 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 7b66b9404dfea12d6a4b8ae86cd922b38ea6a6". Set buffer "publicKey2" to hex value "2bd79041f043c06d015c8ea70b 5a0bc63aec6364cffbb1b3fa83bbd14111ba37". Set buffer "sharedKey" to hex value "7517dddd0748b77d6975ddf611e eb0b01839183947be7c1d9216ce41582b907c". Note: Initialize an AI_MD2Random Algorithm Create algorithm object "randomAlgorithm". Call B_CreateAlgorithmObject passing "randomAlgorithm". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set "_InfoPointer" to address of info structure for "AI_MD2Random" initialized from "NULL_PTR". Call B_SetAlgorithmInfo passing "randomAlgorithm" and "AI_MD2Random" and "_InfoPointer". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call Call B_RandomInit passing "randomAlgorithm" and "_Chooser" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_RandomUpdate passing "randomAlgorithm" and address of first initialized byte in "MD2RandIV" and length of initialized bytes in "MD2RandIV" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Note: Setup key generator for first party. Set "_InfoPointer" to address of info structure for "AI_DHKeyAgreeBER" initialized from contents of buffer "BERString". Call B_SetAlgorithmInfo passing "DHAlgorithmA" and "AI_DHKeyAgreeBER" and "_InfoPointer". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Note: echo data from BER encoded string. Set "_InfoPointer" to address of info structure for "AI_DHKeyAgree". Call B_GetAlgorithmInfo passing "_InfoPointer" and "DHAlgorithmA" and "AI_DHKeyAgree". Display info structure for "AI_DHKeyAgree". Baldwin Informational, Expires 12/25/1999 21 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Note: Setup key generator for second party. Set "_InfoPointer" to address of info structure for "AI_DHKeyAgreeBER" initialized from contents of buffer "BERString". Call B_SetAlgorithmInfo passing "DHAlgorithmB" and "AI_DHKeyAgreeBER" and "_InfoPointer". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Note: Generate private and public keys for first party, and Note: test public key Note: against test vector. Call Call B_KeyAgreeInit passing "DHAlgorithmA" and "NULL_PTR" and "_Chooser" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_KeyAgreePhase1 passing "DHAlgorithmA" and address of next free byte in buffer "outputA" and address of "_OutputLen" and length of free bytes in buffer "outputA" and "randomAlgorithm" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "outputA" by "_OutputLen". Check equality of buffer "outputA" with contents of buffer "publicKey1". Note: Generate private and public keys for second party, and Note: test public key Note: against test vector. Call Call B_KeyAgreeInit passing "DHAlgorithmB" and "NULL_PTR" and "_Chooser" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_KeyAgreePhase1 passing "DHAlgorithmB" and address of next free byte in buffer "outputB" and address of "_OutputLen" and length of free bytes in buffer "outputB" and "randomAlgorithm" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "outputB" by "_OutputLen". Check equality of buffer "outputB" with contents of buffer Baldwin Informational, Expires 12/25/1999 22 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 "publicKey2". Note: First party is computing shared secret key. Call B_KeyAgreePhase2 passing "DHAlgorithmA" and address of next free byte in buffer "outputA" and address of "_OutputLen" and length of free bytes in buffer "outputA" and address of first initialized byte in buffer "outputB" and length of initialized bytes in buffer "outputB" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "outputA" by "_OutputLen". Note: test if first party has produced the correct shared Note: secret key Check equality of buffer "outputA" with contents of buffer "sharedKey". Note: Second party is computing shared secret key. Call B_KeyAgreePhase2 passing "DHAlgorithmB" and address of next free byte in buffer "outputB" and address of "_OutputLen" and length of free bytes in buffer "outputB" and address of first initialized byte in buffer "publicKey1" and length of initialized bytes in buffer "publicKey1" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "outputB" by "_OutputLen". Note: test if second party has produced the correct shared Note: secret key Note: DataEquals (outputA, @outputB) This is the end of test case "TVDHKA02". This is the start of test case "TVDHKA03". Set "_ExpectedStatus" to zero. Set "_Chooser" to "NULL_PTR". Set "_SurrenderContext" to "NULL_PTR". Note: Test Diffie-Hellman Key Agreement using 256 bit prime Note: A test vector consisting of a fixed prime and a fixed Note: base are Note: passed to both parties to generate 255 bit private Note: exponents. Note: This information is provided in the form of a BER encoded Note: string. Note: Both parties use the same AI_MD2Random stream to generate Baldwin Informational, Expires 12/25/1999 23 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Note: their Note: private keys. This stream is first initialized with a Note: zero vector, used Note: by the first party and then reused by the second party. Note: Both parties then exchange their public keys in order to Note: compute their shared Note: secret key. The generated secret keys are compared to Note: each other as well Note: the expected test vector. Note: Summary Note: Given 256 bit prime and base, both parties, using a Note: single MD2Random stream Note: generate key pairs. The computed secret key are compared Note: to an expected Note: test output vector. Note: ------------------------------------------------------- Note: Start with the GlobalInit Set "_Chooser" to "AM_DH_KEY_AGREE", "AM_MD2_RANDOM", "NULL_PTR". Note: Setup data objects Create algorithm object "DHAlgorithmA". Call B_CreateAlgorithmObject passing "DHAlgorithmA". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Create algorithm object "DHAlgorithmB". Call B_CreateAlgorithmObject passing "DHAlgorithmB". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Create buffer "MD2RandIV" of decimal value "256" bytes. Create buffer "outputA" of decimal value "500" bytes. Create buffer "outputB" of decimal value "500" bytes. Create buffer "BERString" of decimal value "700" bytes. Create buffer "publicKey1" of decimal value "500" bytes. Create buffer "publicKey2" of decimal value "500" bytes. Create buffer "sharedKey" of decimal value "500" bytes. Note: Input Test Vectors Set buffer "BERString" to hex value "305606092a864886f70d0103013 049022100e258c44a865a04f557e37d29434d78483e007d1ff291650b88f2673 b37f9d73702200848be4dd9cb89f026f154f4cbf7647e889f5470cc32b203024 4ea155b4f7312020200ff". Set buffer "MD2RandIV" to hex value "000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 Baldwin Informational, Expires 12/25/1999 24 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000". Note: Expected Output Test Vectors Set buffer "publicKey1" to hex value "258df51efcb0eb0e91c4faadc1 611c52338a8669fc3968422c086a99007e183b". Set buffer "publicKey2" to hex value "4370b03dc70378a4f758b46e11 2afd6182bd87ac1d958ca10af4232bcc2d4b46". Set buffer "sharedKey" to hex value "52726473d2435e45ee4177da4aa 4dfbbec2fcdb58e8496396b9547cd891e7849". Note: Initialize an AI_MD2Random Algorithm Create algorithm object "randomAlgorithm". Call B_CreateAlgorithmObject passing "randomAlgorithm". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set "_InfoPointer" to address of info structure for "AI_MD2Random" initialized from "NULL_PTR". Call B_SetAlgorithmInfo passing "randomAlgorithm" and "AI_MD2Random" and "_InfoPointer". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call Call B_RandomInit passing "randomAlgorithm" and "_Chooser" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_RandomUpdate passing "randomAlgorithm" and address of first initialized byte in "MD2RandIV" and length of initialized bytes in "MD2RandIV" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Note: Setup key generator for first party. Set "_InfoPointer" to address of info structure for "AI_DHKeyAgreeBER" initialized from contents of buffer "BERString". Call B_SetAlgorithmInfo passing "DHAlgorithmA" and "AI_DHKeyAgreeBER" and "_InfoPointer". Baldwin Informational, Expires 12/25/1999 25 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Note: Echo data from BER encoded string. Set "_InfoPointer" to address of info structure for "AI_DHKeyAgree". Call B_GetAlgorithmInfo passing "_InfoPointer" and "DHAlgorithmA" and "AI_DHKeyAgree". Display info structure for "AI_DHKeyAgree". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Note: Setup key generator for second party. Set "_InfoPointer" to address of info structure for "AI_DHKeyAgreeBER" initialized from contents of buffer "BERString". Call B_SetAlgorithmInfo passing "DHAlgorithmB" and "AI_DHKeyAgreeBER" and "_InfoPointer". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Note: Generate private and public keys for first party, and Note: test public key Note: against test vector. Call Call B_KeyAgreeInit passing "DHAlgorithmA" and "NULL_PTR" and "_Chooser" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_KeyAgreePhase1 passing "DHAlgorithmA" and address of next free byte in buffer "outputA" and address of "_OutputLen" and length of free bytes in buffer "outputA" and "randomAlgorithm" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "outputA" by "_OutputLen". Check equality of buffer "outputA" with contents of buffer "publicKey1". Note: Generate private and public keys for second party, and Note: test public key Note: against test vector. Call Call B_KeyAgreeInit passing "DHAlgorithmB" and "NULL_PTR" and "_Chooser" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Baldwin Informational, Expires 12/25/1999 26 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Set "_ExpectedStatus" to zero. Call B_KeyAgreePhase1 passing "DHAlgorithmB" and address of next free byte in buffer "outputB" and address of "_OutputLen" and length of free bytes in buffer "outputB" and "randomAlgorithm" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "outputB" by "_OutputLen". Check equality of buffer "outputB" with contents of buffer "publicKey2". Note: First party is computing shared secret key. Call B_KeyAgreePhase2 passing "DHAlgorithmA" and address of next free byte in buffer "outputA" and address of "_OutputLen" and length of free bytes in buffer "outputA" and address of first initialized byte in buffer "outputB" and length of initialized bytes in buffer "outputB" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "outputA" by "_OutputLen". Note: test if first party has produced the correct shared Note: secret key Check equality of buffer "outputA" with contents of buffer "sharedKey". Note: Second party is computing shared secret key. Call B_KeyAgreePhase2 passing "DHAlgorithmB" and address of next free byte in buffer "outputB" and address of "_OutputLen" and length of free bytes in buffer "outputB" and address of first initialized byte in buffer "publicKey1" and length of initialized bytes in buffer "publicKey1" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "outputB" by "_OutputLen". Note: test if second party has produced the correct shared Note: secret key Note: DataEquals (outputA, @outputB) This is the end of test case "TVDHKA03". This is the start of test case "TVDHKA04". Set "_ExpectedStatus" to zero. Set "_Chooser" to "NULL_PTR". Set "_SurrenderContext" to "NULL_PTR". Baldwin Informational, Expires 12/25/1999 27 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Note: Test Diffie-Hellman Key Agreement using 256 bit prime Note: A test vector consisting of a fixed prime and a fixed Note: base are Note: passed to both parties to generate 255 bit private Note: exponents. Note: This information is provided in the form of a BER encoded Note: string. Note: Both parties use the same AI_MD2Random object to generate Note: their Note: private keys. This object is first initialized with a Note: given vector, used Note: by the first party and then reused by the second party. Note: Both parties then exchange their public keys to compute Note: their shared Note: secret key. The generated secret keys are compared to Note: each other as well Note: the expected test vector. Note: Summary Note: Given 256 bit prime and base, both parties, using a Note: single MD2Random stream Note: generate key pairs. The computed secret key are compared Note: to an expected Note: test output vector. Note: ------------------------------------------------------- Note: Start with the GlobalInit Set "_Chooser" to "AM_DH_KEY_AGREE", "AM_MD2_RANDOM", "NULL_PTR". Note: Setup data objects Create algorithm object "DHAlgorithmA". Call B_CreateAlgorithmObject passing "DHAlgorithmA". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Create algorithm object "DHAlgorithmB". Call B_CreateAlgorithmObject passing "DHAlgorithmB". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Create buffer "MD2RandIV" of decimal value "100" bytes. Create buffer "outputA" of decimal value "100" bytes. Create buffer "outputB" of decimal value "100" bytes. Create buffer "BERString" of decimal value "400" bytes. Create buffer "publicKey1" of decimal value "100" bytes. Create buffer "publicKey2" of decimal value "100" bytes. Baldwin Informational, Expires 12/25/1999 28 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Create buffer "sharedKey" of decimal value "100" bytes. Note: Input Test Vectors Set buffer "BERString" to hex value "305606092a864886f70d0103013 049022100e258c44a865a04f557e37d29434d78483e007d1ff291650b88f2673 b37f9d73702200848be4dd9cb89f026f154f4cbf7647e889f5470cc32b203024 4ea155b4f7312020200ff". Set buffer "MD2RandIV" to hex value "1111111111111111". Note: Expected Output Test Vectors Set buffer "publicKey1" to hex value "5b8b3dbadf868513443a77e26e 78611ed94bdbde5a8dda55fd80b6ee9fd65b62". Set buffer "publicKey2" to hex value "0704b308d65333b4c8374036a2 192a6c340b73a05b7766b605944c922f599e25". Set buffer "sharedKey" to hex value "77fa3337e3ea610b61a2d4d9fd3 b75e406dae13a089f684f628f2a1e7ee2b2d6". Note: Initialize an AI_MD2Random Algorithm Create algorithm object "randomAlgorithm". Call B_CreateAlgorithmObject passing "randomAlgorithm". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set "_InfoPointer" to address of info structure for "AI_MD2Random" initialized from "NULL_PTR". Call B_SetAlgorithmInfo passing "randomAlgorithm" and "AI_MD2Random" and "_InfoPointer". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call Call B_RandomInit passing "randomAlgorithm" and "_Chooser" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_RandomUpdate passing "randomAlgorithm" and address of first initialized byte in "MD2RandIV" and length of initialized bytes in "MD2RandIV" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Note: Setup key generator for first party. Set "_InfoPointer" to address of info structure for "AI_DHKeyAgreeBER" initialized from contents of buffer "BERString". Baldwin Informational, Expires 12/25/1999 29 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Call B_SetAlgorithmInfo passing "DHAlgorithmA" and "AI_DHKeyAgreeBER" and "_InfoPointer". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Note: Echo data from BER encoded string. Set "_InfoPointer" to address of info structure for "AI_DHKeyAgree". Call B_GetAlgorithmInfo passing "_InfoPointer" and "DHAlgorithmA" and "AI_DHKeyAgree". Display info structure for "AI_DHKeyAgree". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Note: Setup key generator for second party. Set "_InfoPointer" to address of info structure for "AI_DHKeyAgreeBER" initialized from contents of buffer "BERString". Call B_SetAlgorithmInfo passing "DHAlgorithmB" and "AI_DHKeyAgreeBER" and "_InfoPointer". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Note: Generate private and public keys for first party, and Note: test public key Note: against test vector. Call Call B_KeyAgreeInit passing "DHAlgorithmA" and "NULL_PTR" and "_Chooser" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_KeyAgreePhase1 passing "DHAlgorithmA" and address of next free byte in buffer "outputA" and address of "_OutputLen" and length of free bytes in buffer "outputA" and "randomAlgorithm" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "outputA" by "_OutputLen". Check equality of buffer "outputA" with contents of buffer "publicKey1". Note: Generate private and public keys for second party, and Note: test public key Note: against test vector. Call Call B_KeyAgreeInit passing "DHAlgorithmB" and "NULL_PTR" Baldwin Informational, Expires 12/25/1999 30 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 and "_Chooser" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_KeyAgreePhase1 passing "DHAlgorithmB" and address of next free byte in buffer "outputB" and address of "_OutputLen" and length of free bytes in buffer "outputB" and "randomAlgorithm" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "outputB" by "_OutputLen". Check equality of buffer "outputB" with contents of buffer "publicKey2". Note: First party is computing shared secret key. Call B_KeyAgreePhase2 passing "DHAlgorithmA" and address of next free byte in buffer "outputA" and address of "_OutputLen" and length of free bytes in buffer "outputA" and address of first initialized byte in buffer "outputB" and length of initialized bytes in buffer "outputB" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "outputA" by "_OutputLen". Note: test if first party has produced the correct shared Note: secret key Check equality of buffer "outputA" with contents of buffer "sharedKey". Note: Second party is computing shared secret key. Call B_KeyAgreePhase2 passing "DHAlgorithmB" and address of next free byte in buffer "outputB" and address of "_OutputLen" and length of free bytes in buffer "outputB" and address of first initialized byte in buffer "publicKey1" and length of initialized bytes in buffer "publicKey1" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "outputB" by "_OutputLen". Note: test if second party has produced the correct shared Note: secret key Note: DataEquals (outputA, @outputB) This is the end of test case "TVDHKA04". This is the start of test case "TVDHKA05". Set "_ExpectedStatus" to zero. Baldwin Informational, Expires 12/25/1999 31 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Set "_Chooser" to "NULL_PTR". Set "_SurrenderContext" to "NULL_PTR". Note: Test Diffie-Hellman Key Agreement using 256 bit prime Note: A test vector consisting of a fixed prime and a fixed Note: base are Note: passed to both parties to generate 255 bit private Note: exponents. Note: This information is provided in the form of a BER encoded Note: string. Note: The first party uses AI_MD2Random with a given Note: initialization Note: vector to generate its private key. The second party uses Note: AI_MD5Random Note: with a given initialization vector to generate its Note: private key. Note: Both parties then exchange their public keys in order to Note: compute their shared Note: secret key. The generated secret keys are compared to Note: each other as well Note: the expected test vector. Note: Summary Note: Given 256 bit prime and base, and two different Note: initialization vectors, Note: generate key pairs using MD2Random for first party and Note: MD5Random for Note: second party. Compare computed secret key to expected Note: test vector. Note: ------------------------------------------------------- Note: Start with the GlobalInit Set "_Chooser" to "AM_DH_KEY_AGREE", "AM_MD2_RANDOM", "AM_MD5_RANDOM", "NULL_PTR". Note: Setup data objects Create algorithm object "DHAlgorithmA". Call B_CreateAlgorithmObject passing "DHAlgorithmA". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Create algorithm object "DHAlgorithmB". Call B_CreateAlgorithmObject passing "DHAlgorithmB". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Create buffer "MD5RandIV" of decimal value "200" bytes. Baldwin Informational, Expires 12/25/1999 32 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Create buffer "MD2RandIV" of decimal value "200" bytes. Create buffer "outputA" of decimal value "100" bytes. Create buffer "outputB" of decimal value "100" bytes. Create buffer "BERString" of decimal value "400" bytes. Create buffer "publicKey1" of decimal value "100" bytes. Create buffer "publicKey2" of decimal value "100" bytes. Create buffer "sharedKey" of decimal value "100" bytes. Note: Input Test Vectors Set buffer "BERString" to hex value "305606092a864886f70d0103013 049022100e258c44a865a04f557e37d29434d78483e007d1ff291650b88f2673 b37f9d73702200848be4dd9cb89f026f154f4cbf7647e889f5470cc32b203024 4ea155b4f7312020200ff". Set buffer "MD2RandIV" to hex value "1111111111111111". Set buffer "MD5RandIV" to hex value "2222222222222222". Note: Expected Output Test Vectors Set buffer "publicKey1" to hex value "5b8b3dbadf868513443a77e26e 78611ed94bdbde5a8dda55fd80b6ee9fd65b62". Set buffer "publicKey2" to hex value "54f1f6c5701e4301e806252fa2 1ad748b65e625fd763017b60ff560e32e9aa83". Set buffer "sharedKey" to hex value "1073ea0d67069431757a09c202a d224372b41d5eb38b07f436dd2b0228e8add4". Note: Initialize an AI_MD2Random Algorithm for first party Create algorithm object "randomAlgorithm". Call B_CreateAlgorithmObject passing "randomAlgorithm". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set "_InfoPointer" to address of info structure for "AI_MD2Random" initialized from "NULL_PTR". Call B_SetAlgorithmInfo passing "randomAlgorithm" and "AI_MD2Random" and "_InfoPointer". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call Call B_RandomInit passing "randomAlgorithm" and "_Chooser" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_RandomUpdate passing "randomAlgorithm" and address of first initialized byte in "MD2RandIV" and length of initialized bytes in "MD2RandIV" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Baldwin Informational, Expires 12/25/1999 33 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Note: Initialize an AI_MD5Random Algorithm for second party Create algorithm object "diffRandomAlgorithm". Call B_CreateAlgorithmObject passing "diffRandomAlgorithm". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set "_InfoPointer" to address of info structure for "AI_MD5Random" initialized from "NULL_PTR". Call B_SetAlgorithmInfo passing "diffRandomAlgorithm" and "AI_MD5Random" and "_InfoPointer". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call Call B_RandomInit passing "diffRandomAlgorithm" and "_Chooser" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_RandomUpdate passing "diffRandomAlgorithm" and address of first initialized byte in "MD5RandIV" and length of initialized bytes in "MD5RandIV" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Note: Setup key generator for first party. Set "_InfoPointer" to address of info structure for "AI_DHKeyAgreeBER" initialized from contents of buffer "BERString". Call B_SetAlgorithmInfo passing "DHAlgorithmA" and "AI_DHKeyAgreeBER" and "_InfoPointer". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Note: Echo data from BER encoded string. Set "_InfoPointer" to address of info structure for "AI_DHKeyAgree". Call B_GetAlgorithmInfo passing "_InfoPointer" and "DHAlgorithmA" and "AI_DHKeyAgree". Display info structure for "AI_DHKeyAgree". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Note: Setup key generator for second party. Set "_InfoPointer" to address of info structure for "AI_DHKeyAgreeBER" initialized from contents of buffer Baldwin Informational, Expires 12/25/1999 34 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 "BERString". Call B_SetAlgorithmInfo passing "DHAlgorithmB" and "AI_DHKeyAgreeBER" and "_InfoPointer". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Note: Generate private and public keys for first party, and Note: test public key Note: against test vector. Call Call B_KeyAgreeInit passing "DHAlgorithmA" and "NULL_PTR" and "_Chooser" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_KeyAgreePhase1 passing "DHAlgorithmA" and address of next free byte in buffer "outputA" and address of "_OutputLen" and length of free bytes in buffer "outputA" and "randomAlgorithm" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "outputA" by "_OutputLen". Check equality of buffer "outputA" with contents of buffer "publicKey1". Note: Generate private and public keys for second party, and Note: test public key Note: against test vector. Call Call B_KeyAgreeInit passing "DHAlgorithmB" and "NULL_PTR" and "_Chooser" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_KeyAgreePhase1 passing "DHAlgorithmB" and address of next free byte in buffer "outputB" and address of "_OutputLen" and length of free bytes in buffer "outputB" and "diffRandomAlgorithm" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "outputB" by "_OutputLen". Check equality of buffer "outputB" with contents of buffer "publicKey2". Note: First party is computing shared secret key. Call B_KeyAgreePhase2 passing "DHAlgorithmA" and address of next free byte in buffer "outputA" and address of "_OutputLen" and length of free bytes in buffer "outputA" and address of first initialized byte in buffer "outputB" and length of initialized bytes in buffer "outputB" and "_SurrenderContext". Baldwin Informational, Expires 12/25/1999 35 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "outputA" by "_OutputLen". Note: test if first party has produced the correct shared Note: secret key Check equality of buffer "outputA" with contents of buffer "sharedKey". Note: Second party is computing shared secret key. Call B_KeyAgreePhase2 passing "DHAlgorithmB" and address of next free byte in buffer "outputB" and address of "_OutputLen" and length of free bytes in buffer "outputB" and address of first initialized byte in buffer "publicKey1" and length of initialized bytes in buffer "publicKey1" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "outputB" by "_OutputLen". Note: test if second party has produced the correct shared Note: secret key Note: DataEquals (outputA, @outputB) This is the end of test case "TVDHKA05". This is the start of test case "TVDHKA06". Set "_ExpectedStatus" to zero. Set "_Chooser" to "NULL_PTR". Set "_SurrenderContext" to "NULL_PTR". Note: Test Diffie-Hellman Key Agreement using 256 bit prime Note: A test vector consisting of a fixed prime and a fixed Note: base are Note: passed to both parties to generate 250 bit private Note: exponents. Note: This information is provided in the form of a BER encoded Note: string. Using Note: distinct AI_MD5Random streams, each party generates its Note: own private key. Note: Both parties then exchange their public keys in order to Note: compute their shared Note: secret key. The generated secret keys are compared to Note: each other as well Note: the expected test vector. Note: Summary Baldwin Informational, Expires 12/25/1999 36 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Note: Given 256 bit prime and base, and two different Note: initialization vectors, Note: generate key pairs using MD5Random for both parties. Note: Compare computed secret key to expected test vector. Note: ------------------------------------------------------- Note: Start with the GlobalInit Set "_Chooser" to "AM_DH_KEY_AGREE", "AM_MD5_RANDOM", "NULL_PTR". Note: Setup data objects Create algorithm object "DHAlgorithmA". Call B_CreateAlgorithmObject passing "DHAlgorithmA". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Create algorithm object "DHAlgorithmB". Call B_CreateAlgorithmObject passing "DHAlgorithmB". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Create buffer "MD5RandIV1" of decimal value "200" bytes. Create buffer "MD5RandIV2" of decimal value "200" bytes. Create buffer "outputA" of decimal value "100" bytes. Create buffer "outputB" of decimal value "100" bytes. Create buffer "BERString" of decimal value "400" bytes. Create buffer "publicKey1" of decimal value "100" bytes. Create buffer "publicKey2" of decimal value "100" bytes. Create buffer "sharedKey" of decimal value "100" bytes. Note: Input Test Vectors Set buffer "BERString" to hex value "305706092a864886f70d0103013 04a022100fb3c81d44a514f036074162330e5930dfb8bc1362b340f79f10a56b dc9e0cb9f0221008b2075349fef00f168614cf5c50d3268ff3c939824ad85c2a 8237f196ba889c3020200fa". Set buffer "MD5RandIV1" to hex value "1415161718191a1b868788898a 8b8c8d". Set buffer "MD5RandIV2" to hex value "1c1d1e1f202122238e8f909192 939495". Note: Expected Output Test Vectors Set buffer "publicKey1" to hex value "c37aa9bfca38ef8c393afa8694 144198b8c315abfbb8c4f8fdff2305ffc39ee0". Set buffer "publicKey2" to hex value "6fb23248ecd17e729d45ea7cb5 e18f3e629d3cabde0730376b6686e5f9cac2f8". Baldwin Informational, Expires 12/25/1999 37 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Set buffer "sharedKey" to hex value "e67b0aa166e697339d2ab922242 c9c71b3524943673d9a59fffeb6be337c409b". Note: Initialize an AI_MD5Random Algorithm for first party Create algorithm object "randomAlgorithm". Call B_CreateAlgorithmObject passing "randomAlgorithm". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set "_InfoPointer" to address of info structure for "AI_MD5Random" initialized from "NULL_PTR". Call B_SetAlgorithmInfo passing "randomAlgorithm" and "AI_MD5Random" and "_InfoPointer". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call Call B_RandomInit passing "randomAlgorithm" and "_Chooser" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_RandomUpdate passing "randomAlgorithm" and address of first initialized byte in "MD5RandIV1" and length of initialized bytes in "MD5RandIV1" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Note: Initialize an AI_MD5Random Algorithm for second party Create algorithm object "diffRandomAlgorithm". Call B_CreateAlgorithmObject passing "diffRandomAlgorithm". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set "_InfoPointer" to address of info structure for "AI_MD5Random" initialized from "NULL_PTR". Call B_SetAlgorithmInfo passing "diffRandomAlgorithm" and "AI_MD5Random" and "_InfoPointer". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call Call B_RandomInit passing "diffRandomAlgorithm" and "_Chooser" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_RandomUpdate passing "diffRandomAlgorithm" and address of first initialized byte in "MD5RandIV2" and length of initialized bytes in "MD5RandIV2" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Baldwin Informational, Expires 12/25/1999 38 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Set "_ExpectedStatus" to zero. Note: Setup key generator for first party. Set "_InfoPointer" to address of info structure for "AI_DHKeyAgreeBER" initialized from contents of buffer "BERString". Call B_SetAlgorithmInfo passing "DHAlgorithmA" and "AI_DHKeyAgreeBER" and "_InfoPointer". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Note: Echo data from BER encoded string. Set "_InfoPointer" to address of info structure for "AI_DHKeyAgree". Call B_GetAlgorithmInfo passing "_InfoPointer" and "DHAlgorithmA" and "AI_DHKeyAgree". Display info structure for "AI_DHKeyAgree". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Note: Setup key generator for second party. Set "_InfoPointer" to address of info structure for "AI_DHKeyAgreeBER" initialized from contents of buffer "BERString". Call B_SetAlgorithmInfo passing "DHAlgorithmB" and "AI_DHKeyAgreeBER" and "_InfoPointer". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Note: Generate private and public keys for first party, and Note: test public key Note: against test vector. Call Call B_KeyAgreeInit passing "DHAlgorithmA" and "NULL_PTR" and "_Chooser" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_KeyAgreePhase1 passing "DHAlgorithmA" and address of next free byte in buffer "outputA" and address of "_OutputLen" and length of free bytes in buffer "outputA" and "randomAlgorithm" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "outputA" by "_OutputLen". Baldwin Informational, Expires 12/25/1999 39 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Check equality of buffer "outputA" with contents of buffer "publicKey1". Note: Generate private and public keys for second party, and Note: test public key Note: against test vector. Call Call B_KeyAgreeInit passing "DHAlgorithmB" and "NULL_PTR" and "_Chooser" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_KeyAgreePhase1 passing "DHAlgorithmB" and address of next free byte in buffer "outputB" and address of "_OutputLen" and length of free bytes in buffer "outputB" and "diffRandomAlgorithm" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "outputB" by "_OutputLen". Check equality of buffer "outputB" with contents of buffer "publicKey2". Note: First party is computing shared secret key. Call B_KeyAgreePhase2 passing "DHAlgorithmA" and address of next free byte in buffer "outputA" and address of "_OutputLen" and length of free bytes in buffer "outputA" and address of first initialized byte in buffer "outputB" and length of initialized bytes in buffer "outputB" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "outputA" by "_OutputLen". Note: test if first party has produced the correct shared Note: secret key Check equality of buffer "outputA" with contents of buffer "sharedKey". Note: Second party is computing shared secret key. Call B_KeyAgreePhase2 passing "DHAlgorithmB" and address of next free byte in buffer "outputB" and address of "_OutputLen" and length of free bytes in buffer "outputB" and address of first initialized byte in buffer "publicKey1" and length of initialized bytes in buffer "publicKey1" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "outputB" by "_OutputLen". Note: test if second party has produced the correct shared Baldwin Informational, Expires 12/25/1999 40 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Note: secret key Note: DataEquals (outputA, @outputB) This is the end of test case "TVDHKA06". This is the start of test case "TVDHKA07". Set "_ExpectedStatus" to zero. Set "_Chooser" to "NULL_PTR". Set "_SurrenderContext" to "NULL_PTR". Note: Test Diffie-Hellman Key Agreement using 256 bit prime Note: A test vector consisting of a fixed prime and a fixed Note: base are Note: passed to both parties to generate 246 bit private Note: exponents. Note: This information is provided in the form of a BER encoded Note: string. Note: The first party uses AI_MD5Random with a given Note: initialization vector to Note: generate its private key. The second party uses Note: AI_MD2Random with a Note: given initialization vector to generate its private key. Note: Both parties then exchange their public keys in order to Note: compute their shared Note: secret key. The generated secret keys are compared to Note: each other as well Note: the expected test vector. Note: Summary Note: Given 256 bit prime and base, and two different Note: initialization vectors, Note: generate key pairs using distinct MD5Random streams for Note: each party. Note: Compare computed secret key to expected test vector. Note: ------------------------------------------------------- Note: Start with the GlobalInit Set "_Chooser" to "AM_DH_KEY_AGREE", "AM_MD2_RANDOM", "AM_MD5_RANDOM", "NULL_PTR". Note: Setup data objects Create algorithm object "DHAlgorithmA". Call B_CreateAlgorithmObject passing "DHAlgorithmA". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Baldwin Informational, Expires 12/25/1999 41 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Create algorithm object "DHAlgorithmB". Call B_CreateAlgorithmObject passing "DHAlgorithmB". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Create buffer "MD2RandIV" of decimal value "200" bytes. Create buffer "MD5RandIV" of decimal value "200" bytes. Create buffer "outputA" of decimal value "100" bytes. Create buffer "outputB" of decimal value "100" bytes. Create buffer "BERString" of decimal value "400" bytes. Create buffer "publicKey1" of decimal value "100" bytes. Create buffer "publicKey2" of decimal value "100" bytes. Create buffer "sharedKey" of decimal value "100" bytes. Note: Input Test Vectors Set buffer "BERString" to hex value "305606092a864886f70d0103013 049022100e7a16d36abadc1d0a635ede9b09409dafd40833bed2de7df617fce4 0424de9b90220043ddbaf7de9d0b663b9c726599362332123aa3f3056eca33cb ebc5602f160aa020200f6". Set buffer "MD5RandIV" to hex value "71263a457a26571d23657f6f35e 67f129a85e472d18b56". Set buffer "MD2RandIV" to hex value "3c285c6c583d27a549bbb23859a 1f2816345a51236f3ef2a542d1b56". Note: Expected Output Test Vectors Set buffer "publicKey1" to hex value "c8a1e5d14ce2ab219685e0d085 a8ab78e161dd18958d27ff2977b5727516c073". Set buffer "publicKey2" to hex value "2f2b40c49f13577ef90fbd8906 01ea7c282c8329c7e17e0221183211b62d77c0". Set buffer "sharedKey" to hex value "30509f5a6175d22c8c0ea766fe4 e72508be661d37809464e829f152467c3dc9d". Note: Initialize an AI_MD5Random Algorithm for first party Create algorithm object "randomAlgorithm". Call B_CreateAlgorithmObject passing "randomAlgorithm". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set "_InfoPointer" to address of info structure for "AI_MD5Random" initialized from "NULL_PTR". Call B_SetAlgorithmInfo passing "randomAlgorithm" and "AI_MD5Random" and "_InfoPointer". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call Call B_RandomInit passing "randomAlgorithm" and "_Chooser" and "_SurrenderContext". Set "_Status" to return value. Baldwin Informational, Expires 12/25/1999 42 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_RandomUpdate passing "randomAlgorithm" and address of first initialized byte in "MD5RandIV" and length of initialized bytes in "MD5RandIV" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Note: Initialize an AI_MD2Random Algorithm for second party Create algorithm object "diffRandomAlgorithm". Call B_CreateAlgorithmObject passing "diffRandomAlgorithm". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set "_InfoPointer" to address of info structure for "AI_MD2Random" initialized from "NULL_PTR". Call B_SetAlgorithmInfo passing "diffRandomAlgorithm" and "AI_MD2Random" and "_InfoPointer". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call Call B_RandomInit passing "diffRandomAlgorithm" and "_Chooser" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_RandomUpdate passing "diffRandomAlgorithm" and address of first initialized byte in "MD2RandIV" and length of initialized bytes in "MD2RandIV" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Note: Setup key generator for first party. Set "_InfoPointer" to address of info structure for "AI_DHKeyAgreeBER" initialized from contents of buffer "BERString". Call B_SetAlgorithmInfo passing "DHAlgorithmA" and "AI_DHKeyAgreeBER" and "_InfoPointer". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Note: Echo data from BER encoded string. Set "_InfoPointer" to address of info structure for "AI_DHKeyAgree". Call B_GetAlgorithmInfo passing "_InfoPointer" and "DHAlgorithmA" and "AI_DHKeyAgree". Baldwin Informational, Expires 12/25/1999 43 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Display info structure for "AI_DHKeyAgree". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Note: Setup key generator for second party. Set "_InfoPointer" to address of info structure for "AI_DHKeyAgreeBER" initialized from contents of buffer "BERString". Call B_SetAlgorithmInfo passing "DHAlgorithmB" and "AI_DHKeyAgreeBER" and "_InfoPointer". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Note: Generate private and public keys for first party, and Note: test public key Note: against test vector. Call Call B_KeyAgreeInit passing "DHAlgorithmA" and "NULL_PTR" and "_Chooser" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_KeyAgreePhase1 passing "DHAlgorithmA" and address of next free byte in buffer "outputA" and address of "_OutputLen" and length of free bytes in buffer "outputA" and "randomAlgorithm" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "outputA" by "_OutputLen". Check equality of buffer "outputA" with contents of buffer "publicKey1". Note: Generate private and public keys for second party, and Note: test public key Note: against test vector. Call Call B_KeyAgreeInit passing "DHAlgorithmB" and "NULL_PTR" and "_Chooser" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_KeyAgreePhase1 passing "DHAlgorithmB" and address of next free byte in buffer "outputB" and address of "_OutputLen" and length of free bytes in buffer "outputB" and "diffRandomAlgorithm" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "outputB" by "_OutputLen". Baldwin Informational, Expires 12/25/1999 44 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Check equality of buffer "outputB" with contents of buffer "publicKey2". Note: First party is computing shared secret key. Call B_KeyAgreePhase2 passing "DHAlgorithmA" and address of next free byte in buffer "outputA" and address of "_OutputLen" and length of free bytes in buffer "outputA" and address of first initialized byte in buffer "outputB" and length of initialized bytes in buffer "outputB" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "outputA" by "_OutputLen". Note: test if first party has produced the correct shared Note: secret key Check equality of buffer "outputA" with contents of buffer "sharedKey". Note: Second party is computing shared secret key. Call B_KeyAgreePhase2 passing "DHAlgorithmB" and address of next free byte in buffer "outputB" and address of "_OutputLen" and length of free bytes in buffer "outputB" and address of first initialized byte in buffer "publicKey1" and length of initialized bytes in buffer "publicKey1" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "outputB" by "_OutputLen". Note: test if second party has produced the correct shared Note: secret key Note: DataEquals (outputA, @outputB) This is the end of test case "TVDHKA07". This is the start of test case "TVDHKA08". Set "_ExpectedStatus" to zero. Set "_Chooser" to "NULL_PTR". Set "_SurrenderContext" to "NULL_PTR". Note: Test Diffie-Hellman Key Agreement using 300 bit prime Note: A test vector consisting of a fixed prime and a fixed Note: base are Note: passed to both parties to generate 290 bit private Note: exponents. Note: This information is provided in the form of a BER encoded Note: string. Baldwin Informational, Expires 12/25/1999 45 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Note: Both parties use the same AI_MD2Random object to generate Note: their Note: private keys. This object is initialized with the default Note: vector, used Note: by the first party and then reused by the second party. Note: Both parties then exchange their public keys to compute Note: their shared Note: secret key. The generated secret keys are compared to Note: each other as well Note: the expected test vector. Note: Summary Note: Given 300 bit prime and base, both parties, using a Note: single MD2Random stream Note: generate key pairs. The computed secret key are compared Note: to an expected Note: test output vector. Note: ------------------------------------------------------- Note: Start with the GlobalInit Set "_Chooser" to "AM_DH_KEY_AGREE", "AM_MD2_RANDOM", "NULL_PTR". Note: Setup data objects Create algorithm object "DHAlgorithmA". Call B_CreateAlgorithmObject passing "DHAlgorithmA". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Create algorithm object "DHAlgorithmB". Call B_CreateAlgorithmObject passing "DHAlgorithmB". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Create buffer "MD2RandIV" of decimal value "100" bytes. Create buffer "outputA" of decimal value "100" bytes. Create buffer "outputB" of decimal value "100" bytes. Create buffer "BERString" of decimal value "400" bytes. Create buffer "publicKey1" of decimal value "100" bytes. Create buffer "publicKey2" of decimal value "100" bytes. Create buffer "sharedKey" of decimal value "100" bytes. Note: Input Test Vectors Set buffer "BERString" to hex value "306106092a864886f70d0103013 05402260c7fdfb89ef76a1e3c795febb4fa73dd5d0756c30ff5be5ef9e4ff056 cf122e343721a554767022603ab528e75b353e8935d9f5454ef3204747ea8b00 c97f8d0277516d5fcbef1a3c2ba8d90180e02020122". Set buffer "MD2RandIV" to hex value "". Baldwin Informational, Expires 12/25/1999 46 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Note: Expected Output Test Vectors Set buffer "publicKey1" to hex value "01f4b285e206ffd9e2626f4b14 1cbccf4c37ca504d7a849d425adce0bb08d7c09660dbee9a64". Set buffer "publicKey2" to hex value "02d04256a5fcf8bab73ac22df8 688edb557e84ebb43b7bce26451c7d9fbbe7306d0cd502a631". Set buffer "sharedKey" to hex value "00db3b3072f1e90b6bba1197dc0 e73b37674a4b7cbbe8ec3095fcc93c8ef15dbd5ba5d93e066". Note: Initialize an AI_MD2Random Algorithm Create algorithm object "randomAlgorithm". Call B_CreateAlgorithmObject passing "randomAlgorithm". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set "_InfoPointer" to address of info structure for "AI_MD2Random" initialized from "NULL_PTR". Call B_SetAlgorithmInfo passing "randomAlgorithm" and "AI_MD2Random" and "_InfoPointer". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call Call B_RandomInit passing "randomAlgorithm" and "_Chooser" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_RandomUpdate passing "randomAlgorithm" and address of first initialized byte in "MD2RandIV" and length of initialized bytes in "MD2RandIV" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Note: Setup key generator for first party. Set "_InfoPointer" to address of info structure for "AI_DHKeyAgreeBER" initialized from contents of buffer "BERString". Call B_SetAlgorithmInfo passing "DHAlgorithmA" and "AI_DHKeyAgreeBER" and "_InfoPointer". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Note: Echo data from BER encoded string. Set "_InfoPointer" to address of info structure for "AI_DHKeyAgree". Baldwin Informational, Expires 12/25/1999 47 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Call B_GetAlgorithmInfo passing "_InfoPointer" and "DHAlgorithmA" and "AI_DHKeyAgree". Display info structure for "AI_DHKeyAgree". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Note: Setup key generator for second party. Set "_InfoPointer" to address of info structure for "AI_DHKeyAgreeBER" initialized from contents of buffer "BERString". Call B_SetAlgorithmInfo passing "DHAlgorithmB" and "AI_DHKeyAgreeBER" and "_InfoPointer". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Note: Generate private and public keys for first party, and Note: test public key Note: against test vector. Call Call B_KeyAgreeInit passing "DHAlgorithmA" and "NULL_PTR" and "_Chooser" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_KeyAgreePhase1 passing "DHAlgorithmA" and address of next free byte in buffer "outputA" and address of "_OutputLen" and length of free bytes in buffer "outputA" and "randomAlgorithm" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "outputA" by "_OutputLen". Check equality of buffer "outputA" with contents of buffer "publicKey1". Note: Generate private and public keys for second party, and Note: test public key Note: against test vector. Call Call B_KeyAgreeInit passing "DHAlgorithmB" and "NULL_PTR" and "_Chooser" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_KeyAgreePhase1 passing "DHAlgorithmB" and address of next free byte in buffer "outputB" and address of "_OutputLen" and length of free bytes in buffer "outputB" and "randomAlgorithm" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Baldwin Informational, Expires 12/25/1999 48 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Set "_ExpectedStatus" to zero. Increment length of buffer "outputB" by "_OutputLen". Check equality of buffer "outputB" with contents of buffer "publicKey2". Note: First party is computing shared secret key. Call B_KeyAgreePhase2 passing "DHAlgorithmA" and address of next free byte in buffer "outputA" and address of "_OutputLen" and length of free bytes in buffer "outputA" and address of first initialized byte in buffer "outputB" and length of initialized bytes in buffer "outputB" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "outputA" by "_OutputLen". Note: test if first party has produced the correct shared Note: secret key Check equality of buffer "outputA" with contents of buffer "sharedKey". Note: Second party is computing shared secret key. Call B_KeyAgreePhase2 passing "DHAlgorithmB" and address of next free byte in buffer "outputB" and address of "_OutputLen" and length of free bytes in buffer "outputB" and address of first initialized byte in buffer "publicKey1" and length of initialized bytes in buffer "publicKey1" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "outputB" by "_OutputLen". Note: test if second party has produced the correct shared Note: secret key Note: DataEquals (outputA, @outputB) This is the end of test case "TVDHKA08". This is the start of test case "TVDHKA09". Set "_ExpectedStatus" to zero. Set "_Chooser" to "NULL_PTR". Set "_SurrenderContext" to "NULL_PTR". Note: Test Diffie-Hellman Key Agreement using 300 bit prime Note: A test vector consisting of a fixed prime and a fixed Note: base are Note: passed to both parties to generate 290 bit private Note: exponents. Baldwin Informational, Expires 12/25/1999 49 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Note: This information is provided in the form of a BER encoded Note: string. Note: Both parties use the same AI_MD2Random object to generate Note: their Note: private keys. This object is initialized with a zero Note: vector, used Note: by the first party and then reused by the second party. Note: Both parties then exchange their public keys in order to Note: compute their shared Note: secret key. The generated secret keys are compared to Note: each other as well Note: the expected test vector. Note: Summary Note: Given 300 bit prime and base, both parties, using a Note: single MD2Random stream Note: generate key pairs. The computed secret key are compared Note: to an expected Note: test output vector. Note: ------------------------------------------------------- Note: Start with the GlobalInit Set "_Chooser" to "AM_DH_KEY_AGREE", "AM_MD2_RANDOM", "NULL_PTR". Note: Setup data objects Create algorithm object "DHAlgorithmA". Call B_CreateAlgorithmObject passing "DHAlgorithmA". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Create algorithm object "DHAlgorithmB". Call B_CreateAlgorithmObject passing "DHAlgorithmB". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Create buffer "MD2RandIV" of decimal value "256" bytes. Create buffer "outputA" of decimal value "100" bytes. Create buffer "outputB" of decimal value "100" bytes. Create buffer "BERString" of decimal value "400" bytes. Create buffer "publicKey1" of decimal value "100" bytes. Create buffer "publicKey2" of decimal value "100" bytes. Create buffer "sharedKey" of decimal value "100" bytes. Note: Input Test Vectors Set buffer "BERString" to hex value "306106092a864886f70d0103013 05402260c7fdfb89ef76a1e3c795febb4fa73dd5d0756c30ff5be5ef9e4ff056 cf122e343721a554767022603ab528e75b353e8935d9f5454ef3204747ea8b00 c97f8d0277516d5fcbef1a3c2ba8d90180e02020122". Baldwin Informational, Expires 12/25/1999 50 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Set buffer "MD2RandIV" to hex value "000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000". Note: Expected Output Test Vectors Set buffer "publicKey1" to hex value "01685726135d90b1724e7c7e13 23e1e3ae7554b848ed82bb26eddf65540bdc84d46ec64b5aa9". Set buffer "publicKey2" to hex value "0aa7ae5ae28d98d2ca7d817671 202caa2edf76c8ebc9f1f7b60c01fd40ccac7f53b4fd0b569a". Set buffer "sharedKey" to hex value "09494f96a9641fd6be6142d8443 c6bd5391ca6f4c7e5b93816f102cc412e8c1476f5269240d8". Note: Initialize an AI_MD2Random Algorithm Create algorithm object "randomAlgorithm". Call B_CreateAlgorithmObject passing "randomAlgorithm". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set "_InfoPointer" to address of info structure for "AI_MD2Random" initialized from "NULL_PTR". Call B_SetAlgorithmInfo passing "randomAlgorithm" and "AI_MD2Random" and "_InfoPointer". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call Call B_RandomInit passing "randomAlgorithm" and "_Chooser" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_RandomUpdate passing "randomAlgorithm" and address of first initialized byte in "MD2RandIV" and length of initialized bytes in "MD2RandIV" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Note: Setup key generator for first party. Set "_InfoPointer" to address of info structure for "AI_DHKeyAgreeBER" initialized from contents of buffer Baldwin Informational, Expires 12/25/1999 51 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 "BERString". Call B_SetAlgorithmInfo passing "DHAlgorithmA" and "AI_DHKeyAgreeBER" and "_InfoPointer". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Note: Echo data from BER encoded string. Set "_InfoPointer" to address of info structure for "AI_DHKeyAgree". Call B_GetAlgorithmInfo passing "_InfoPointer" and "DHAlgorithmA" and "AI_DHKeyAgree". Display info structure for "AI_DHKeyAgree". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Note: Setup key generator for second party. Set "_InfoPointer" to address of info structure for "AI_DHKeyAgreeBER" initialized from contents of buffer "BERString". Call B_SetAlgorithmInfo passing "DHAlgorithmB" and "AI_DHKeyAgreeBER" and "_InfoPointer". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Note: Generate private and public keys for first party, and Note: test public key Note: against test vector. Call Call B_KeyAgreeInit passing "DHAlgorithmA" and "NULL_PTR" and "_Chooser" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_KeyAgreePhase1 passing "DHAlgorithmA" and address of next free byte in buffer "outputA" and address of "_OutputLen" and length of free bytes in buffer "outputA" and "randomAlgorithm" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "outputA" by "_OutputLen". Check equality of buffer "outputA" with contents of buffer "publicKey1". Note: Generate private and public keys for second party, and Note: test public key Note: against test vector. Baldwin Informational, Expires 12/25/1999 52 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Call Call B_KeyAgreeInit passing "DHAlgorithmB" and "NULL_PTR" and "_Chooser" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_KeyAgreePhase1 passing "DHAlgorithmB" and address of next free byte in buffer "outputB" and address of "_OutputLen" and length of free bytes in buffer "outputB" and "randomAlgorithm" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "outputB" by "_OutputLen". Check equality of buffer "outputB" with contents of buffer "publicKey2". Note: First party is computing shared secret key. Call B_KeyAgreePhase2 passing "DHAlgorithmA" and address of next free byte in buffer "outputA" and address of "_OutputLen" and length of free bytes in buffer "outputA" and address of first initialized byte in buffer "outputB" and length of initialized bytes in buffer "outputB" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "outputA" by "_OutputLen". Note: test if first party has produced the correct shared Note: secret key Check equality of buffer "outputA" with contents of buffer "sharedKey". Note: Second party is computing shared secret key. Call B_KeyAgreePhase2 passing "DHAlgorithmB" and address of next free byte in buffer "outputB" and address of "_OutputLen" and length of free bytes in buffer "outputB" and address of first initialized byte in buffer "publicKey1" and length of initialized bytes in buffer "publicKey1" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "outputB" by "_OutputLen". Note: test if second party has produced the correct shared Note: secret key Note: DataEquals (outputA, @outputB) This is the end of test case "TVDHKA09". This is the start of test case "TVDHKA10". Baldwin Informational, Expires 12/25/1999 53 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Set "_ExpectedStatus" to zero. Set "_Chooser" to "NULL_PTR". Set "_SurrenderContext" to "NULL_PTR". Note: Test Diffie-Hellman Key Agreement using 300 bit prime Note: A test vector consisting of a fixed prime and a fixed Note: base are Note: passed to both parties to generate 290 bit private Note: exponents. Note: This information is provided in the form of a BER encoded Note: string. Note: Both parties use the same AI_MD2Random object to generate Note: their Note: private keys. This object is initialized with a given Note: test vector, used Note: by the first party and then reused by the second party. Note: Both parties then exchange their public keys in order to Note: compute their shared Note: secret key. The generated secret keys are compared to Note: each other as well Note: the expected test vector. Note: Summary Note: Given 300 bit prime and base, both parties, using a Note: single MD2Random stream Note: generate key pairs. The computed secret key are compared Note: to an expected Note: test output vector. Note: ------------------------------------------------------- Note: Start with the GlobalInit Set "_Chooser" to "AM_DH_KEY_AGREE", "AM_MD2_RANDOM", "NULL_PTR". Note: Setup data objects Create algorithm object "DHAlgorithmA". Call B_CreateAlgorithmObject passing "DHAlgorithmA". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Create algorithm object "DHAlgorithmB". Call B_CreateAlgorithmObject passing "DHAlgorithmB". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Create buffer "MD2RandIV" of decimal value "100" bytes. Create buffer "outputA" of decimal value "100" bytes. Baldwin Informational, Expires 12/25/1999 54 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Create buffer "outputB" of decimal value "100" bytes. Create buffer "BERString" of decimal value "400" bytes. Create buffer "publicKey1" of decimal value "100" bytes. Create buffer "publicKey2" of decimal value "100" bytes. Create buffer "sharedKey" of decimal value "100" bytes. Note: Input Test Vectors Set buffer "BERString" to hex value "306106092a864886f70d0103013 05402260c7fdfb89ef76a1e3c795febb4fa73dd5d0756c30ff5be5ef9e4ff056 cf122e343721a554767022603ab528e75b353e8935d9f5454ef3204747ea8b00 c97f8d0277516d5fcbef1a3c2ba8d90180e02020122". Set buffer "MD2RandIV" to hex value "123456789abcdef0". Note: Expected Output Test Vectors Set buffer "publicKey1" to hex value "0a4cf11676a3a91ff33cd1f727 62ee3aef1b64bb3acf7bd82b47e5323a9457084f58a06bdace". Set buffer "publicKey2" to hex value "070f06c116dec187fe28c82000 9629510279a5bebd18760d5f8cda6e3edbca9560760e311066". Set buffer "sharedKey" to hex value "05ab11f65f73d8fbe909c5f6b9a 90aaca01a9e168191dab2148d2ff0645256680dd0148eea6d". Note: Initialize an AI_MD2Random Algorithm Create algorithm object "randomAlgorithm". Call B_CreateAlgorithmObject passing "randomAlgorithm". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set "_InfoPointer" to address of info structure for "AI_MD2Random" initialized from "NULL_PTR". Call B_SetAlgorithmInfo passing "randomAlgorithm" and "AI_MD2Random" and "_InfoPointer". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call Call B_RandomInit passing "randomAlgorithm" and "_Chooser" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_RandomUpdate passing "randomAlgorithm" and address of first initialized byte in "MD2RandIV" and length of initialized bytes in "MD2RandIV" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Note: Setup key generator for first party. Baldwin Informational, Expires 12/25/1999 55 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Set "_InfoPointer" to address of info structure for "AI_DHKeyAgreeBER" initialized from contents of buffer "BERString". Call B_SetAlgorithmInfo passing "DHAlgorithmA" and "AI_DHKeyAgreeBER" and "_InfoPointer". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Note: Echo data from BER encoded string. Set "_InfoPointer" to address of info structure for "AI_DHKeyAgree". Call B_GetAlgorithmInfo passing "_InfoPointer" and "DHAlgorithmA" and "AI_DHKeyAgree". Display info structure for "AI_DHKeyAgree". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Note: Setup key generator for second party. Set "_InfoPointer" to address of info structure for "AI_DHKeyAgreeBER" initialized from contents of buffer "BERString". Call B_SetAlgorithmInfo passing "DHAlgorithmB" and "AI_DHKeyAgreeBER" and "_InfoPointer". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Note: Generate private and public keys for first party, and Note: test public key Note: against test vector. Call Call B_KeyAgreeInit passing "DHAlgorithmA" and "NULL_PTR" and "_Chooser" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_KeyAgreePhase1 passing "DHAlgorithmA" and address of next free byte in buffer "outputA" and address of "_OutputLen" and length of free bytes in buffer "outputA" and "randomAlgorithm" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "outputA" by "_OutputLen". Check equality of buffer "outputA" with contents of buffer "publicKey1". Note: Generate private and public keys for second party, and Baldwin Informational, Expires 12/25/1999 56 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Note: test public key Note: against test vector. Call Call B_KeyAgreeInit passing "DHAlgorithmB" and "NULL_PTR" and "_Chooser" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_KeyAgreePhase1 passing "DHAlgorithmB" and address of next free byte in buffer "outputB" and address of "_OutputLen" and length of free bytes in buffer "outputB" and "randomAlgorithm" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "outputB" by "_OutputLen". Check equality of buffer "outputB" with contents of buffer "publicKey2". Note: First party is computing shared secret key. Call B_KeyAgreePhase2 passing "DHAlgorithmA" and address of next free byte in buffer "outputA" and address of "_OutputLen" and length of free bytes in buffer "outputA" and address of first initialized byte in buffer "outputB" and length of initialized bytes in buffer "outputB" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "outputA" by "_OutputLen". Note: test if first party has produced the correct shared Note: secret key Check equality of buffer "outputA" with contents of buffer "sharedKey". Note: Second party is computing shared secret key. Call B_KeyAgreePhase2 passing "DHAlgorithmB" and address of next free byte in buffer "outputB" and address of "_OutputLen" and length of free bytes in buffer "outputB" and address of first initialized byte in buffer "publicKey1" and length of initialized bytes in buffer "publicKey1" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "outputB" by "_OutputLen". Note: test if second party has produced the correct shared Note: secret key Note: DataEquals (outputA, @outputB) Baldwin Informational, Expires 12/25/1999 57 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 This is the end of test case "TVDHKA10". This is the start of test case "TVDHKA11". Set "_ExpectedStatus" to zero. Set "_Chooser" to "NULL_PTR". Set "_SurrenderContext" to "NULL_PTR". Note: Test Diffie-Hellman Key Agreement using 479 bit prime Note: A test vector consisting of a fixed prime and a fixed Note: base are Note: passed to both parties to generate 470 bit private Note: exponents. Note: This information is provided in the form of a BER encoded Note: string. Note: The first party uses AI_MD5Random with a given Note: initialization Note: vector to generate its private key. The second party uses Note: AI_MD2Random Note: with the same initialization vector to generate its Note: private key. Note: Both parties then exchange their public keys to compute Note: their shared Note: secret key. The generated secret keys are compared to Note: each other as well Note: the expected test vector. Note: Summary Note: Given 479 bit prime and base, and an initialization Note: vector, Note: generate key pairs using MD5Random for first party and Note: MD2Random for Note: second party. Compare computed secret key to expected Note: test vector. Note: ------------------------------------------------------- Note: Start with the GlobalInit Set "_Chooser" to "AM_DH_KEY_AGREE", "AM_MD2_RANDOM", "AM_MD5_RANDOM", "NULL_PTR". Note: Setup data objects Create algorithm object "DHAlgorithmA". Call B_CreateAlgorithmObject passing "DHAlgorithmA". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Create algorithm object "DHAlgorithmB". Call B_CreateAlgorithmObject passing "DHAlgorithmB". Baldwin Informational, Expires 12/25/1999 58 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Create buffer "randIV" of decimal value "200" bytes. Create buffer "outputA" of decimal value "100" bytes. Create buffer "outputB" of decimal value "100" bytes. Create buffer "BERString" of decimal value "400" bytes. Create buffer "publicKey1" of decimal value "100" bytes. Create buffer "publicKey2" of decimal value "100" bytes. Create buffer "sharedKey" of decimal value "100" bytes. Note: Input Test Vectors Set buffer "BERString" to hex value "30818e06092a864886f70d01030 1308180023c6d861a736462e5f2628eefbf4c9913522a4dfde5b655b02ef2519 3616bd3f5ddd36d6321ec01a8f0c4fd4e44d9e02fb019e45e19b42f469d434e6 70d023c1785465a832ac028ad4ee07b8dc73b0b59612c2747b3e26e3f8589796 87df06da851a17d2eca9c05e06d3da832092fd7d816566c80151cc95c6409720 20201d6". Set buffer "randIV" to hex value "23f974e01b90f6104c664e960f3e95 8b1f9571c26c38b2". Note: Expected Output Test Vectors Set buffer "publicKey1" to hex value "44e5ae0ba8d11d23f3187f42c1 55da508394ff569b7d3640da5e16eea192979a3c71fd729b086b10baef83b8c0 9457f754f5589ca38ff188348edce2". Set buffer "publicKey2" to hex value "20b46b27bc1baaa4a3e4e58d90 690e1a6cc070013040aa551aac3642212aeb8d4c915adce34aef1fcf57682b94 9f733cf82e740c1d276d42fdde5df0". Set buffer "sharedKey" to hex value "43f90fd12d83934f2a65ab08ed5 fb107053c6646a8b47d78c6306b87a719808105b9c2f4d650523e37a71eccc97 d12de962ad25ee68c3bdb99795ab4". Note: Initialize an AI_MD5Random Algorithm for first party Create algorithm object "randomAlgorithm". Call B_CreateAlgorithmObject passing "randomAlgorithm". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set "_InfoPointer" to address of info structure for "AI_MD5Random" initialized from "NULL_PTR". Call B_SetAlgorithmInfo passing "randomAlgorithm" and "AI_MD5Random" and "_InfoPointer". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call Call B_RandomInit passing "randomAlgorithm" and "_Chooser" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Baldwin Informational, Expires 12/25/1999 59 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Set "_ExpectedStatus" to zero. Call B_RandomUpdate passing "randomAlgorithm" and address of first initialized byte in "randIV" and length of initialized bytes in "randIV" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Note: Initialize an AI_MD2Random Algorithm for second party Create algorithm object "diffRandomAlgorithm". Call B_CreateAlgorithmObject passing "diffRandomAlgorithm". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set "_InfoPointer" to address of info structure for "AI_MD2Random" initialized from "NULL_PTR". Call B_SetAlgorithmInfo passing "diffRandomAlgorithm" and "AI_MD2Random" and "_InfoPointer". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call Call B_RandomInit passing "diffRandomAlgorithm" and "_Chooser" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_RandomUpdate passing "diffRandomAlgorithm" and address of first initialized byte in "randIV" and length of initialized bytes in "randIV" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Note: Setup key generator for first party. Set "_InfoPointer" to address of info structure for "AI_DHKeyAgreeBER" initialized from contents of buffer "BERString". Call B_SetAlgorithmInfo passing "DHAlgorithmA" and "AI_DHKeyAgreeBER" and "_InfoPointer". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Note: Echo data from BER encoded string. Set "_InfoPointer" to address of info structure for "AI_DHKeyAgree". Call B_GetAlgorithmInfo passing "_InfoPointer" and "DHAlgorithmA" and "AI_DHKeyAgree". Display info structure for "AI_DHKeyAgree". Baldwin Informational, Expires 12/25/1999 60 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Note: Setup key generator for second party. Set "_InfoPointer" to address of info structure for "AI_DHKeyAgreeBER" initialized from contents of buffer "BERString". Call B_SetAlgorithmInfo passing "DHAlgorithmB" and "AI_DHKeyAgreeBER" and "_InfoPointer". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Note: Generate private and public keys for first party, and Note: test public key Note: against test vector. Call Call B_KeyAgreeInit passing "DHAlgorithmA" and "NULL_PTR" and "_Chooser" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_KeyAgreePhase1 passing "DHAlgorithmA" and address of next free byte in buffer "outputA" and address of "_OutputLen" and length of free bytes in buffer "outputA" and "randomAlgorithm" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "outputA" by "_OutputLen". Check equality of buffer "outputA" with contents of buffer "publicKey1". Note: Generate private and public keys for second party, and Note: test public key Note: against test vector. Call Call B_KeyAgreeInit passing "DHAlgorithmB" and "NULL_PTR" and "_Chooser" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_KeyAgreePhase1 passing "DHAlgorithmB" and address of next free byte in buffer "outputB" and address of "_OutputLen" and length of free bytes in buffer "outputB" and "diffRandomAlgorithm" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "outputB" by "_OutputLen". Check equality of buffer "outputB" with contents of buffer Baldwin Informational, Expires 12/25/1999 61 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 "publicKey2". Note: First party is computing shared secret key. Call B_KeyAgreePhase2 passing "DHAlgorithmA" and address of next free byte in buffer "outputA" and address of "_OutputLen" and length of free bytes in buffer "outputA" and address of first initialized byte in buffer "outputB" and length of initialized bytes in buffer "outputB" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "outputA" by "_OutputLen". Note: test if first party has produced the correct shared Note: secret key Check equality of buffer "outputA" with contents of buffer "sharedKey". Note: Second party is computing shared secret key. Call B_KeyAgreePhase2 passing "DHAlgorithmB" and address of next free byte in buffer "outputB" and address of "_OutputLen" and length of free bytes in buffer "outputB" and address of first initialized byte in buffer "publicKey1" and length of initialized bytes in buffer "publicKey1" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "outputB" by "_OutputLen". Note: test if second party has produced the correct shared Note: secret key Note: DataEquals (outputA, @outputB) This is the end of test case "TVDHKA11". This is the start of test case "TVDHKA12". Set "_ExpectedStatus" to zero. Set "_Chooser" to "NULL_PTR". Set "_SurrenderContext" to "NULL_PTR". Note: Test Diffie-Hellman Key Agreement using 512 bit prime Note: A test vector consisting of a fixed prime and a fixed Note: base are Note: passed to both parties to generate 511 bit private Note: exponents. Note: This information is provided in the form of a BER encoded Note: string. Note: Using distinct AI_MD5Random streams, each party generates Baldwin Informational, Expires 12/25/1999 62 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Note: its own private Note: key. Both parties then exchange their public keys to in Note: order to compute Note: their shared secret key. The generated secret keys are Note: compared to each Note: other as well the expected test vector. Note: Summary Note: Given 512 bit prime and base, and two different Note: initialization vectors, Note: generate key pairs using MD5Random for both parties. Note: Compare computed shared secret key to expected test Note: vector. Note: ------------------------------------------------------- Note: Start with the GlobalInit Set "_Chooser" to "AM_DH_KEY_AGREE", "AM_MD5_RANDOM", "NULL_PTR". Note: Setup data objects Create algorithm object "DHAlgorithmA". Call B_CreateAlgorithmObject passing "DHAlgorithmA". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Create algorithm object "DHAlgorithmB". Call B_CreateAlgorithmObject passing "DHAlgorithmB". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Create buffer "MD5RandIV1" of decimal value "200" bytes. Create buffer "MD5RandIV2" of decimal value "200" bytes. Create buffer "outputA" of decimal value "200" bytes. Create buffer "outputB" of decimal value "200" bytes. Create buffer "BERString" of decimal value "400" bytes. Create buffer "publicKey1" of decimal value "200" bytes. Create buffer "publicKey2" of decimal value "200" bytes. Create buffer "sharedKey" of decimal value "200" bytes. Note: Input Test Vectors Set buffer "BERString" to hex value "30819706092a864886f70d01030 1308189024100e6d2dfe4e920d8ef148e748d6c950001cb5876fac1ac581f7a1 9cf734ce38b6f861d984bbc03662a759c9b345be8ea7d7b4a616ff6f7f13a9cd cd0c125aff23302402a597600fb7e925757c6765cb36d29e1f6848a0e93a79ec 8734bfd71678e12e46aefa61126f704f548349140cef758cfb587e8d76448876 4e680b7063f52322e020201ff". Set buffer "MD5RandIV1" to hex value "a6d23d4f974e01b90f6010a49c 76c64e9610f03e89a58b14". Baldwin Informational, Expires 12/25/1999 63 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Set buffer "MD5RandIV2" to hex value "d928f5693b271c906a82d175d9 20a019b465e72f19c210". Note: Expected Output Test Vectors Set buffer "publicKey1" to hex value "465407b618285cbf54b3bf1d3e f3db175480cf25b3609abb2ef76fe4a5c5c7426fe01404b39d2acc2fa399d65e f4b6638f75f808bd10f84b7b73389d578ebe67". Set buffer "publicKey2" to hex value "7eece1b6fcfd45856668fc9f17 91f003edea3897280a689f53589b0a3d45c3d266e02950b4de1e9cc386403be2 db588cdb184d275b964a44a43035cd60a55b4c". Set buffer "sharedKey" to hex value "c23efa13121622463c226c2d1bd 9e37b6d7798ef14b489de5c544de540bb6fcb6ef052b28188739b1eafaa71b92 7a8d94be259451c375f41f0d47b2f3f2a2ae4". Note: Initialize an AI_MD5Random Algorithm for first party Create algorithm object "randomAlgorithm". Call B_CreateAlgorithmObject passing "randomAlgorithm". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set "_InfoPointer" to address of info structure for "AI_MD5Random" initialized from "NULL_PTR". Call B_SetAlgorithmInfo passing "randomAlgorithm" and "AI_MD5Random" and "_InfoPointer". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call Call B_RandomInit passing "randomAlgorithm" and "_Chooser" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_RandomUpdate passing "randomAlgorithm" and address of first initialized byte in "MD5RandIV1" and length of initialized bytes in "MD5RandIV1" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Note: Initialize an AI_MD5Random Algorithm for second party Create algorithm object "diffRandomAlgorithm". Call B_CreateAlgorithmObject passing "diffRandomAlgorithm". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set "_InfoPointer" to address of info structure for "AI_MD5Random" initialized from "NULL_PTR". Call B_SetAlgorithmInfo passing "diffRandomAlgorithm" and Baldwin Informational, Expires 12/25/1999 64 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 "AI_MD5Random" and "_InfoPointer". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call Call B_RandomInit passing "diffRandomAlgorithm" and "_Chooser" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_RandomUpdate passing "diffRandomAlgorithm" and address of first initialized byte in "MD5RandIV2" and length of initialized bytes in "MD5RandIV2" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Note: Setup key generator for first party. Set "_InfoPointer" to address of info structure for "AI_DHKeyAgreeBER" initialized from contents of buffer "BERString". Call B_SetAlgorithmInfo passing "DHAlgorithmA" and "AI_DHKeyAgreeBER" and "_InfoPointer". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Note: Echo data from BER encoded string. Set "_InfoPointer" to address of info structure for "AI_DHKeyAgree". Call B_GetAlgorithmInfo passing "_InfoPointer" and "DHAlgorithmA" and "AI_DHKeyAgree". Display info structure for "AI_DHKeyAgree". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Note: Setup key generator for second party. Set "_InfoPointer" to address of info structure for "AI_DHKeyAgreeBER" initialized from contents of buffer "BERString". Call B_SetAlgorithmInfo passing "DHAlgorithmB" and "AI_DHKeyAgreeBER" and "_InfoPointer". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Note: Generate private and public keys for first party, and Note: test public key Note: against test vector. Baldwin Informational, Expires 12/25/1999 65 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Call Call B_KeyAgreeInit passing "DHAlgorithmA" and "NULL_PTR" and "_Chooser" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_KeyAgreePhase1 passing "DHAlgorithmA" and address of next free byte in buffer "outputA" and address of "_OutputLen" and length of free bytes in buffer "outputA" and "randomAlgorithm" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "outputA" by "_OutputLen". Check equality of buffer "outputA" with contents of buffer "publicKey1". Note: Generate private and public keys for second party, and Note: test public key Note: against test vector. Call Call B_KeyAgreeInit passing "DHAlgorithmB" and "NULL_PTR" and "_Chooser" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_KeyAgreePhase1 passing "DHAlgorithmB" and address of next free byte in buffer "outputB" and address of "_OutputLen" and length of free bytes in buffer "outputB" and "diffRandomAlgorithm" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "outputB" by "_OutputLen". Check equality of buffer "outputB" with contents of buffer "publicKey2". Note: First party is computing shared secret key. Call B_KeyAgreePhase2 passing "DHAlgorithmA" and address of next free byte in buffer "outputA" and address of "_OutputLen" and length of free bytes in buffer "outputA" and address of first initialized byte in buffer "outputB" and length of initialized bytes in buffer "outputB" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "outputA" by "_OutputLen". Note: test if first party has produced the correct shared Note: secret key Check equality of buffer "outputA" with contents of buffer "sharedKey". Baldwin Informational, Expires 12/25/1999 66 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Note: Second party is computing shared secret key. Call B_KeyAgreePhase2 passing "DHAlgorithmB" and address of next free byte in buffer "outputB" and address of "_OutputLen" and length of free bytes in buffer "outputB" and address of first initialized byte in buffer "publicKey1" and length of initialized bytes in buffer "publicKey1" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "outputB" by "_OutputLen". Note: test if second party has produced the correct shared Note: secret key Note: DataEquals (outputA, @outputB) This is the end of test case "TVDHKA12". This is the start of test case "TVDHKA13". Set "_ExpectedStatus" to zero. Set "_Chooser" to "NULL_PTR". Set "_SurrenderContext" to "NULL_PTR". Note: Test Diffie-Hellman Key Agreement using 705 bit prime Note: A test vector consisting of a fixed prime and a fixed Note: base are Note: passed to both parties to generate 701 bit private Note: exponents. Note: This information is provided in the form of a BER encoded Note: string. Note: Using distinct AI_MD2Random streams, each party generates Note: its own private Note: key. Both parties then exchange their public keys in Note: order to compute their Note: shared secret key. The generated secret keys are compared Note: to each other as Note: well the expected test vector. Note: Summary Note: Given 705 bit prime and base, and two different Note: initialization vectors, Note: generate key pairs using MD2Random for both parties. Note: Compare computed shared secret key to expected test Note: vector. Note: ------------------------------------------------------- Note: Start with the GlobalInit Baldwin Informational, Expires 12/25/1999 67 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Set "_Chooser" to "AM_DH_KEY_AGREE", "AM_MD2_RANDOM", "NULL_PTR". Note: Setup data objects Create algorithm object "DHAlgorithmA". Call B_CreateAlgorithmObject passing "DHAlgorithmA". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Create algorithm object "DHAlgorithmB". Call B_CreateAlgorithmObject passing "DHAlgorithmB". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Create buffer "MD2RandIV1" of decimal value "200" bytes. Create buffer "MD2RandIV2" of decimal value "200" bytes. Create buffer "outputA" of decimal value "200" bytes. Create buffer "outputB" of decimal value "200" bytes. Create buffer "BERString" of decimal value "600" bytes. Create buffer "publicKey1" of decimal value "200" bytes. Create buffer "publicKey2" of decimal value "200" bytes. Create buffer "sharedKey" of decimal value "200" bytes. Note: Input Test Vectors Set buffer "BERString" to hex value "3081c806092a864886f70d01030 13081ba025901ec9b7e86e486a2ba7916b7e23b0cd2f0f1ad3c73ca74728081c b2b2723ec413b6fccf5a1d95ac3b4d46048bca1adef04c33a05453a3a4df1f37 fd0db4a2640969704adc5886bffebbcf11e537224715dbddab00300c2480d025 9008c2e4cc68ccf22470201bdedbabe7a1ded8d05a1a9ece2d23c51245aafd3d 4892ff04b8095952b92ced6e23b9eb723df2227362631dfa6aec48095d8a2150 dc37da9228c67315e27a38d708aa1ebe711bc217f374889281d020202bd". Set buffer "MD2RandIV1" to hex value "0102030405060708090a0b0c0d 0e0f". Set buffer "MD2RandIV2" to hex value "6b8107278d84858f8c81838a8d 5cb7ba13d82c6f". Note: Expected Output Test Vectors Set buffer "publicKey1" to hex value "000ee00218ab5f5688eb741853 e81b882c9d043e41115018847e748291ce651dee73c66c8300802f67d4d3def9 5850f152811c72db7affd82f8331975ad694ccea61d8512ad4e60810870471b3 cf767b137ebb54610c305b9a". Set buffer "publicKey2" to hex value "006abb11ff2e618a9119ee9b2c 5d865fd472a8e1681d52edc2754d051ff6e855be96b79712f14ff11a6beea880 3155b6934de8e3ea8c8dc5e0ff031e3ab49c065f5f71fe8db9f4e7b85811bfde 6526f9b3f0fd134f546c947f". Set buffer "sharedKey" to hex value "00945b88af739157b2ed3e4042d Baldwin Informational, Expires 12/25/1999 68 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 ff2228db8bc29c50f7f01a0a13b240fc4af309ea360951fcda19a84e77629335 6b3046e27e81f241cc691555efe629089a1420fb22c62f6c254aa018faf46021 7457847c64ceca7fe860f33". Note: Initialize an AI_MD2Random Algorithm for first party Create algorithm object "randomAlgorithm". Call B_CreateAlgorithmObject passing "randomAlgorithm". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set "_InfoPointer" to address of info structure for "AI_MD2Random" initialized from "NULL_PTR". Call B_SetAlgorithmInfo passing "randomAlgorithm" and "AI_MD2Random" and "_InfoPointer". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call Call B_RandomInit passing "randomAlgorithm" and "_Chooser" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_RandomUpdate passing "randomAlgorithm" and address of first initialized byte in "MD2RandIV1" and length of initialized bytes in "MD2RandIV1" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Note: Initialize an AI_MD2Random Algorithm for second party Create algorithm object "diffRandomAlgorithm". Call B_CreateAlgorithmObject passing "diffRandomAlgorithm". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set "_InfoPointer" to address of info structure for "AI_MD2Random" initialized from "NULL_PTR". Call B_SetAlgorithmInfo passing "diffRandomAlgorithm" and "AI_MD2Random" and "_InfoPointer". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call Call B_RandomInit passing "diffRandomAlgorithm" and "_Chooser" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_RandomUpdate passing "diffRandomAlgorithm" and address of first initialized byte in "MD2RandIV2" and length of initialized bytes in "MD2RandIV2" and "_SurrenderContext". Set "_Status" to return value. Baldwin Informational, Expires 12/25/1999 69 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Note: Setup key generator for first party. Set "_InfoPointer" to address of info structure for "AI_DHKeyAgreeBER" initialized from contents of buffer "BERString". Call B_SetAlgorithmInfo passing "DHAlgorithmA" and "AI_DHKeyAgreeBER" and "_InfoPointer". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Note: Echo data from BER encoded string. Set "_InfoPointer" to address of info structure for "AI_DHKeyAgree". Call B_GetAlgorithmInfo passing "_InfoPointer" and "DHAlgorithmA" and "AI_DHKeyAgree". Display info structure for "AI_DHKeyAgree". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Note: Setup key generator for second party. Set "_InfoPointer" to address of info structure for "AI_DHKeyAgreeBER" initialized from contents of buffer "BERString". Call B_SetAlgorithmInfo passing "DHAlgorithmB" and "AI_DHKeyAgreeBER" and "_InfoPointer". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Note: Generate private and public keys for first party, and Note: test public key Note: against test vector. Call Call B_KeyAgreeInit passing "DHAlgorithmA" and "NULL_PTR" and "_Chooser" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_KeyAgreePhase1 passing "DHAlgorithmA" and address of next free byte in buffer "outputA" and address of "_OutputLen" and length of free bytes in buffer "outputA" and "randomAlgorithm" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Baldwin Informational, Expires 12/25/1999 70 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Increment length of buffer "outputA" by "_OutputLen". Check equality of buffer "outputA" with contents of buffer "publicKey1". Note: Generate private and public keys for second party, and Note: test public key Note: against test vector. Call Call B_KeyAgreeInit passing "DHAlgorithmB" and "NULL_PTR" and "_Chooser" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_KeyAgreePhase1 passing "DHAlgorithmB" and address of next free byte in buffer "outputB" and address of "_OutputLen" and length of free bytes in buffer "outputB" and "diffRandomAlgorithm" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "outputB" by "_OutputLen". Check equality of buffer "outputB" with contents of buffer "publicKey2". Note: First party is computing shared secret key. Call B_KeyAgreePhase2 passing "DHAlgorithmA" and address of next free byte in buffer "outputA" and address of "_OutputLen" and length of free bytes in buffer "outputA" and address of first initialized byte in buffer "outputB" and length of initialized bytes in buffer "outputB" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "outputA" by "_OutputLen". Note: test if first party has produced the correct shared Note: secret key Check equality of buffer "outputA" with contents of buffer "sharedKey". Note: Second party is computing shared secret key. Call B_KeyAgreePhase2 passing "DHAlgorithmB" and address of next free byte in buffer "outputB" and address of "_OutputLen" and length of free bytes in buffer "outputB" and address of first initialized byte in buffer "publicKey1" and length of initialized bytes in buffer "publicKey1" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "outputB" by "_OutputLen". Baldwin Informational, Expires 12/25/1999 71 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Note: test if second party has produced the correct shared Note: secret key Note: DataEquals (outputA, @outputB) This is the end of test case "TVDHKA13". This is the start of test case "TVHMCMD5". Set "_ExpectedStatus" to zero. Set "_Chooser" to "NULL_PTR". Set "_SurrenderContext" to "NULL_PTR". Note: Generate 24 byte key and use it to perform HMAC and test Note: it against Note: test vector generated by running SET based code Create buffer "keytext" of decimal value "24" bytes. Set buffer "keytext" to hex value "0b0b0b0b0b0b0b0b0b0b0b0b0b0b0 b0b". Create key object "key". Call B_CreateKeyObject passing "key". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set "_InfoPointer" to address of info structure for "KI_Item" initialized from contents of buffer "keytext". Call B_SetKeyInfo passing "key" and "KI_Item" and "_InfoPointer". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Note: Generate an HMAC code. Create algorithm object "HMAC_Digester". Call B_CreateAlgorithmObject passing "HMAC_Digester". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set "_InfoPointer" to address of info structure for "AI_HMAC" initialized from "AI_MD5", "NULL_PTR". Call B_SetAlgorithmInfo passing "HMAC_Digester" and "AI_HMAC" and "_InfoPointer". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Baldwin Informational, Expires 12/25/1999 72 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Create buffer "dataToDigest" of decimal value "32" bytes. Create buffer "HMACdigest" of decimal value "64" bytes. Set buffer "dataToDigest" to hex value "4869205468657265". Note: Use the private key to sign. Call Call B_DigestInit passing "HMAC_Digester" and "key" and "_Chooser" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_DigestUpdate passing "HMAC_Digester" and address of first initialized byte in buffer "dataToDigest" and length of initialized bytes in buffer "dataToDigest" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_DigestFinal passing "HMAC_Digester" and address of next free byte in buffer "HMACdigest" and address of "_OutputLen" and length of free bytes in buffer "HMACdigest" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "HMACdigest" by "_OutputLen". Finalize buffer "HMACdigest". Check equality of buffer "HMACdigest" with hex value "9294727a3638bb1c13f48ef8158bfc9d". Display buffer "HMACdigest". Call Call B_DestroyKeyObject passing "key". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call Call B_DestroyAlgorithmObject passing "HMAC_Digester". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. This is the end of test case "TVHMCMD5". This is the start of test case "TVMD2R00". Set "_ExpectedStatus" to zero. Set "_Chooser" to "NULL_PTR". Baldwin Informational, Expires 12/25/1999 73 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Set "_SurrenderContext" to "NULL_PTR". Note: Test vectors for AI_MD2Random using BSafe 3.0 behavior. Note: Note there are different expected results for BSafe 3.0 Note: and BSafe 2.x. This file has the expected results for Note: BSafe 3.0. Note: Depends on: Note: AI_MD2 Note: AI_MD2Random Note: Test cases: Note: - For a given one byte seed check the result against the Note: expected MD2 operations. Generate 16, 12, 32 bytes. Note: - For a given 100 byte seed check the result against the Note: expected MD2 operations. Generate 16, 12, 32 bytes. Note: - Check the result for a two bytes seed passed as two Note: calls to RandomUpdate matches one call. Generate Note: 48 bytes to check state incrementing. Note: - Check adding new seed bytes after GenerateBytes call. Note: Call RandomUpdate twice and generate 32 bytes. Note: ---------------------------------------------------------- Note: ------- Note: Choose the BSafe 3.0 AM Set "_Chooser" to "AM_MD2", "AM_MD2_RANDOM", "NULL_PTR". Note: Start with the GlobalInit Set "_Chooser" to "AM_MD2", "AM_MD2_RANDOM", "NULL_PTR". Note: Setup Data Objects Create buffer "oneByte" of decimal value "1" bytes. Create buffer "twoBytes" of decimal value "2" bytes. Create buffer "bigSeed" of decimal value "256" bytes. Create buffer "randomOutput" of decimal value "1000" bytes. Create buffer "digestOutput" of decimal value "1000" bytes. Note: ---------------------------------------------------------- Note: ------- Note: Setup Algorithm Objects Create algorithm object "randomAlgorithm". Call B_CreateAlgorithmObject passing "randomAlgorithm". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set "_InfoPointer" to address of info structure for "AI_MD2Random" initialized from "NULL_PTR". Baldwin Informational, Expires 12/25/1999 74 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Call B_SetAlgorithmInfo passing "randomAlgorithm" and "AI_MD2Random" and "_InfoPointer". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Create algorithm object "digestAlgorithm". Call B_CreateAlgorithmObject passing "digestAlgorithm". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set "_InfoPointer" to address of info structure for "AI_MD2" initialized from "NULL_PTR". Call B_SetAlgorithmInfo passing "digestAlgorithm" and "AI_MD2" and "_InfoPointer". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Note: ---------------------------------------------------------- Note: ------- Note: - For a given one byte seed check the result against the Note: expected MD2 operations. Note: Seed the generator Call Call B_RandomInit passing "randomAlgorithm" and "_Chooser" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set buffer "oneByte" to hex value "12". Call B_RandomUpdate passing "randomAlgorithm" and address of first initialized byte in "oneByte" and length of initialized bytes in "oneByte" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Note: Compute expected result Call Call B_DigestInit passing "digestAlgorithm" and "NULL_PTR" and "_Chooser" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_DigestUpdate passing "digestAlgorithm" and address of first initialized byte in buffer "oneByte" and length of initialized bytes in buffer "oneByte" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_DigestFinal passing "digestAlgorithm" and address of next free byte in buffer "digestOutput" and address of Baldwin Informational, Expires 12/25/1999 75 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 "_OutputLen" and length of free bytes in buffer "digestOutput" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "digestOutput" by "_OutputLen". Finalize buffer "digestOutput". Display buffer "digestOutput". Check equality of buffer "digestOutput" with hex value "3238a25051baa87ca3455dc022feae65". Call B_DigestUpdate passing "digestAlgorithm" and address of first initialized byte in buffer "digestOutput" and length of initialized bytes in buffer "digestOutput" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_DigestFinal passing "digestAlgorithm" and address of next free byte in buffer "digestOutput" and address of "_OutputLen" and length of free bytes in buffer "digestOutput" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "digestOutput" by "_OutputLen". Finalize buffer "digestOutput". Display buffer "digestOutput". Check equality of buffer "digestOutput" with hex value "f68063d0de9ca6be78f7e5a9a0f8e81d". Note: Generate random values Set "_OutputLen" to decimal value "16". Call B_GenerateRandomBytes passing "randomAlgorithm" and address of next free byte in "randomOutput" and "_OutputLen" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of "randomOutput" by "_OutputLen". Finalize "randomOutput". Display buffer "randomOutput". Check equality of buffer "randomOutput" with contents of buffer "digestOutput". Note: Check buffering of available output bytes. Set "_OutputLen" to decimal value "12". Call B_GenerateRandomBytes passing "randomAlgorithm" and address of next free byte in "randomOutput" and "_OutputLen" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Baldwin Informational, Expires 12/25/1999 76 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Set "_ExpectedStatus" to zero. Increment length of "randomOutput" by "_OutputLen". Finalize "randomOutput". Display buffer "randomOutput". Check equality of buffer "randomOutput" with hex value "bb6e5d9c97a90efe660477ea". Set "_OutputLen" to decimal value "32". Call B_GenerateRandomBytes passing "randomAlgorithm" and address of next free byte in "randomOutput" and "_OutputLen" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of "randomOutput" by "_OutputLen". Finalize "randomOutput". Display buffer "randomOutput". Check equality of buffer "randomOutput" with hex value "fdd7d3084a708d50bf142042f6c999b231bc8c66a8429d4afd93179c1d10c31 0". Note: Compute expected result for subsequent values Set buffer "digestOutput" to hex value "3238a25051baa87ca3455dc0 22feae66". Call B_DigestUpdate passing "digestAlgorithm" and address of first initialized byte in buffer "digestOutput" and length of initialized bytes in buffer "digestOutput" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_DigestFinal passing "digestAlgorithm" and address of next free byte in buffer "digestOutput" and address of "_OutputLen" and length of free bytes in buffer "digestOutput" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "digestOutput" by "_OutputLen". Finalize buffer "digestOutput". Display buffer "digestOutput". Check equality of buffer "digestOutput" with hex value "bb6e5d9c97a90efe660477eafdd7d308". Set buffer "digestOutput" to hex value "3238a25051baa87ca3455dc0 22feae67". Call B_DigestUpdate passing "digestAlgorithm" and address of first initialized byte in buffer "digestOutput" and length of initialized bytes in buffer "digestOutput" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_DigestFinal passing "digestAlgorithm" and address of Baldwin Informational, Expires 12/25/1999 77 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 next free byte in buffer "digestOutput" and address of "_OutputLen" and length of free bytes in buffer "digestOutput" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "digestOutput" by "_OutputLen". Finalize buffer "digestOutput". Display buffer "digestOutput". Check equality of buffer "digestOutput" with hex value "4a708d50bf142042f6c999b231bc8c66". Set buffer "digestOutput" to hex value "3238a25051baa87ca3455dc0 22feae68". Call B_DigestUpdate passing "digestAlgorithm" and address of first initialized byte in buffer "digestOutput" and length of initialized bytes in buffer "digestOutput" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_DigestFinal passing "digestAlgorithm" and address of next free byte in buffer "digestOutput" and address of "_OutputLen" and length of free bytes in buffer "digestOutput" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "digestOutput" by "_OutputLen". Finalize buffer "digestOutput". Display buffer "digestOutput". Check equality of buffer "digestOutput" with hex value "a8429d4afd93179c1d10c31056ec9606". Note: ---------------------------------------------------------- Note: ------- Note: - For a given 100 byte seed check the result against the Note: expected MD2 operations. Generate 16, 12, 32 bytes. Note: Seed the generator Call Call B_RandomInit passing "randomAlgorithm" and "_Chooser" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set buffer "bigSeed" to hex value "01020304050607080910010203040 5060708091001020304050607080910010203040506070809100102030405060 7080910010203040506070809100102030405060708091001020304050607080 9100102030405060708091001020304050607080910". Call B_RandomUpdate passing "randomAlgorithm" and address of first initialized byte in "bigSeed" and length of initialized bytes in "bigSeed" and "_SurrenderContext". Set "_Status" to return value. Baldwin Informational, Expires 12/25/1999 78 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Note: Compute expected result Call Call B_DigestInit passing "digestAlgorithm" and "NULL_PTR" and "_Chooser" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_DigestUpdate passing "digestAlgorithm" and address of first initialized byte in buffer "bigSeed" and length of initialized bytes in buffer "bigSeed" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_DigestFinal passing "digestAlgorithm" and address of next free byte in buffer "digestOutput" and address of "_OutputLen" and length of free bytes in buffer "digestOutput" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "digestOutput" by "_OutputLen". Finalize buffer "digestOutput". Display buffer "digestOutput". Check equality of buffer "digestOutput" with hex value "ea04d524b856cf388246997ea7946295". Call B_DigestUpdate passing "digestAlgorithm" and address of first initialized byte in buffer "digestOutput" and length of initialized bytes in buffer "digestOutput" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_DigestFinal passing "digestAlgorithm" and address of next free byte in buffer "digestOutput" and address of "_OutputLen" and length of free bytes in buffer "digestOutput" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "digestOutput" by "_OutputLen". Finalize buffer "digestOutput". Display buffer "digestOutput". Check equality of buffer "digestOutput" with hex value "0d2dc33854380f4d3c7f79896fecdc7e". Note: Generate random values Set "_OutputLen" to decimal value "16". Call B_GenerateRandomBytes passing "randomAlgorithm" and address of next free byte in "randomOutput" and "_OutputLen" Baldwin Informational, Expires 12/25/1999 79 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of "randomOutput" by "_OutputLen". Finalize "randomOutput". Display buffer "randomOutput". Check equality of buffer "randomOutput" with contents of buffer "digestOutput". Note: Check buffering of available output bytes. Set "_OutputLen" to decimal value "12". Call B_GenerateRandomBytes passing "randomAlgorithm" and address of next free byte in "randomOutput" and "_OutputLen" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of "randomOutput" by "_OutputLen". Finalize "randomOutput". Display buffer "randomOutput". Check equality of buffer "randomOutput" with hex value "b265099d7511e8d82b831d61". Set "_OutputLen" to decimal value "32". Call B_GenerateRandomBytes passing "randomAlgorithm" and address of next free byte in "randomOutput" and "_OutputLen" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of "randomOutput" by "_OutputLen". Finalize "randomOutput". Display buffer "randomOutput". Check equality of buffer "randomOutput" with hex value "6ee6449da723bac4922a13ec71a984d5d596cbc189433d94b3f0f12fd6dd530 5". Note: Compute expected result for subsequent values Set buffer "digestOutput" to hex value "ea04d524b856cf388246997e a7946296". Call B_DigestUpdate passing "digestAlgorithm" and address of first initialized byte in buffer "digestOutput" and length of initialized bytes in buffer "digestOutput" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_DigestFinal passing "digestAlgorithm" and address of next free byte in buffer "digestOutput" and address of "_OutputLen" and length of free bytes in buffer "digestOutput" and "_SurrenderContext". Baldwin Informational, Expires 12/25/1999 80 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "digestOutput" by "_OutputLen". Finalize buffer "digestOutput". Display buffer "digestOutput". Check equality of buffer "digestOutput" with hex value "b265099d7511e8d82b831d616ee6449d". Set buffer "digestOutput" to hex value "ea04d524b856cf388246997e a7946297". Call B_DigestUpdate passing "digestAlgorithm" and address of first initialized byte in buffer "digestOutput" and length of initialized bytes in buffer "digestOutput" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_DigestFinal passing "digestAlgorithm" and address of next free byte in buffer "digestOutput" and address of "_OutputLen" and length of free bytes in buffer "digestOutput" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "digestOutput" by "_OutputLen". Finalize buffer "digestOutput". Display buffer "digestOutput". Check equality of buffer "digestOutput" with hex value "a723bac4922a13ec71a984d5d596cbc1". Set buffer "digestOutput" to hex value "ea04d524b856cf388246997e a7946298". Call B_DigestUpdate passing "digestAlgorithm" and address of first initialized byte in buffer "digestOutput" and length of initialized bytes in buffer "digestOutput" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_DigestFinal passing "digestAlgorithm" and address of next free byte in buffer "digestOutput" and address of "_OutputLen" and length of free bytes in buffer "digestOutput" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "digestOutput" by "_OutputLen". Finalize buffer "digestOutput". Display buffer "digestOutput". Check equality of buffer "digestOutput" with hex value "89433d94b3f0f12fd6dd53059cc78c96". Note: ---------------------------------------------------------- Note: ------- Baldwin Informational, Expires 12/25/1999 81 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Note: - Check the result for a two bytes seed passed as two Note: calls to RandomUpdate matches one call. Generate 48 Note: bytes. Note: Seed the generator Call Call B_RandomInit passing "randomAlgorithm" and "_Chooser" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set buffer "oneByte" to hex value "12". Set buffer "twoBytes" to hex value "1212". Call B_RandomUpdate passing "randomAlgorithm" and address of first initialized byte in "oneByte" and length of initialized bytes in "oneByte" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_RandomUpdate passing "randomAlgorithm" and address of first initialized byte in "oneByte" and length of initialized bytes in "oneByte" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Note: Compute expected result Call Call B_DigestInit passing "digestAlgorithm" and "NULL_PTR" and "_Chooser" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_DigestUpdate passing "digestAlgorithm" and address of first initialized byte in buffer "twoBytes" and length of initialized bytes in buffer "twoBytes" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_DigestFinal passing "digestAlgorithm" and address of next free byte in buffer "digestOutput" and address of "_OutputLen" and length of free bytes in buffer "digestOutput" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "digestOutput" by "_OutputLen". Finalize buffer "digestOutput". Display buffer "digestOutput". Call B_DigestUpdate passing "digestAlgorithm" and address of first initialized byte in buffer "digestOutput" and length of initialized bytes in buffer "digestOutput" and "_SurrenderContext". Baldwin Informational, Expires 12/25/1999 82 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_DigestFinal passing "digestAlgorithm" and address of next free byte in buffer "digestOutput" and address of "_OutputLen" and length of free bytes in buffer "digestOutput" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "digestOutput" by "_OutputLen". Finalize buffer "digestOutput". Display buffer "digestOutput". Note: Generate random values Set "_OutputLen" to decimal value "16". Call B_GenerateRandomBytes passing "randomAlgorithm" and address of next free byte in "randomOutput" and "_OutputLen" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of "randomOutput" by "_OutputLen". Finalize "randomOutput". Display buffer "randomOutput". Check equality of buffer "randomOutput" with hex value "eccf29fc41d08258138218a46f3eb070". Note: Check incrementing state. Set "_OutputLen" to decimal value "16". Call B_GenerateRandomBytes passing "randomAlgorithm" and address of next free byte in "randomOutput" and "_OutputLen" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of "randomOutput" by "_OutputLen". Finalize "randomOutput". Display buffer "randomOutput". Check equality of buffer "randomOutput" with hex value "fd953e253b75afbf0dad460bb5e654ed". Note: Check incrementing state. Set "_OutputLen" to decimal value "16". Call B_GenerateRandomBytes passing "randomAlgorithm" and address of next free byte in "randomOutput" and "_OutputLen" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Baldwin Informational, Expires 12/25/1999 83 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Increment length of "randomOutput" by "_OutputLen". Finalize "randomOutput". Display buffer "randomOutput". Check equality of buffer "randomOutput" with hex value "72d9a38e80e63dd1b62b889b61972301". Note: ---------------------------------------------------------- Note: ------- Note: - Check adding new seed bytes after GenerateBytes call. Note: Call RandomUpdate twice and generate 32 bytes. Note: NOTE this in continued from the previous test. Call B_RandomUpdate passing "randomAlgorithm" and address of first initialized byte in "oneByte" and length of initialized bytes in "oneByte" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_RandomUpdate passing "randomAlgorithm" and address of first initialized byte in "oneByte" and length of initialized bytes in "oneByte" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Note: Generate random values Set "_OutputLen" to decimal value "16". Call B_GenerateRandomBytes passing "randomAlgorithm" and address of next free byte in "randomOutput" and "_OutputLen" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of "randomOutput" by "_OutputLen". Finalize "randomOutput". Display buffer "randomOutput". Check equality of buffer "randomOutput" with hex value "15b0a1c7931ca323304ca81b9080df47". Note: Check incrementing state. Set "_OutputLen" to decimal value "16". Call B_GenerateRandomBytes passing "randomAlgorithm" and address of next free byte in "randomOutput" and "_OutputLen" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of "randomOutput" by "_OutputLen". Finalize "randomOutput". Display buffer "randomOutput". Check equality of buffer "randomOutput" with hex value Baldwin Informational, Expires 12/25/1999 84 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 "c3c9320871f47a7d6408cce64fad29f7". Note: ---------------------------------------------------------- Note: ------- Note: Cleanup. Call Call B_DestroyAlgorithmObject passing "randomAlgorithm". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. This is the end of test case "TVMD2R00". This is the start of test case "TVMD2RX0". Set "_ExpectedStatus" to zero. Set "_Chooser" to "NULL_PTR". Set "_SurrenderContext" to "NULL_PTR". Note: Test vectors for AI_MD2Random. Note: Note there are different expected results for BSafe 3.0 Note: and BSafe 2.x. This file has the expected results for Note: BSafe 2.x. Note: Depends on: Note: AI_MD2 Note: AI_MD2Random Note: Test cases: Note: - For a given one byte seed check the result against the Note: expected MD2 operations. Generate 16, 12, 32 bytes. Note: - For a given 100 byte seed check the result against the Note: expected MD2 operations. Generate 16, 12, 32 bytes. Note: - Check the result for a two bytes seed passed as two Note: calls to RandomUpdate matches one call. Generate Note: 48 bytes to check state incrementing. Note: - Check adding new seed bytes after GenerateBytes call. Note: Call RandomUpdate twice and generate 32 bytes. Note: ---------------------------------------------------------- Note: ------- Note: Choose the BSafe 2.x AM Set "_Chooser" to "AM_MD2", "AM_MD2_RANDOM_2X", "NULL_PTR". Note: Start with the GlobalInit Set "_Chooser" to "AM_MD2", "AM_MD2_RANDOM_2X", "NULL_PTR". Note: Setup Data Objects Create buffer "oneByte" of decimal value "1" bytes. Create buffer "twoBytes" of decimal value "2" bytes. Create buffer "bigSeed" of decimal value "256" bytes. Baldwin Informational, Expires 12/25/1999 85 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Create buffer "randomOutput" of decimal value "1000" bytes. Create buffer "digestOutput" of decimal value "1000" bytes. Note: ---------------------------------------------------------- Note: ------- Note: Setup Algorithm Objects Create algorithm object "randomAlgorithm". Call B_CreateAlgorithmObject passing "randomAlgorithm". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set "_InfoPointer" to address of info structure for "AI_MD2Random" initialized from "NULL_PTR". Call B_SetAlgorithmInfo passing "randomAlgorithm" and "AI_MD2Random" and "_InfoPointer". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Create algorithm object "digestAlgorithm". Call B_CreateAlgorithmObject passing "digestAlgorithm". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set "_InfoPointer" to address of info structure for "AI_MD2" initialized from "NULL_PTR". Call B_SetAlgorithmInfo passing "digestAlgorithm" and "AI_MD2" and "_InfoPointer". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Note: ---------------------------------------------------------- Note: ------- Note: - For a given one byte seed check the result against the Note: expected MD2 operations. Note: Seed the generator Call Call B_RandomInit passing "randomAlgorithm" and "_Chooser" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set buffer "oneByte" to hex value "12". Call B_RandomUpdate passing "randomAlgorithm" and address of first initialized byte in "oneByte" and length of initialized bytes in "oneByte" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Note: Compute expected result Baldwin Informational, Expires 12/25/1999 86 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Call Call B_DigestInit passing "digestAlgorithm" and "NULL_PTR" and "_Chooser" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_DigestUpdate passing "digestAlgorithm" and address of first initialized byte in buffer "oneByte" and length of initialized bytes in buffer "oneByte" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_DigestFinal passing "digestAlgorithm" and address of next free byte in buffer "digestOutput" and address of "_OutputLen" and length of free bytes in buffer "digestOutput" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "digestOutput" by "_OutputLen". Finalize buffer "digestOutput". Display buffer "digestOutput". Check equality of buffer "digestOutput" with hex value "3238a25051baa87ca3455dc022feae65". Call B_DigestUpdate passing "digestAlgorithm" and address of first initialized byte in buffer "digestOutput" and length of initialized bytes in buffer "digestOutput" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_DigestFinal passing "digestAlgorithm" and address of next free byte in buffer "digestOutput" and address of "_OutputLen" and length of free bytes in buffer "digestOutput" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "digestOutput" by "_OutputLen". Finalize buffer "digestOutput". Display buffer "digestOutput". Check equality of buffer "digestOutput" with hex value "f68063d0de9ca6be78f7e5a9a0f8e81d". Note: Generate random values Set "_OutputLen" to decimal value "16". Call B_GenerateRandomBytes passing "randomAlgorithm" and address of next free byte in "randomOutput" and "_OutputLen" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of "randomOutput" by "_OutputLen". Baldwin Informational, Expires 12/25/1999 87 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Finalize "randomOutput". Display buffer "randomOutput". Check equality of buffer "randomOutput" with contents of buffer "digestOutput". Note: Check buffering of available output bytes. Set "_OutputLen" to decimal value "12". Call B_GenerateRandomBytes passing "randomAlgorithm" and address of next free byte in "randomOutput" and "_OutputLen" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of "randomOutput" by "_OutputLen". Finalize "randomOutput". Display buffer "randomOutput". Check equality of buffer "randomOutput" with hex value "bb6e5d9c97a90efe660477ea". Set "_OutputLen" to decimal value "32". Call B_GenerateRandomBytes passing "randomAlgorithm" and address of next free byte in "randomOutput" and "_OutputLen" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of "randomOutput" by "_OutputLen". Finalize "randomOutput". Display buffer "randomOutput". Check equality of buffer "randomOutput" with hex value "fdd7d3084a708d50bf142042f6c999b231bc8c66a8429d4afd93179c1d10c31 0". Note: Compute expected result for subsequent values Set buffer "digestOutput" to hex value "3238a25051baa87ca3455dc0 22feae66". Call B_DigestUpdate passing "digestAlgorithm" and address of first initialized byte in buffer "digestOutput" and length of initialized bytes in buffer "digestOutput" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_DigestFinal passing "digestAlgorithm" and address of next free byte in buffer "digestOutput" and address of "_OutputLen" and length of free bytes in buffer "digestOutput" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "digestOutput" by "_OutputLen". Finalize buffer "digestOutput". Baldwin Informational, Expires 12/25/1999 88 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Display buffer "digestOutput". Check equality of buffer "digestOutput" with hex value "bb6e5d9c97a90efe660477eafdd7d308". Set buffer "digestOutput" to hex value "3238a25051baa87ca3455dc0 22feae67". Call B_DigestUpdate passing "digestAlgorithm" and address of first initialized byte in buffer "digestOutput" and length of initialized bytes in buffer "digestOutput" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_DigestFinal passing "digestAlgorithm" and address of next free byte in buffer "digestOutput" and address of "_OutputLen" and length of free bytes in buffer "digestOutput" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "digestOutput" by "_OutputLen". Finalize buffer "digestOutput". Display buffer "digestOutput". Check equality of buffer "digestOutput" with hex value "4a708d50bf142042f6c999b231bc8c66". Set buffer "digestOutput" to hex value "3238a25051baa87ca3455dc0 22feae68". Call B_DigestUpdate passing "digestAlgorithm" and address of first initialized byte in buffer "digestOutput" and length of initialized bytes in buffer "digestOutput" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_DigestFinal passing "digestAlgorithm" and address of next free byte in buffer "digestOutput" and address of "_OutputLen" and length of free bytes in buffer "digestOutput" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "digestOutput" by "_OutputLen". Finalize buffer "digestOutput". Display buffer "digestOutput". Check equality of buffer "digestOutput" with hex value "a8429d4afd93179c1d10c31056ec9606". Note: ---------------------------------------------------------- Note: ------- Note: - For a given 100 byte seed check the result against the Note: expected MD2 operations. Generate 16, 12, 32 bytes. Note: Seed the generator Baldwin Informational, Expires 12/25/1999 89 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Call Call B_RandomInit passing "randomAlgorithm" and "_Chooser" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set buffer "bigSeed" to hex value "01020304050607080910010203040 5060708091001020304050607080910010203040506070809100102030405060 7080910010203040506070809100102030405060708091001020304050607080 9100102030405060708091001020304050607080910". Call B_RandomUpdate passing "randomAlgorithm" and address of first initialized byte in "bigSeed" and length of initialized bytes in "bigSeed" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Note: Compute expected result Call Call B_DigestInit passing "digestAlgorithm" and "NULL_PTR" and "_Chooser" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_DigestUpdate passing "digestAlgorithm" and address of first initialized byte in buffer "bigSeed" and length of initialized bytes in buffer "bigSeed" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_DigestFinal passing "digestAlgorithm" and address of next free byte in buffer "digestOutput" and address of "_OutputLen" and length of free bytes in buffer "digestOutput" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "digestOutput" by "_OutputLen". Finalize buffer "digestOutput". Display buffer "digestOutput". Check equality of buffer "digestOutput" with hex value "ea04d524b856cf388246997ea7946295". Call B_DigestUpdate passing "digestAlgorithm" and address of first initialized byte in buffer "digestOutput" and length of initialized bytes in buffer "digestOutput" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_DigestFinal passing "digestAlgorithm" and address of next free byte in buffer "digestOutput" and address of "_OutputLen" and length of free bytes in buffer "digestOutput" and "_SurrenderContext". Set "_Status" to return value. Baldwin Informational, Expires 12/25/1999 90 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "digestOutput" by "_OutputLen". Finalize buffer "digestOutput". Display buffer "digestOutput". Check equality of buffer "digestOutput" with hex value "0d2dc33854380f4d3c7f79896fecdc7e". Note: Generate random values Set "_OutputLen" to decimal value "16". Call B_GenerateRandomBytes passing "randomAlgorithm" and address of next free byte in "randomOutput" and "_OutputLen" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of "randomOutput" by "_OutputLen". Finalize "randomOutput". Display buffer "randomOutput". Check equality of buffer "randomOutput" with contents of buffer "digestOutput". Note: Check buffering of available output bytes. Set "_OutputLen" to decimal value "12". Call B_GenerateRandomBytes passing "randomAlgorithm" and address of next free byte in "randomOutput" and "_OutputLen" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of "randomOutput" by "_OutputLen". Finalize "randomOutput". Display buffer "randomOutput". Check equality of buffer "randomOutput" with hex value "b265099d7511e8d82b831d61". Set "_OutputLen" to decimal value "32". Call B_GenerateRandomBytes passing "randomAlgorithm" and address of next free byte in "randomOutput" and "_OutputLen" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of "randomOutput" by "_OutputLen". Finalize "randomOutput". Display buffer "randomOutput". Check equality of buffer "randomOutput" with hex value "6ee6449da723bac4922a13ec71a984d5d596cbc189433d94b3f0f12fd6dd530 5". Note: Compute expected result for subsequent values Baldwin Informational, Expires 12/25/1999 91 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Set buffer "digestOutput" to hex value "ea04d524b856cf388246997e a7946296". Call B_DigestUpdate passing "digestAlgorithm" and address of first initialized byte in buffer "digestOutput" and length of initialized bytes in buffer "digestOutput" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_DigestFinal passing "digestAlgorithm" and address of next free byte in buffer "digestOutput" and address of "_OutputLen" and length of free bytes in buffer "digestOutput" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "digestOutput" by "_OutputLen". Finalize buffer "digestOutput". Display buffer "digestOutput". Check equality of buffer "digestOutput" with hex value "b265099d7511e8d82b831d616ee6449d". Set buffer "digestOutput" to hex value "ea04d524b856cf388246997e a7946297". Call B_DigestUpdate passing "digestAlgorithm" and address of first initialized byte in buffer "digestOutput" and length of initialized bytes in buffer "digestOutput" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_DigestFinal passing "digestAlgorithm" and address of next free byte in buffer "digestOutput" and address of "_OutputLen" and length of free bytes in buffer "digestOutput" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "digestOutput" by "_OutputLen". Finalize buffer "digestOutput". Display buffer "digestOutput". Check equality of buffer "digestOutput" with hex value "a723bac4922a13ec71a984d5d596cbc1". Set buffer "digestOutput" to hex value "ea04d524b856cf388246997e a7946298". Call B_DigestUpdate passing "digestAlgorithm" and address of first initialized byte in buffer "digestOutput" and length of initialized bytes in buffer "digestOutput" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_DigestFinal passing "digestAlgorithm" and address of next free byte in buffer "digestOutput" and address of Baldwin Informational, Expires 12/25/1999 92 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 "_OutputLen" and length of free bytes in buffer "digestOutput" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "digestOutput" by "_OutputLen". Finalize buffer "digestOutput". Display buffer "digestOutput". Check equality of buffer "digestOutput" with hex value "89433d94b3f0f12fd6dd53059cc78c96". Note: ---------------------------------------------------------- Note: ------- Note: - Check the result for a two bytes seed passed as two Note: calls to RandomUpdate matches one call. Generate 48 Note: bytes. Note: Seed the generator Call Call B_RandomInit passing "randomAlgorithm" and "_Chooser" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set buffer "oneByte" to hex value "12". Set buffer "twoBytes" to hex value "1212". Call B_RandomUpdate passing "randomAlgorithm" and address of first initialized byte in "oneByte" and length of initialized bytes in "oneByte" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_RandomUpdate passing "randomAlgorithm" and address of first initialized byte in "oneByte" and length of initialized bytes in "oneByte" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Note: Compute expected result Call Call B_DigestInit passing "digestAlgorithm" and "NULL_PTR" and "_Chooser" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_DigestUpdate passing "digestAlgorithm" and address of first initialized byte in buffer "twoBytes" and length of initialized bytes in buffer "twoBytes" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_DigestFinal passing "digestAlgorithm" and address of Baldwin Informational, Expires 12/25/1999 93 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 next free byte in buffer "digestOutput" and address of "_OutputLen" and length of free bytes in buffer "digestOutput" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "digestOutput" by "_OutputLen". Finalize buffer "digestOutput". Display buffer "digestOutput". Call B_DigestUpdate passing "digestAlgorithm" and address of first initialized byte in buffer "digestOutput" and length of initialized bytes in buffer "digestOutput" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_DigestFinal passing "digestAlgorithm" and address of next free byte in buffer "digestOutput" and address of "_OutputLen" and length of free bytes in buffer "digestOutput" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "digestOutput" by "_OutputLen". Finalize buffer "digestOutput". Display buffer "digestOutput". Note: Generate random values Set "_OutputLen" to decimal value "16". Call B_GenerateRandomBytes passing "randomAlgorithm" and address of next free byte in "randomOutput" and "_OutputLen" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of "randomOutput" by "_OutputLen". Finalize "randomOutput". Display buffer "randomOutput". Check equality of buffer "randomOutput" with hex value "f90fb28bd2b947ab518f36b9d1a29e15". Note: Check incrementing state. Set "_OutputLen" to decimal value "16". Call B_GenerateRandomBytes passing "randomAlgorithm" and address of next free byte in "randomOutput" and "_OutputLen" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of "randomOutput" by "_OutputLen". Finalize "randomOutput". Baldwin Informational, Expires 12/25/1999 94 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Display buffer "randomOutput". Check equality of buffer "randomOutput" with hex value "20d30acb63c3b8a99bae95aba6eeaa79". Note: Check incrementing state. Set "_OutputLen" to decimal value "16". Call B_GenerateRandomBytes passing "randomAlgorithm" and address of next free byte in "randomOutput" and "_OutputLen" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of "randomOutput" by "_OutputLen". Finalize "randomOutput". Display buffer "randomOutput". Check equality of buffer "randomOutput" with hex value "e7999274a64f621fb8e1afbd3dec379e". Note: ---------------------------------------------------------- Note: ------- Note: - Check adding new seed bytes after GenerateBytes call. Note: Call RandomUpdate twice and generate 32 bytes. Note: NOTE this in continued from the previous test. Call B_RandomUpdate passing "randomAlgorithm" and address of first initialized byte in "oneByte" and length of initialized bytes in "oneByte" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_RandomUpdate passing "randomAlgorithm" and address of first initialized byte in "oneByte" and length of initialized bytes in "oneByte" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Note: Generate random values Set "_OutputLen" to decimal value "16". Call B_GenerateRandomBytes passing "randomAlgorithm" and address of next free byte in "randomOutput" and "_OutputLen" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of "randomOutput" by "_OutputLen". Finalize "randomOutput". Display buffer "randomOutput". Check equality of buffer "randomOutput" with hex value "3e0c8de693c53a7f9172ec2b3f54c2fc". Baldwin Informational, Expires 12/25/1999 95 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Note: Check incrementing state. Set "_OutputLen" to decimal value "16". Call B_GenerateRandomBytes passing "randomAlgorithm" and address of next free byte in "randomOutput" and "_OutputLen" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of "randomOutput" by "_OutputLen". Finalize "randomOutput". Display buffer "randomOutput". Check equality of buffer "randomOutput" with hex value "0503fe51bb2c2c30e72f29bbe92857d0". Note: ---------------------------------------------------------- Note: ------- Note: Cleanup. Call Call B_DestroyAlgorithmObject passing "randomAlgorithm". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. This is the end of test case "TVMD2RX0". This is the start of test case "TVMD5R00". Set "_ExpectedStatus" to zero. Set "_Chooser" to "NULL_PTR". Set "_SurrenderContext" to "NULL_PTR". Note: Test vectors for AI_MD5Random. Note: Note there are different expected results for BSafe 3.0 Note: and BSafe 2.x. This file has the expected results for Note: BSafe 3.0. Note: Depends on: Note: AI_MD5 Note: AI_MD5Random Note: Test cases: Note: - For a given one byte seed check the result against the Note: expected MD5 operations. Generate 16, 12, 32 bytes. Note: - For a given 100 byte seed check the result against the Note: expected MD5 operations. Generate 16, 12, 32 bytes. Note: - Check the result for a two bytes seed passed as two Note: calls to RandomUpdate matches one call. Generate Note: 48 bytes to check state incrementing. Note: - Check adding new seed bytes after GenerateBytes call. Note: Call RandomUpdate twice and generate 32 bytes. Note: ---------------------------------------------------------- Note: ------- Baldwin Informational, Expires 12/25/1999 96 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Note: Start with the GlobalInit Set "_Chooser" to "AM_MD5", "AM_MD5_RANDOM", "NULL_PTR". Note: Setup Data Objects Create buffer "oneByte" of decimal value "1" bytes. Create buffer "twoBytes" of decimal value "2" bytes. Create buffer "bigSeed" of decimal value "256" bytes. Create buffer "randomOutput" of decimal value "1000" bytes. Create buffer "digestOutput" of decimal value "1000" bytes. Note: ---------------------------------------------------------- Note: ------- Note: Setup Algorithm Objects Create algorithm object "randomAlgorithm". Call B_CreateAlgorithmObject passing "randomAlgorithm". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set "_InfoPointer" to address of info structure for "AI_MD5Random" initialized from "NULL_PTR". Call B_SetAlgorithmInfo passing "randomAlgorithm" and "AI_MD5Random" and "_InfoPointer". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Create algorithm object "digestAlgorithm". Call B_CreateAlgorithmObject passing "digestAlgorithm". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set "_InfoPointer" to address of info structure for "AI_MD5" initialized from "NULL_PTR". Call B_SetAlgorithmInfo passing "digestAlgorithm" and "AI_MD5" and "_InfoPointer". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Note: ---------------------------------------------------------- Note: ------- Note: - For a given one byte seed check the result against the Note: expected MD5 operations. Note: Seed the generator Call Call B_RandomInit passing "randomAlgorithm" and "_Chooser" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set buffer "oneByte" to hex value "12". Baldwin Informational, Expires 12/25/1999 97 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Call B_RandomUpdate passing "randomAlgorithm" and address of first initialized byte in "oneByte" and length of initialized bytes in "oneByte" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Note: Compute expected result Call Call B_DigestInit passing "digestAlgorithm" and "NULL_PTR" and "_Chooser" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_DigestUpdate passing "digestAlgorithm" and address of first initialized byte in buffer "oneByte" and length of initialized bytes in buffer "oneByte" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_DigestFinal passing "digestAlgorithm" and address of next free byte in buffer "digestOutput" and address of "_OutputLen" and length of free bytes in buffer "digestOutput" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "digestOutput" by "_OutputLen". Finalize buffer "digestOutput". Display buffer "digestOutput". Check equality of buffer "digestOutput" with hex value "a8445619abd08f3ba0ebfcb31183f7f9". Call B_DigestUpdate passing "digestAlgorithm" and address of first initialized byte in buffer "digestOutput" and length of initialized bytes in buffer "digestOutput" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_DigestFinal passing "digestAlgorithm" and address of next free byte in buffer "digestOutput" and address of "_OutputLen" and length of free bytes in buffer "digestOutput" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "digestOutput" by "_OutputLen". Finalize buffer "digestOutput". Display buffer "digestOutput". Check equality of buffer "digestOutput" with hex value "8acde574aef013204fe182aa51ec69b5". Note: Generate random values Baldwin Informational, Expires 12/25/1999 98 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Set "_OutputLen" to decimal value "16". Call B_GenerateRandomBytes passing "randomAlgorithm" and address of next free byte in "randomOutput" and "_OutputLen" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of "randomOutput" by "_OutputLen". Finalize "randomOutput". Display buffer "randomOutput". Check equality of buffer "randomOutput" with contents of buffer "digestOutput". Note: Check buffering of available output bytes. Set "_OutputLen" to decimal value "12". Call B_GenerateRandomBytes passing "randomAlgorithm" and address of next free byte in "randomOutput" and "_OutputLen" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of "randomOutput" by "_OutputLen". Finalize "randomOutput". Display buffer "randomOutput". Check equality of buffer "randomOutput" with hex value "d726cd43c4f84ebc77113a7a". Set "_OutputLen" to decimal value "32". Call B_GenerateRandomBytes passing "randomAlgorithm" and address of next free byte in "randomOutput" and "_OutputLen" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of "randomOutput" by "_OutputLen". Finalize "randomOutput". Display buffer "randomOutput". Check equality of buffer "randomOutput" with hex value "c2274a2696bb57fcd2c25a05d496b22a7f24fa640fd54d23d487d412d277588 2". Note: Compute expected result for subsequent values Set buffer "digestOutput" to hex value "a8445619abd08f3ba0ebfcb3 1183f7fa". Call B_DigestUpdate passing "digestAlgorithm" and address of first initialized byte in buffer "digestOutput" and length of initialized bytes in buffer "digestOutput" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Baldwin Informational, Expires 12/25/1999 99 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Call B_DigestFinal passing "digestAlgorithm" and address of next free byte in buffer "digestOutput" and address of "_OutputLen" and length of free bytes in buffer "digestOutput" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "digestOutput" by "_OutputLen". Finalize buffer "digestOutput". Display buffer "digestOutput". Check equality of buffer "digestOutput" with hex value "d726cd43c4f84ebc77113a7ac2274a26". Set buffer "digestOutput" to hex value "a8445619abd08f3ba0ebfcb3 1183f7fb". Call B_DigestUpdate passing "digestAlgorithm" and address of first initialized byte in buffer "digestOutput" and length of initialized bytes in buffer "digestOutput" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_DigestFinal passing "digestAlgorithm" and address of next free byte in buffer "digestOutput" and address of "_OutputLen" and length of free bytes in buffer "digestOutput" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "digestOutput" by "_OutputLen". Finalize buffer "digestOutput". Display buffer "digestOutput". Check equality of buffer "digestOutput" with hex value "96bb57fcd2c25a05d496b22a7f24fa64". Set buffer "digestOutput" to hex value "a8445619abd08f3ba0ebfcb3 1183f7fc". Call B_DigestUpdate passing "digestAlgorithm" and address of first initialized byte in buffer "digestOutput" and length of initialized bytes in buffer "digestOutput" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_DigestFinal passing "digestAlgorithm" and address of next free byte in buffer "digestOutput" and address of "_OutputLen" and length of free bytes in buffer "digestOutput" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "digestOutput" by "_OutputLen". Finalize buffer "digestOutput". Display buffer "digestOutput". Check equality of buffer "digestOutput" with hex value Baldwin Informational, Expires 12/25/1999 100 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 "0fd54d23d487d412d27758823b728ee9". Note: ---------------------------------------------------------- Note: ------- Note: - For a given 100 byte seed check the result against the Note: expected MD5 operations. Generate 16, 12, 32 bytes. Note: Seed the generator Call Call B_RandomInit passing "randomAlgorithm" and "_Chooser" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set buffer "bigSeed" to hex value "01020304050607080910010203040 5060708091001020304050607080910010203040506070809100102030405060 7080910010203040506070809100102030405060708091001020304050607080 9100102030405060708091001020304050607080910". Call B_RandomUpdate passing "randomAlgorithm" and address of first initialized byte in "bigSeed" and length of initialized bytes in "bigSeed" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Note: Compute expected result Call Call B_DigestInit passing "digestAlgorithm" and "NULL_PTR" and "_Chooser" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_DigestUpdate passing "digestAlgorithm" and address of first initialized byte in buffer "bigSeed" and length of initialized bytes in buffer "bigSeed" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_DigestFinal passing "digestAlgorithm" and address of next free byte in buffer "digestOutput" and address of "_OutputLen" and length of free bytes in buffer "digestOutput" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "digestOutput" by "_OutputLen". Finalize buffer "digestOutput". Display buffer "digestOutput". Check equality of buffer "digestOutput" with hex value "524a61a4d4483b31ac7870fe608fe67f". Call B_DigestUpdate passing "digestAlgorithm" and address of first initialized byte in buffer "digestOutput" and length of initialized bytes in buffer "digestOutput" and Baldwin Informational, Expires 12/25/1999 101 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_DigestFinal passing "digestAlgorithm" and address of next free byte in buffer "digestOutput" and address of "_OutputLen" and length of free bytes in buffer "digestOutput" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "digestOutput" by "_OutputLen". Finalize buffer "digestOutput". Display buffer "digestOutput". Check equality of buffer "digestOutput" with hex value "5163b51d0d5e0b49ce2cc153249d2e98". Note: Generate random values Set "_OutputLen" to decimal value "16". Call B_GenerateRandomBytes passing "randomAlgorithm" and address of next free byte in "randomOutput" and "_OutputLen" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of "randomOutput" by "_OutputLen". Finalize "randomOutput". Display buffer "randomOutput". Check equality of buffer "randomOutput" with contents of buffer "digestOutput". Note: Check buffering of available output bytes. Set "_OutputLen" to decimal value "12". Call B_GenerateRandomBytes passing "randomAlgorithm" and address of next free byte in "randomOutput" and "_OutputLen" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of "randomOutput" by "_OutputLen". Finalize "randomOutput". Display buffer "randomOutput". Check equality of buffer "randomOutput" with hex value "611a19becad1de78b09ce0ee". Set "_OutputLen" to decimal value "32". Call B_GenerateRandomBytes passing "randomAlgorithm" and address of next free byte in "randomOutput" and "_OutputLen" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Baldwin Informational, Expires 12/25/1999 102 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Increment length of "randomOutput" by "_OutputLen". Finalize "randomOutput". Display buffer "randomOutput". Check equality of buffer "randomOutput" with hex value "dc0eeda18cc2db2329db2fd6f8b518d506892872e5e3f0b3fcc06f8f6d29b35 e". Note: Compute expected result for subsequent values Set buffer "digestOutput" to hex value "524a61a4d4483b31ac7870fe 608fe680". Call B_DigestUpdate passing "digestAlgorithm" and address of first initialized byte in buffer "digestOutput" and length of initialized bytes in buffer "digestOutput" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_DigestFinal passing "digestAlgorithm" and address of next free byte in buffer "digestOutput" and address of "_OutputLen" and length of free bytes in buffer "digestOutput" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "digestOutput" by "_OutputLen". Finalize buffer "digestOutput". Display buffer "digestOutput". Check equality of buffer "digestOutput" with hex value "611a19becad1de78b09ce0eedc0eeda1". Set buffer "digestOutput" to hex value "524a61a4d4483b31ac7870fe 608fe681". Call B_DigestUpdate passing "digestAlgorithm" and address of first initialized byte in buffer "digestOutput" and length of initialized bytes in buffer "digestOutput" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_DigestFinal passing "digestAlgorithm" and address of next free byte in buffer "digestOutput" and address of "_OutputLen" and length of free bytes in buffer "digestOutput" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "digestOutput" by "_OutputLen". Finalize buffer "digestOutput". Display buffer "digestOutput". Check equality of buffer "digestOutput" with hex value "8cc2db2329db2fd6f8b518d506892872". Set buffer "digestOutput" to hex value "524a61a4d4483b31ac7870fe 608fe682". Baldwin Informational, Expires 12/25/1999 103 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Call B_DigestUpdate passing "digestAlgorithm" and address of first initialized byte in buffer "digestOutput" and length of initialized bytes in buffer "digestOutput" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_DigestFinal passing "digestAlgorithm" and address of next free byte in buffer "digestOutput" and address of "_OutputLen" and length of free bytes in buffer "digestOutput" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "digestOutput" by "_OutputLen". Finalize buffer "digestOutput". Display buffer "digestOutput". Check equality of buffer "digestOutput" with hex value "e5e3f0b3fcc06f8f6d29b35e3d9d652a". Note: ---------------------------------------------------------- Note: ------- Note: - Check the result for a two bytes seed passed as two Note: calls to RandomUpdate matches one call. Generate 48 Note: bytes. Note: Seed the generator Call Call B_RandomInit passing "randomAlgorithm" and "_Chooser" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set buffer "oneByte" to hex value "12". Set buffer "twoBytes" to hex value "1212". Call B_RandomUpdate passing "randomAlgorithm" and address of first initialized byte in "oneByte" and length of initialized bytes in "oneByte" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_RandomUpdate passing "randomAlgorithm" and address of first initialized byte in "oneByte" and length of initialized bytes in "oneByte" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Note: Compute expected result Call Call B_DigestInit passing "digestAlgorithm" and "NULL_PTR" and "_Chooser" and "_SurrenderContext". Set "_Status" to return value. Baldwin Informational, Expires 12/25/1999 104 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_DigestUpdate passing "digestAlgorithm" and address of first initialized byte in buffer "twoBytes" and length of initialized bytes in buffer "twoBytes" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_DigestFinal passing "digestAlgorithm" and address of next free byte in buffer "digestOutput" and address of "_OutputLen" and length of free bytes in buffer "digestOutput" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "digestOutput" by "_OutputLen". Finalize buffer "digestOutput". Display buffer "digestOutput". Call B_DigestUpdate passing "digestAlgorithm" and address of first initialized byte in buffer "digestOutput" and length of initialized bytes in buffer "digestOutput" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_DigestFinal passing "digestAlgorithm" and address of next free byte in buffer "digestOutput" and address of "_OutputLen" and length of free bytes in buffer "digestOutput" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "digestOutput" by "_OutputLen". Finalize buffer "digestOutput". Display buffer "digestOutput". Note: Generate random values Set "_OutputLen" to decimal value "16". Call B_GenerateRandomBytes passing "randomAlgorithm" and address of next free byte in "randomOutput" and "_OutputLen" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of "randomOutput" by "_OutputLen". Finalize "randomOutput". Display buffer "randomOutput". Check equality of buffer "randomOutput" with contents of buffer "digestOutput". Note: Check incrementing state. Baldwin Informational, Expires 12/25/1999 105 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Set "_OutputLen" to decimal value "16". Call B_GenerateRandomBytes passing "randomAlgorithm" and address of next free byte in "randomOutput" and "_OutputLen" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of "randomOutput" by "_OutputLen". Finalize "randomOutput". Display buffer "randomOutput". Check equality of buffer "randomOutput" with hex value "8d7e8ea536685ec32e5935167b53fe2d". Note: Check incrementing state. Set "_OutputLen" to decimal value "16". Call B_GenerateRandomBytes passing "randomAlgorithm" and address of next free byte in "randomOutput" and "_OutputLen" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of "randomOutput" by "_OutputLen". Finalize "randomOutput". Display buffer "randomOutput". Check equality of buffer "randomOutput" with hex value "838d1fb10127c5d82578763633362e9e". Note: ---------------------------------------------------------- Note: ------- Note: - Check adding new seed bytes after GenerateBytes call. Note: Call RandomUpdate twice and generate 32 bytes. Note: NOTE this in continued from the previous test. Call B_RandomUpdate passing "randomAlgorithm" and address of first initialized byte in "oneByte" and length of initialized bytes in "oneByte" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_RandomUpdate passing "randomAlgorithm" and address of first initialized byte in "oneByte" and length of initialized bytes in "oneByte" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Note: Generate random values Set "_OutputLen" to decimal value "16". Call B_GenerateRandomBytes passing "randomAlgorithm" and address of next free byte in "randomOutput" and "_OutputLen" and "_SurrenderContext". Baldwin Informational, Expires 12/25/1999 106 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of "randomOutput" by "_OutputLen". Finalize "randomOutput". Display buffer "randomOutput". Check equality of buffer "randomOutput" with hex value "575f1385fd30489fe3b8bd31d3cc033d". Note: Check incrementing state. Set "_OutputLen" to decimal value "16". Call B_GenerateRandomBytes passing "randomAlgorithm" and address of next free byte in "randomOutput" and "_OutputLen" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of "randomOutput" by "_OutputLen". Finalize "randomOutput". Display buffer "randomOutput". Check equality of buffer "randomOutput" with hex value "1c4165877827f7b37b388046740fe7c2". Note: ---------------------------------------------------------- Note: ------- Note: Cleanup. Call Call B_DestroyAlgorithmObject passing "randomAlgorithm". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. This is the end of test case "TVMD5R00". This is the start of test case "TVMD5RX0". Set "_ExpectedStatus" to zero. Set "_Chooser" to "NULL_PTR". Set "_SurrenderContext" to "NULL_PTR". Note: Test vectors for AI_MD5Random. Note: Note there are different expected results for BSafe 3.0 Note: and BSafe 2.x. This file has the expected results for Note: BSafe 2.x. Note: Depends on: Note: AI_MD5 Note: AI_MD5Random Note: Test cases: Note: - For a given one byte seed check the result against the Note: expected MD5 operations. Generate 16, 12, 32 bytes. Note: - For a given 100 byte seed check the result against the Note: expected MD5 operations. Generate 16, 12, 32 bytes. Baldwin Informational, Expires 12/25/1999 107 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Note: - Check the result for a two bytes seed passed as two Note: calls to RandomUpdate matches one call. Generate Note: 48 bytes to check state incrementing. Note: - Check adding new seed bytes after GenerateBytes call. Note: Call RandomUpdate twice and generate 32 bytes. Note: ---------------------------------------------------------- Note: ------- Note: Choose the BSafe 2.x AM Set "_Chooser" to "AM_MD5", "AM_MD5_RANDOM_2X", "NULL_PTR". Note: Start with the GlobalInit Set "_Chooser" to "AM_MD5", "AM_MD5_RANDOM_2X", "NULL_PTR". Note: Setup Data Objects Create buffer "oneByte" of decimal value "1" bytes. Create buffer "twoBytes" of decimal value "2" bytes. Create buffer "bigSeed" of decimal value "256" bytes. Create buffer "randomOutput" of decimal value "1000" bytes. Create buffer "digestOutput" of decimal value "1000" bytes. Note: ---------------------------------------------------------- Note: ------- Note: Setup Algorithm Objects Create algorithm object "randomAlgorithm". Call B_CreateAlgorithmObject passing "randomAlgorithm". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set "_InfoPointer" to address of info structure for "AI_MD5Random" initialized from "NULL_PTR". Call B_SetAlgorithmInfo passing "randomAlgorithm" and "AI_MD5Random" and "_InfoPointer". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Create algorithm object "digestAlgorithm". Call B_CreateAlgorithmObject passing "digestAlgorithm". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set "_InfoPointer" to address of info structure for "AI_MD5" initialized from "NULL_PTR". Call B_SetAlgorithmInfo passing "digestAlgorithm" and "AI_MD5" and "_InfoPointer". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Baldwin Informational, Expires 12/25/1999 108 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Note: ---------------------------------------------------------- Note: ------- Note: - For a given one byte seed check the result against the Note: expected MD5 operations. Note: Seed the generator Call Call B_RandomInit passing "randomAlgorithm" and "_Chooser" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set buffer "oneByte" to hex value "12". Call B_RandomUpdate passing "randomAlgorithm" and address of first initialized byte in "oneByte" and length of initialized bytes in "oneByte" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Note: Compute expected result Call Call B_DigestInit passing "digestAlgorithm" and "NULL_PTR" and "_Chooser" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_DigestUpdate passing "digestAlgorithm" and address of first initialized byte in buffer "oneByte" and length of initialized bytes in buffer "oneByte" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_DigestFinal passing "digestAlgorithm" and address of next free byte in buffer "digestOutput" and address of "_OutputLen" and length of free bytes in buffer "digestOutput" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "digestOutput" by "_OutputLen". Finalize buffer "digestOutput". Display buffer "digestOutput". Check equality of buffer "digestOutput" with hex value "a8445619abd08f3ba0ebfcb31183f7f9". Call B_DigestUpdate passing "digestAlgorithm" and address of first initialized byte in buffer "digestOutput" and length of initialized bytes in buffer "digestOutput" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_DigestFinal passing "digestAlgorithm" and address of Baldwin Informational, Expires 12/25/1999 109 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 next free byte in buffer "digestOutput" and address of "_OutputLen" and length of free bytes in buffer "digestOutput" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "digestOutput" by "_OutputLen". Finalize buffer "digestOutput". Display buffer "digestOutput". Check equality of buffer "digestOutput" with hex value "8acde574aef013204fe182aa51ec69b5". Note: Generate random values Set "_OutputLen" to decimal value "16". Call B_GenerateRandomBytes passing "randomAlgorithm" and address of next free byte in "randomOutput" and "_OutputLen" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of "randomOutput" by "_OutputLen". Finalize "randomOutput". Display buffer "randomOutput". Check equality of buffer "randomOutput" with contents of buffer "digestOutput". Note: Check buffering of available output bytes. Set "_OutputLen" to decimal value "12". Call B_GenerateRandomBytes passing "randomAlgorithm" and address of next free byte in "randomOutput" and "_OutputLen" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of "randomOutput" by "_OutputLen". Finalize "randomOutput". Display buffer "randomOutput". Check equality of buffer "randomOutput" with hex value "d726cd43c4f84ebc77113a7a". Set "_OutputLen" to decimal value "32". Call B_GenerateRandomBytes passing "randomAlgorithm" and address of next free byte in "randomOutput" and "_OutputLen" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of "randomOutput" by "_OutputLen". Finalize "randomOutput". Display buffer "randomOutput". Check equality of buffer "randomOutput" with hex value "c2274a2696bb57fcd2c25a05d496b22a7f24fa640fd54d23d487d412d277588 Baldwin Informational, Expires 12/25/1999 110 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 2". Note: Compute expected result for subsequent values Set buffer "digestOutput" to hex value "a8445619abd08f3ba0ebfcb3 1183f7fa". Call B_DigestUpdate passing "digestAlgorithm" and address of first initialized byte in buffer "digestOutput" and length of initialized bytes in buffer "digestOutput" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_DigestFinal passing "digestAlgorithm" and address of next free byte in buffer "digestOutput" and address of "_OutputLen" and length of free bytes in buffer "digestOutput" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "digestOutput" by "_OutputLen". Finalize buffer "digestOutput". Display buffer "digestOutput". Check equality of buffer "digestOutput" with hex value "d726cd43c4f84ebc77113a7ac2274a26". Set buffer "digestOutput" to hex value "a8445619abd08f3ba0ebfcb3 1183f7fb". Call B_DigestUpdate passing "digestAlgorithm" and address of first initialized byte in buffer "digestOutput" and length of initialized bytes in buffer "digestOutput" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_DigestFinal passing "digestAlgorithm" and address of next free byte in buffer "digestOutput" and address of "_OutputLen" and length of free bytes in buffer "digestOutput" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "digestOutput" by "_OutputLen". Finalize buffer "digestOutput". Display buffer "digestOutput". Check equality of buffer "digestOutput" with hex value "96bb57fcd2c25a05d496b22a7f24fa64". Set buffer "digestOutput" to hex value "a8445619abd08f3ba0ebfcb3 1183f7fc". Call B_DigestUpdate passing "digestAlgorithm" and address of first initialized byte in buffer "digestOutput" and length of initialized bytes in buffer "digestOutput" and "_SurrenderContext". Set "_Status" to return value. Baldwin Informational, Expires 12/25/1999 111 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_DigestFinal passing "digestAlgorithm" and address of next free byte in buffer "digestOutput" and address of "_OutputLen" and length of free bytes in buffer "digestOutput" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "digestOutput" by "_OutputLen". Finalize buffer "digestOutput". Display buffer "digestOutput". Check equality of buffer "digestOutput" with hex value "0fd54d23d487d412d27758823b728ee9". Note: ---------------------------------------------------------- Note: ------- Note: - For a given 100 byte seed check the result against the Note: expected MD5 operations. Generate 16, 12, 32 bytes. Note: Seed the generator Call Call B_RandomInit passing "randomAlgorithm" and "_Chooser" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set buffer "bigSeed" to hex value "01020304050607080910010203040 5060708091001020304050607080910010203040506070809100102030405060 7080910010203040506070809100102030405060708091001020304050607080 9100102030405060708091001020304050607080910". Call B_RandomUpdate passing "randomAlgorithm" and address of first initialized byte in "bigSeed" and length of initialized bytes in "bigSeed" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Note: Compute expected result Call Call B_DigestInit passing "digestAlgorithm" and "NULL_PTR" and "_Chooser" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_DigestUpdate passing "digestAlgorithm" and address of first initialized byte in buffer "bigSeed" and length of initialized bytes in buffer "bigSeed" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_DigestFinal passing "digestAlgorithm" and address of next free byte in buffer "digestOutput" and address of Baldwin Informational, Expires 12/25/1999 112 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 "_OutputLen" and length of free bytes in buffer "digestOutput" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "digestOutput" by "_OutputLen". Finalize buffer "digestOutput". Display buffer "digestOutput". Check equality of buffer "digestOutput" with hex value "524a61a4d4483b31ac7870fe608fe67f". Call B_DigestUpdate passing "digestAlgorithm" and address of first initialized byte in buffer "digestOutput" and length of initialized bytes in buffer "digestOutput" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_DigestFinal passing "digestAlgorithm" and address of next free byte in buffer "digestOutput" and address of "_OutputLen" and length of free bytes in buffer "digestOutput" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "digestOutput" by "_OutputLen". Finalize buffer "digestOutput". Display buffer "digestOutput". Check equality of buffer "digestOutput" with hex value "5163b51d0d5e0b49ce2cc153249d2e98". Note: Generate random values Set "_OutputLen" to decimal value "16". Call B_GenerateRandomBytes passing "randomAlgorithm" and address of next free byte in "randomOutput" and "_OutputLen" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of "randomOutput" by "_OutputLen". Finalize "randomOutput". Display buffer "randomOutput". Check equality of buffer "randomOutput" with contents of buffer "digestOutput". Note: Check buffering of available output bytes. Set "_OutputLen" to decimal value "12". Call B_GenerateRandomBytes passing "randomAlgorithm" and address of next free byte in "randomOutput" and "_OutputLen" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Baldwin Informational, Expires 12/25/1999 113 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Set "_ExpectedStatus" to zero. Increment length of "randomOutput" by "_OutputLen". Finalize "randomOutput". Display buffer "randomOutput". Check equality of buffer "randomOutput" with hex value "611a19becad1de78b09ce0ee". Set "_OutputLen" to decimal value "32". Call B_GenerateRandomBytes passing "randomAlgorithm" and address of next free byte in "randomOutput" and "_OutputLen" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of "randomOutput" by "_OutputLen". Finalize "randomOutput". Display buffer "randomOutput". Check equality of buffer "randomOutput" with hex value "dc0eeda18cc2db2329db2fd6f8b518d506892872e5e3f0b3fcc06f8f6d29b35 e". Note: Compute expected result for subsequent values Set buffer "digestOutput" to hex value "524a61a4d4483b31ac7870fe 608fe680". Call B_DigestUpdate passing "digestAlgorithm" and address of first initialized byte in buffer "digestOutput" and length of initialized bytes in buffer "digestOutput" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_DigestFinal passing "digestAlgorithm" and address of next free byte in buffer "digestOutput" and address of "_OutputLen" and length of free bytes in buffer "digestOutput" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "digestOutput" by "_OutputLen". Finalize buffer "digestOutput". Display buffer "digestOutput". Check equality of buffer "digestOutput" with hex value "611a19becad1de78b09ce0eedc0eeda1". Set buffer "digestOutput" to hex value "524a61a4d4483b31ac7870fe 608fe681". Call B_DigestUpdate passing "digestAlgorithm" and address of first initialized byte in buffer "digestOutput" and length of initialized bytes in buffer "digestOutput" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_DigestFinal passing "digestAlgorithm" and address of Baldwin Informational, Expires 12/25/1999 114 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 next free byte in buffer "digestOutput" and address of "_OutputLen" and length of free bytes in buffer "digestOutput" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "digestOutput" by "_OutputLen". Finalize buffer "digestOutput". Display buffer "digestOutput". Check equality of buffer "digestOutput" with hex value "8cc2db2329db2fd6f8b518d506892872". Set buffer "digestOutput" to hex value "524a61a4d4483b31ac7870fe 608fe682". Call B_DigestUpdate passing "digestAlgorithm" and address of first initialized byte in buffer "digestOutput" and length of initialized bytes in buffer "digestOutput" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_DigestFinal passing "digestAlgorithm" and address of next free byte in buffer "digestOutput" and address of "_OutputLen" and length of free bytes in buffer "digestOutput" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "digestOutput" by "_OutputLen". Finalize buffer "digestOutput". Display buffer "digestOutput". Check equality of buffer "digestOutput" with hex value "e5e3f0b3fcc06f8f6d29b35e3d9d652a". Note: ---------------------------------------------------------- Note: ------- Note: - Check the result for a two bytes seed passed as two Note: calls to RandomUpdate matches one call. Generate 48 Note: bytes. Note: Seed the generator Call Call B_RandomInit passing "randomAlgorithm" and "_Chooser" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set buffer "oneByte" to hex value "12". Set buffer "twoBytes" to hex value "1212". Call B_RandomUpdate passing "randomAlgorithm" and address of first initialized byte in "oneByte" and length of initialized bytes in "oneByte" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Baldwin Informational, Expires 12/25/1999 115 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Set "_ExpectedStatus" to zero. Call B_RandomUpdate passing "randomAlgorithm" and address of first initialized byte in "oneByte" and length of initialized bytes in "oneByte" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Note: Compute expected result Call Call B_DigestInit passing "digestAlgorithm" and "NULL_PTR" and "_Chooser" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_DigestUpdate passing "digestAlgorithm" and address of first initialized byte in buffer "twoBytes" and length of initialized bytes in buffer "twoBytes" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_DigestFinal passing "digestAlgorithm" and address of next free byte in buffer "digestOutput" and address of "_OutputLen" and length of free bytes in buffer "digestOutput" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "digestOutput" by "_OutputLen". Finalize buffer "digestOutput". Display buffer "digestOutput". Call B_DigestUpdate passing "digestAlgorithm" and address of first initialized byte in buffer "digestOutput" and length of initialized bytes in buffer "digestOutput" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_DigestFinal passing "digestAlgorithm" and address of next free byte in buffer "digestOutput" and address of "_OutputLen" and length of free bytes in buffer "digestOutput" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "digestOutput" by "_OutputLen". Finalize buffer "digestOutput". Display buffer "digestOutput". Note: Generate random values Set "_OutputLen" to decimal value "16". Call B_GenerateRandomBytes passing "randomAlgorithm" and Baldwin Informational, Expires 12/25/1999 116 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 address of next free byte in "randomOutput" and "_OutputLen" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of "randomOutput" by "_OutputLen". Finalize "randomOutput". Display buffer "randomOutput". Check equality of buffer "randomOutput" with hex value "8a4ffc0a687886737471aaf56e4cf00e". Note: Check incrementing state. Set "_OutputLen" to decimal value "16". Call B_GenerateRandomBytes passing "randomAlgorithm" and address of next free byte in "randomOutput" and "_OutputLen" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of "randomOutput" by "_OutputLen". Finalize "randomOutput". Display buffer "randomOutput". Check equality of buffer "randomOutput" with hex value "9dbc89de920b3b25ac76d4bbac0d07c2". Note: Check incrementing state. Set "_OutputLen" to decimal value "16". Call B_GenerateRandomBytes passing "randomAlgorithm" and address of next free byte in "randomOutput" and "_OutputLen" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of "randomOutput" by "_OutputLen". Finalize "randomOutput". Display buffer "randomOutput". Check equality of buffer "randomOutput" with hex value "4ba70d8b917eba2a773221f05d9ba801". Note: ---------------------------------------------------------- Note: ------- Note: - Check adding new seed bytes after GenerateBytes call. Note: Call RandomUpdate twice and generate 32 bytes. Note: NOTE this in continued from the previous test. Call B_RandomUpdate passing "randomAlgorithm" and address of first initialized byte in "oneByte" and length of initialized bytes in "oneByte" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Baldwin Informational, Expires 12/25/1999 117 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Call B_RandomUpdate passing "randomAlgorithm" and address of first initialized byte in "oneByte" and length of initialized bytes in "oneByte" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Note: Generate random values Set "_OutputLen" to decimal value "16". Call B_GenerateRandomBytes passing "randomAlgorithm" and address of next free byte in "randomOutput" and "_OutputLen" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of "randomOutput" by "_OutputLen". Finalize "randomOutput". Display buffer "randomOutput". Check equality of buffer "randomOutput" with hex value "1149e830ebd0bc369c93972546848056". Note: Check incrementing state. Set "_OutputLen" to decimal value "16". Call B_GenerateRandomBytes passing "randomAlgorithm" and address of next free byte in "randomOutput" and "_OutputLen" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of "randomOutput" by "_OutputLen". Finalize "randomOutput". Display buffer "randomOutput". Check equality of buffer "randomOutput" with hex value "e750dd1984707fc77eca05341abab605". Note: ---------------------------------------------------------- Note: ------- Note: Cleanup. Call Call B_DestroyAlgorithmObject passing "randomAlgorithm". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. This is the end of test case "TVMD5RX0". This is the start of test case "TVOAEP01". Set "_ExpectedStatus" to zero. Set "_Chooser" to "NULL_PTR". Set "_SurrenderContext" to "NULL_PTR". Note: OAEP Encode/Decode vectors test Baldwin Informational, Expires 12/25/1999 118 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Note: This script pads the message in "inputData" to the size Note: of "expected result" Note: using PKCS #1 V2.0 encryption padding. Note: ------------------------------------------------------- Create algorithm object "pkcsoaep". Call B_CreateAlgorithmObject passing "pkcsoaep". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Create buffer "seedValue" of decimal value "20" bytes. Create buffer "encodedData" of decimal value "700" bytes. Create buffer "decodedData" of decimal value "700" bytes. Create buffer "expectedResult" of decimal value "700" bytes. Create buffer "inputData" of decimal value "700" bytes. Set buffer "inputData" with string value "Copyright (c) 1991-1998 RSA Data Security, a Security Dynamics Company. License to copy this document is not granted to anyone unless the proper authority at RSA or Security Dynamics says so; and then you are not allowed to do anything with this document that the aforementioned authority person says that you can do. So there. Like you would really want to rip off a Btest script anyway, eh? Hey! Go get your own test data.". Set buffer "seedValue" to hex value "919191919191919191919191919 1919191919191". Set buffer "expectedResult" to hex value "005a4c67ca990e9d2ab09a d19cae81261a8ab8ce05daaf717b3ec7d6db71e719c1040afb8921b64552629a df68eb9ad1fcd6ab2e394e98594c6844180ab6b0bf726e1ac1e93394ae600ac9 8c33328d08bfb086fad41add244e861608056dfa36894ac70bffa7441ed48f59 9ccc0b255cdeb353b162e1c4b26748e9476f0f4e883b85437473aff1c0396ae8 dd960841dda166655ba8aa684097c783fdadf7b39c4bb464094b7d8b356e6846 1243d74e2f5c3046bbac5fb1f60edb1c82472309390e28458723c404065e4972 e6568c3f6ac98bfa05f9829d0fff337bcca1841db95a5af3e42c761fd94e1f2a 157f85622c9e9c534c7b57d46c8d3d4ce839ad9a0773925ad9566f3da79a593a bba40379818df05cbbf39fd4a44c35cba3139d6474f908170249b9f29ebc3d40 9d22e9a3dfec8a170645fff1ef94e58b986593b629d367f9e2c1152142f7c770 b7f307228b45b2c46cccdcf9d2989c1706b032359e01d296f122280c65287f3f cfd4c2bebca09b4a137e6d05c9264f8ee13548ddf4c1e3a47d185ec6d9e0b65a c7f523b126d4c29a83d4a41bc7740ba7b0b225172702faab8922bc7e0f09f756 38fbd9eb29f2d52255cefe30394f7fde37b6f911f7959da6d866123fe2af4e79 f486af65839f9f9d9f8920dd0ad7fac72357abbf64aaa34cd8b02b513a54451a 6590178185179dbf3c961d5106ea7cd088900aa61362df91eb70e9b8f0987a7c 34f7a89bc2d842ae7438449599a1cbe3e762b437a07fe8b422f76a202f4519d0 7524374ac395d44a01b81c40dc97166299e1a8c95f7f1cf330b1a99d43a7bf54 873a23ea140b7d7a5d6bf1bf4b57adbf86b594d59e91a9a9dcb99d64df64a7af 9704a51680739a1e8944ab0167b9f9601b0425ed1675c30808fcd634122cca4c 87b080331aa149cc10864f4f47fb6ac51ff941cc940bd1280def33652d7528b9 01ecd2cb752f43339bc2cf2f191330b817". Baldwin Informational, Expires 12/25/1999 119 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Note: Test a single encode and decode cycle against Note: a test vector and for functional reciprocity. Set "_InfoPointer" to address of info structure for "AI_PKCS_OAEPRecode" initialized from "sha1", "mgf1", "sha1", "specifiedParameters",. Call B_SetAlgorithmInfo passing "pkcsoaep" and "AI_PKCS_OAEPRecode" and "_InfoPointer". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call Call B_EncodeInit passing "pkcsoaep". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_EncodeUpdate passing "pkcsoaep" and address of next free byte in buffer "inputData" and address of "_OutputLen" and length of free bytes in buffer "inputData" and address of first initialized byte in buffer "inputData" and length of initialized bytes in buffer "inputData" Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "inputData" by "_OutputLen". Call B_EncodeUpdate passing "pkcsoaep" and address of next free byte in buffer "seedValue" and address of "_OutputLen" and length of free bytes in buffer "seedValue" and address of first initialized byte in buffer "seedValue" and length of initialized bytes in buffer "seedValue" Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "seedValue" by "_OutputLen". Call B_EncodeFinal passing "pkcsoaep" and address of next free byte in buffer "encodedData" and address of "_OutputLen" and length of free bytes in buffer "encodedData" Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "encodedData" by "_OutputLen". Finalize buffer "encodedData". Check equality of buffer "expectedResult" with contents of buffer "encodedData". Call Call B_DecodeInit passing "pkcsoaep". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_DecodeUpdate passing "pkcsoaep" and address of next free byte in buffer "encodedData" and address of "_OutputLen" and length of free bytes in buffer "encodedData" and address of Baldwin Informational, Expires 12/25/1999 120 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 first initialized byte in buffer "encodedData" and length of initialized bytes in buffer "encodedData" Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "encodedData" by "_OutputLen". Call B_DecodeFinal passing "pkcsoaep" and address of next free byte in buffer "decodedData" and address of "_OutputLen" and length of free bytes in buffer "decodedData" Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "decodedData" by "_OutputLen". Finalize buffer "decodedData". Check equality of buffer "inputData" with contents of buffer "decodedData". Call Call B_DestroyAlgorithmObject passing "pkcsoaep". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Note: Test a encode and decode with multiple updates against Note: a test vector and for functional reciprocity. Create algorithm object "pkcsoaep". Call B_CreateAlgorithmObject passing "pkcsoaep". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Create buffer "seedValue" of decimal value "20" bytes. Create buffer "encodedData" of decimal value "700" bytes. Create buffer "decodedData" of decimal value "700" bytes. Create buffer "inputData1" of decimal value "100" bytes. Create buffer "inputData2" of decimal value "100" bytes. Create buffer "inputData3" of decimal value "100" bytes. Create buffer "inputData4" of decimal value "100" bytes. Create buffer "inputData5" of decimal value "100" bytes. Create buffer "inputData6" of decimal value "100" bytes. Create buffer "inputData7" of decimal value "100" bytes. Create buffer "inputData8" of decimal value "100" bytes. Set buffer "inputData1" with string value "Copyright (c) 1991-1998 RSA Data Secur". Baldwin Informational, Expires 12/25/1999 121 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Set buffer "inputData2" with string value "ity, a Security Dynamics Company. License to copy this document ". Set buffer "inputData3" with string value "is not granted to anyone unless the proper authority at RSA or S". Set buffer "inputData4" with string value "ecurity Dynamics says so; and then you are not allowed to do any". Set buffer "inputData5" with string value "thing with this document that the aforementioned authority perso". Set buffer "inputData6" with string value "n says that you can do. So there. Like you would really want to ". Set buffer "inputData7" with string value "rip off a Btest script anyway, eh? Hey! Go get your own test da". Set buffer "inputData8" with string value "ta.". Set buffer "seedValue" to hex value "919191919191919191919191919 1919191919191". Create buffer "expectedResult1" of decimal value "20" bytes. Create buffer "expectedResult2" of decimal value "700" bytes. Note: Initialize, set up expected and input data Set "_InfoPointer" to address of info structure for "AI_PKCS_OAEPRecode" initialized from "sha1", "mgf1", "sha1", "specifiedParameters",. Call B_SetAlgorithmInfo passing "pkcsoaep" and "AI_PKCS_OAEPRecode" and "_InfoPointer". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call Call B_EncodeInit passing "pkcsoaep". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_EncodeUpdate passing "pkcsoaep" and address of next free byte in buffer "inputData1" and address of "_OutputLen" and length of free bytes in buffer "inputData1" and address of first initialized byte in buffer "inputData1" and length of initialized bytes in buffer "inputData1" Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "inputData1" by "_OutputLen". Call B_EncodeUpdate passing "pkcsoaep" and address of next free byte in buffer "inputData2" and address of "_OutputLen" and length of free bytes in buffer "inputData2" and address of first initialized byte in buffer "inputData2" and length of initialized bytes in buffer "inputData2" Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Baldwin Informational, Expires 12/25/1999 122 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Increment length of buffer "inputData2" by "_OutputLen". Call B_EncodeUpdate passing "pkcsoaep" and address of next free byte in buffer "inputData3" and address of "_OutputLen" and length of free bytes in buffer "inputData3" and address of first initialized byte in buffer "inputData3" and length of initialized bytes in buffer "inputData3" Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "inputData3" by "_OutputLen". Call B_EncodeUpdate passing "pkcsoaep" and address of next free byte in buffer "inputData4" and address of "_OutputLen" and length of free bytes in buffer "inputData4" and address of first initialized byte in buffer "inputData4" and length of initialized bytes in buffer "inputData4" Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "inputData4" by "_OutputLen". Call B_EncodeUpdate passing "pkcsoaep" and address of next free byte in buffer "inputData5" and address of "_OutputLen" and length of free bytes in buffer "inputData5" and address of first initialized byte in buffer "inputData5" and length of initialized bytes in buffer "inputData5" Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "inputData5" by "_OutputLen". Call B_EncodeUpdate passing "pkcsoaep" and address of next free byte in buffer "inputData6" and address of "_OutputLen" and length of free bytes in buffer "inputData6" and address of first initialized byte in buffer "inputData6" and length of initialized bytes in buffer "inputData6" Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "inputData6" by "_OutputLen". Call B_EncodeUpdate passing "pkcsoaep" and address of next free byte in buffer "inputData7" and address of "_OutputLen" and length of free bytes in buffer "inputData7" and address of first initialized byte in buffer "inputData7" and length of initialized bytes in buffer "inputData7" Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "inputData7" by "_OutputLen". Call B_EncodeUpdate passing "pkcsoaep" and address of next free byte in buffer "inputData8" and address of "_OutputLen" and length of free bytes in buffer "inputData8" and address of first initialized byte in buffer "inputData8" and length of initialized bytes in buffer "inputData8" Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Baldwin Informational, Expires 12/25/1999 123 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Set "_ExpectedStatus" to zero. Increment length of buffer "inputData8" by "_OutputLen". Call B_EncodeUpdate passing "pkcsoaep" and address of next free byte in buffer "seedValue" and address of "_OutputLen" and length of free bytes in buffer "seedValue" and address of first initialized byte in buffer "seedValue" and length of initialized bytes in buffer "seedValue" Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "seedValue" by "_OutputLen". Call B_EncodeFinal passing "pkcsoaep" and address of next free byte in buffer "encodedData" and address of "_OutputLen" and length of free bytes in buffer "encodedData" Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "encodedData" by "_OutputLen". Finalize buffer "encodedData". Call Call B_DecodeInit passing "pkcsoaep". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_DecodeUpdate passing "pkcsoaep" and address of next free byte in buffer "encodedData" and address of "_OutputLen" and length of free bytes in buffer "encodedData" and address of first initialized byte in buffer "encodedData" and length of initialized bytes in buffer "encodedData" Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "encodedData" by "_OutputLen". Call B_DecodeFinal passing "pkcsoaep" and address of next free byte in buffer "decodedData" and address of "_OutputLen" and length of free bytes in buffer "decodedData" Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "decodedData" by "_OutputLen". Finalize buffer "decodedData". Check equality of buffer "inputData" with contents of buffer "decodedData". This is the end of test case "TVOAEP01". This is the start of test case "TVOAEP02". Set "_ExpectedStatus" to zero. Set "_Chooser" to "NULL_PTR". Set "_SurrenderContext" to "NULL_PTR". Baldwin Informational, Expires 12/25/1999 124 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Note: OAEP Encode/Decode vectors test with BER initialization. Note: This script pads the message in "inputData" to the size Note: of "expected result" Note: using PKCS #1 V2.0 encryption padding. Note: ------------------------------------------------------- Create algorithm object "pkcsoaep". Call B_CreateAlgorithmObject passing "pkcsoaep". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Create buffer "seedValue" of decimal value "20" bytes. Create buffer "encodedData" of decimal value "700" bytes. Create buffer "decodedData" of decimal value "700" bytes. Create buffer "expectedResult" of decimal value "700" bytes. Create buffer "inputData" of decimal value "700" bytes. Set buffer "inputData" with string value "Copyright (c) 1991-1998 RSA Data Security, a Security Dynamics Company. License to copy this document is not granted to anyone unless the proper authority at RSA or Security Dynamics says so; and then you are not allowed to do anything with this document that the aforementioned authority person says that you can do. So there. Like you would really want to rip off a Btest script anyway, eh? Hey! Go get your own test data.". Set buffer "seedValue" to hex value "919191919191919191919191919 1919191919191". Set buffer "expectedResult" to hex value "005a4c67ca990e9d2ab09a d19cae81261a8ab8ce05daaf717b3ec7d6db71e719c1040afb8921b64552629a df68eb9ad1fcd6ab2e394e98594c6844180ab6b0bf726e1ac1e93394ae600ac9 8c33328d08bfb086fad41add244e861608056dfa36894ac70bffa7441ed48f59 9ccc0b255cdeb353b162e1c4b26748e9476f0f4e883b85437473aff1c0396ae8 dd960841dda166655ba8aa684097c783fdadf7b39c4bb464094b7d8b356e6846 1243d74e2f5c3046bbac5fb1f60edb1c82472309390e28458723c404065e4972 e6568c3f6ac98bfa05f9829d0fff337bcca1841db95a5af3e42c761fd94e1f2a 157f85622c9e9c534c7b57d46c8d3d4ce839ad9a0773925ad9566f3da79a593a bba40379818df05cbbf39fd4a44c35cba3139d6474f908170249b9f29ebc3d40 9d22e9a3dfec8a170645fff1ef94e58b986593b629d367f9e2c1152142f7c770 b7f307228b45b2c46cccdcf9d2989c1706b032359e01d296f122280c65287f3f cfd4c2bebca09b4a137e6d05c9264f8ee13548ddf4c1e3a47d185ec6d9e0b65a c7f523b126d4c29a83d4a41bc7740ba7b0b225172702faab8922bc7e0f09f756 38fbd9eb29f2d52255cefe30394f7fde37b6f911f7959da6d866123fe2af4e79 f486af65839f9f9d9f8920dd0ad7fac72357abbf64aaa34cd8b02b513a54451a 6590178185179dbf3c961d5106ea7cd088900aa61362df91eb70e9b8f0987a7c 34f7a89bc2d842ae7438449599a1cbe3e762b437a07fe8b422f76a202f4519d0 7524374ac395d44a01b81c40dc97166299e1a8c95f7f1cf330b1a99d43a7bf54 873a23ea140b7d7a5d6bf1bf4b57adbf86b594d59e91a9a9dcb99d64df64a7af Baldwin Informational, Expires 12/25/1999 125 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 9704a51680739a1e8944ab0167b9f9601b0425ed1675c30808fcd634122cca4c 87b080331aa149cc10864f4f47fb6ac51ff941cc940bd1280def33652d7528b9 01ecd2cb752f43339bc2cf2f191330b817". Note: Test a single encode and decode cycle against Note: a test vector and for functional reciprocity. Set "_InfoPointer" to address of info structure for "AI_PKCS_OAEPRecodeBER" initialized from "304506092a864886f70d01 01073038a00b300906052b0e03021a0500a118301606092a864886f70d010108 300906052b0e03021a0500a20f300d06092a864886f70d0101090400". Call B_SetAlgorithmInfo passing "pkcsoaep" and "AI_PKCS_OAEPRecodeBER" and "_InfoPointer". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set "_InfoPointer" to address of info structure for "AI_PKCS_OAEPRecode". Call B_GetAlgorithmInfo passing "_InfoPointer" and "pkcsoaep" and "AI_PKCS_OAEPRecode". Display info structure for "AI_PKCS_OAEPRecode". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call Call B_EncodeInit passing "pkcsoaep". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_EncodeUpdate passing "pkcsoaep" and address of next free byte in buffer "inputData" and address of "_OutputLen" and length of free bytes in buffer "inputData" and address of first initialized byte in buffer "inputData" and length of initialized bytes in buffer "inputData" Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "inputData" by "_OutputLen". Call B_EncodeUpdate passing "pkcsoaep" and address of next free byte in buffer "seedValue" and address of "_OutputLen" and length of free bytes in buffer "seedValue" and address of first initialized byte in buffer "seedValue" and length of initialized bytes in buffer "seedValue" Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "seedValue" by "_OutputLen". Call B_EncodeFinal passing "pkcsoaep" and address of next free byte in buffer "encodedData" and address of "_OutputLen" and length of free bytes in buffer "encodedData" Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Baldwin Informational, Expires 12/25/1999 126 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Set "_ExpectedStatus" to zero. Increment length of buffer "encodedData" by "_OutputLen". Finalize buffer "encodedData". Check equality of buffer "expectedResult" with contents of buffer "encodedData". Call Call B_DecodeInit passing "pkcsoaep". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_DecodeUpdate passing "pkcsoaep" and address of next free byte in buffer "encodedData" and address of "_OutputLen" and length of free bytes in buffer "encodedData" and address of first initialized byte in buffer "encodedData" and length of initialized bytes in buffer "encodedData" Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "encodedData" by "_OutputLen". Call B_DecodeFinal passing "pkcsoaep" and address of next free byte in buffer "decodedData" and address of "_OutputLen" and length of free bytes in buffer "decodedData" Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "decodedData" by "_OutputLen". Finalize buffer "decodedData". Check equality of buffer "inputData" with contents of buffer "decodedData". Call Call B_DestroyAlgorithmObject passing "pkcsoaep". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Note: Test a encode and decode with multiple updates against Note: a test vector and for functional reciprocity. Create algorithm object "pkcsoaep". Call B_CreateAlgorithmObject passing "pkcsoaep". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Create buffer "seedValue" of decimal value "20" bytes. Baldwin Informational, Expires 12/25/1999 127 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Create buffer "encodedData" of decimal value "700" bytes. Create buffer "decodedData" of decimal value "700" bytes. Create buffer "inputData1" of decimal value "100" bytes. Create buffer "inputData2" of decimal value "100" bytes. Create buffer "inputData3" of decimal value "100" bytes. Create buffer "inputData4" of decimal value "100" bytes. Create buffer "inputData5" of decimal value "100" bytes. Create buffer "inputData6" of decimal value "100" bytes. Create buffer "inputData7" of decimal value "100" bytes. Create buffer "inputData8" of decimal value "100" bytes. Set buffer "inputData1" with string value "Copyright (c) 1991-1998 RSA Data Secur". Set buffer "inputData2" with string value "ity, a Security Dynamics Company. License to copy this document ". Set buffer "inputData3" with string value "is not granted to anyone unless the proper authority at RSA or S". Set buffer "inputData4" with string value "ecurity Dynamics says so; and then you are not allowed to do any". Set buffer "inputData5" with string value "thing with this document that the aforementioned authority perso". Set buffer "inputData6" with string value "n says that you can do. So there. Like you would really want to ". Set buffer "inputData7" with string value "rip off a Btest script anyway, eh? Hey! Go get your own test da". Set buffer "inputData8" with string value "ta.". Set buffer "seedValue" to hex value "919191919191919191919191919 1919191919191". Create buffer "expectedResult1" of decimal value "20" bytes. Create buffer "expectedResult2" of decimal value "700" bytes. Note: Initialize, set up expected and input data Set "_InfoPointer" to address of info structure for "AI_PKCS_OAEPRecode" initialized from "sha1", "mgf1", "sha1", "specifiedParameters",. Call B_SetAlgorithmInfo passing "pkcsoaep" and "AI_PKCS_OAEPRecode" and "_InfoPointer". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call Call B_EncodeInit passing "pkcsoaep". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_EncodeUpdate passing "pkcsoaep" and address of next free byte in buffer "inputData1" and address of "_OutputLen" and length of free bytes in buffer "inputData1" and address of Baldwin Informational, Expires 12/25/1999 128 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 first initialized byte in buffer "inputData1" and length of initialized bytes in buffer "inputData1" Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "inputData1" by "_OutputLen". Call B_EncodeUpdate passing "pkcsoaep" and address of next free byte in buffer "inputData2" and address of "_OutputLen" and length of free bytes in buffer "inputData2" and address of first initialized byte in buffer "inputData2" and length of initialized bytes in buffer "inputData2" Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "inputData2" by "_OutputLen". Call B_EncodeUpdate passing "pkcsoaep" and address of next free byte in buffer "inputData3" and address of "_OutputLen" and length of free bytes in buffer "inputData3" and address of first initialized byte in buffer "inputData3" and length of initialized bytes in buffer "inputData3" Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "inputData3" by "_OutputLen". Call B_EncodeUpdate passing "pkcsoaep" and address of next free byte in buffer "inputData4" and address of "_OutputLen" and length of free bytes in buffer "inputData4" and address of first initialized byte in buffer "inputData4" and length of initialized bytes in buffer "inputData4" Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "inputData4" by "_OutputLen". Call B_EncodeUpdate passing "pkcsoaep" and address of next free byte in buffer "inputData5" and address of "_OutputLen" and length of free bytes in buffer "inputData5" and address of first initialized byte in buffer "inputData5" and length of initialized bytes in buffer "inputData5" Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "inputData5" by "_OutputLen". Call B_EncodeUpdate passing "pkcsoaep" and address of next free byte in buffer "inputData6" and address of "_OutputLen" and length of free bytes in buffer "inputData6" and address of first initialized byte in buffer "inputData6" and length of initialized bytes in buffer "inputData6" Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "inputData6" by "_OutputLen". Call B_EncodeUpdate passing "pkcsoaep" and address of next free byte in buffer "inputData7" and address of "_OutputLen" and Baldwin Informational, Expires 12/25/1999 129 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 length of free bytes in buffer "inputData7" and address of first initialized byte in buffer "inputData7" and length of initialized bytes in buffer "inputData7" Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "inputData7" by "_OutputLen". Call B_EncodeUpdate passing "pkcsoaep" and address of next free byte in buffer "inputData8" and address of "_OutputLen" and length of free bytes in buffer "inputData8" and address of first initialized byte in buffer "inputData8" and length of initialized bytes in buffer "inputData8" Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "inputData8" by "_OutputLen". Call B_EncodeUpdate passing "pkcsoaep" and address of next free byte in buffer "seedValue" and address of "_OutputLen" and length of free bytes in buffer "seedValue" and address of first initialized byte in buffer "seedValue" and length of initialized bytes in buffer "seedValue" Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "seedValue" by "_OutputLen". Call B_EncodeFinal passing "pkcsoaep" and address of next free byte in buffer "encodedData" and address of "_OutputLen" and length of free bytes in buffer "encodedData" Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "encodedData" by "_OutputLen". Finalize buffer "encodedData". Call Call B_DecodeInit passing "pkcsoaep". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_DecodeUpdate passing "pkcsoaep" and address of next free byte in buffer "encodedData" and address of "_OutputLen" and length of free bytes in buffer "encodedData" and address of first initialized byte in buffer "encodedData" and length of initialized bytes in buffer "encodedData" Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "encodedData" by "_OutputLen". Call B_DecodeFinal passing "pkcsoaep" and address of next free byte in buffer "decodedData" and address of "_OutputLen" and length of free bytes in buffer "decodedData" Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Baldwin Informational, Expires 12/25/1999 130 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Set "_ExpectedStatus" to zero. Increment length of buffer "decodedData" by "_OutputLen". Finalize buffer "decodedData". Check equality of buffer "inputData" with contents of buffer "decodedData". This is the end of test case "TVOAEP02". This is the start of test case "TVOAEP03". Set "_ExpectedStatus" to zero. Set "_Chooser" to "NULL_PTR". Set "_SurrenderContext" to "NULL_PTR". Note: OAEP Encode/Decode vectors test with BER initialization. Note: This script pads the message in "inputData" to the size Note: of "expected result" Note: using PKCS #1 V2.0 encryption padding. Note: ------------------------------------------------------- Create algorithm object "pkcsoaep". Call B_CreateAlgorithmObject passing "pkcsoaep". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Create buffer "seedValue" of decimal value "20" bytes. Create buffer "encodedData" of decimal value "700" bytes. Create buffer "decodedData" of decimal value "700" bytes. Create buffer "expectedResult" of decimal value "700" bytes. Create buffer "inputData" of decimal value "700" bytes. Create buffer "parmData" of decimal value "16" bytes. Set buffer "inputData" with string value "Copyright (c) 1991-1998 RSA Data Security, a Security Dynamics Company. License to copy this document is not granted to anyone unless the proper authority at RSA or Security Dynamics says so; and then you are not allowed to do anything with this document that the aforementioned authority person says that you can do. So there. Like you would really want to rip off a Btest script anyway, eh? Hey! Go get your own test data.". Set buffer "seedValue" to hex value "919191919191919191919191919 1919191919191". Set buffer "parmData" to hex value "0123456789abcdeffedcba987654 3210". Set buffer "expectedResult" to hex value "00f2d028637058956033ed Baldwin Informational, Expires 12/25/1999 131 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 15003f97692010379a9fecf612681074b7a1c6446f8ebcd4f5eb6a65511f629a df68eb9ad1fcd6ab2e394e98594c6844180ab6b0bf726e1ac1e93394ae600ac9 8c33328d08bfb086fad41add244e861608056dfa36894ac70bffa7441ed48f59 9ccc0b255cdeb353b162e1c4b26748e9476f0f4e883b85437473aff1c0396ae8 dd960841dda166655ba8aa684097c783fdadf7b39c4bb464094b7d8b356e6846 1243d74e2f5c3046bbac5fb1f60edb1c82472309390e28458723c404065e4972 e6568c3f6ac98bfa05f9829d0fff337bcca1841db95a5af3e42c761fd94e1f2a 157f85622c9e9c534c7b57d46c8d3d4ce839ad9a0773925ad9566f3da79a593a bba40379818df05cbbf39fd4a44c35cba3139d6474f908170249b9f29ebc3d40 9d22e9a3dfec8a170645fff1ef94e58b986593b629d367f9e2c1152142f7c770 b7f307228b45b2c46cccdcf9d2989c1706b032359e01d296f122280c65287f3f cfd4c2bebca09b4a137e6d05c9264f8ee13548ddf4c1e3a47d185ec6d9e0b65a c7f523b126d4c29a83d4a41bc7740ba7b0b225172702faab8922bc7e0f09f756 38fbd9eb29f2d52255cefe30394f7fde37b6f911f7959da6d866123fe2af4e79 f486af65839f9f9d9f8920dd0ad7fac72357abbf64aaa34cd8b02b513a54451a 6590178185179dbf3c961d5106ea7cd088900aa61362df91eb70e9b8f0987a7c 34f7a89bc2d842ae7438449599a1cbe3e762b437a07fe8b422f76a202f4519d0 7524374ac395d44a01b81c40dc97166299e1a8c95f7f1cf330b1a99d43a7bf54 873a23ea140b7d7a5d6bf1bf4b57adbf86b594d59e91a9a9dcb99d64df64a7af 9704a51680739a1e8944ab0167b9f9601b0425ed1675c30808fcd634122cca4c 87b080331aa149cc10864f4f47fb6ac51ff941cc940bd1280def33652d7528b9 01ecd2cb752f43339bc2cf2f191330b817". Note: Test a single encode and decode cycle against Note: a test vector and for functional reciprocity. Set "_InfoPointer" to address of info structure for "AI_PKCS_OAEPRecodeBER" initialized from "304806092a864886f70d01 0107303ba00b300906052b0e03021a0500a118301606092a864886f70d010108 300906052b0e03021a0500a212301006092a864886f70d0101090403012345". Call B_SetAlgorithmInfo passing "pkcsoaep" and "AI_PKCS_OAEPRecodeBER" and "_InfoPointer". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set "_InfoPointer" to address of info structure for "AI_PKCS_OAEPRecode". Call B_GetAlgorithmInfo passing "_InfoPointer" and "pkcsoaep" and "AI_PKCS_OAEPRecode". Display info structure for "AI_PKCS_OAEPRecode". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call Call B_EncodeInit passing "pkcsoaep". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_EncodeUpdate passing "pkcsoaep" and address of next free byte in buffer "inputData" and address of "_OutputLen" and length of free bytes in buffer "inputData" and address of first initialized byte in buffer "inputData" and length of Baldwin Informational, Expires 12/25/1999 132 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 initialized bytes in buffer "inputData" Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "inputData" by "_OutputLen". Call B_EncodeUpdate passing "pkcsoaep" and address of next free byte in buffer "seedValue" and address of "_OutputLen" and length of free bytes in buffer "seedValue" and address of first initialized byte in buffer "seedValue" and length of initialized bytes in buffer "seedValue" Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "seedValue" by "_OutputLen". Call B_EncodeFinal passing "pkcsoaep" and address of next free byte in buffer "encodedData" and address of "_OutputLen" and length of free bytes in buffer "encodedData" Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "encodedData" by "_OutputLen". Finalize buffer "encodedData". Check equality of buffer "expectedResult" with contents of buffer "encodedData". Call Call B_DecodeInit passing "pkcsoaep". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_DecodeUpdate passing "pkcsoaep" and address of next free byte in buffer "encodedData" and address of "_OutputLen" and length of free bytes in buffer "encodedData" and address of first initialized byte in buffer "encodedData" and length of initialized bytes in buffer "encodedData" Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "encodedData" by "_OutputLen". Call B_DecodeFinal passing "pkcsoaep" and address of next free byte in buffer "decodedData" and address of "_OutputLen" and length of free bytes in buffer "decodedData" Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "decodedData" by "_OutputLen". Finalize buffer "decodedData". Check equality of buffer "inputData" with contents of buffer "decodedData". Call Call B_DestroyAlgorithmObject passing "pkcsoaep". Set "_Status" to return value. Baldwin Informational, Expires 12/25/1999 133 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Note: Test a encode and decode with multiple updates against Note: a test vector and for functional reciprocity. Create algorithm object "pkcsoaep". Call B_CreateAlgorithmObject passing "pkcsoaep". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Create buffer "seedValue" of decimal value "20" bytes. Create buffer "encodedData" of decimal value "700" bytes. Create buffer "decodedData" of decimal value "700" bytes. Create buffer "inputData1" of decimal value "100" bytes. Create buffer "inputData2" of decimal value "100" bytes. Create buffer "inputData3" of decimal value "100" bytes. Create buffer "inputData4" of decimal value "100" bytes. Create buffer "inputData5" of decimal value "100" bytes. Create buffer "inputData6" of decimal value "100" bytes. Create buffer "inputData7" of decimal value "100" bytes. Create buffer "inputData8" of decimal value "100" bytes. Set buffer "inputData1" with string value "Copyright (c) 1991-1998 RSA Data Secur". Set buffer "inputData2" with string value "ity, a Security Dynamics Company. License to copy this document ". Set buffer "inputData3" with string value "is not granted to anyone unless the proper authority at RSA or S". Set buffer "inputData4" with string value "ecurity Dynamics says so; and then you are not allowed to do any". Set buffer "inputData5" with string value "thing with this document that the aforementioned authority perso". Set buffer "inputData6" with string value "n says that you can do. So there. Like you would really want to ". Set buffer "inputData7" with string value "rip off a Btest script anyway, eh? Hey! Go get your own test da". Set buffer "inputData8" with string value "ta.". Set buffer "seedValue" to hex value "919191919191919191919191919 1919191919191". Create buffer "expectedResult1" of decimal value "20" bytes. Create buffer "expectedResult2" of decimal value "700" bytes. Baldwin Informational, Expires 12/25/1999 134 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Note: Initialize, set up expected and input data Note: Should be able to decode properly without P-params Set "_InfoPointer" to address of info structure for "AI_PKCS_OAEPRecode" initialized from "sha1", "mgf1", "sha1", "specifiedParameters",. Call B_SetAlgorithmInfo passing "pkcsoaep" and "AI_PKCS_OAEPRecode" and "_InfoPointer". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set "_InfoPointer" to address of info structure for "AI_PKCS_OAEPRecodeBER". Call B_GetAlgorithmInfo passing "_InfoPointer" and "pkcsoaep" and "AI_PKCS_OAEPRecodeBER". Display info structure for "AI_PKCS_OAEPRecodeBER". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call Call B_EncodeInit passing "pkcsoaep". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_EncodeUpdate passing "pkcsoaep" and address of next free byte in buffer "inputData1" and address of "_OutputLen" and length of free bytes in buffer "inputData1" and address of first initialized byte in buffer "inputData1" and length of initialized bytes in buffer "inputData1" Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "inputData1" by "_OutputLen". Call B_EncodeUpdate passing "pkcsoaep" and address of next free byte in buffer "inputData2" and address of "_OutputLen" and length of free bytes in buffer "inputData2" and address of first initialized byte in buffer "inputData2" and length of initialized bytes in buffer "inputData2" Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "inputData2" by "_OutputLen". Call B_EncodeUpdate passing "pkcsoaep" and address of next free byte in buffer "inputData3" and address of "_OutputLen" and length of free bytes in buffer "inputData3" and address of first initialized byte in buffer "inputData3" and length of initialized bytes in buffer "inputData3" Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "inputData3" by "_OutputLen". Call B_EncodeUpdate passing "pkcsoaep" and address of next free Baldwin Informational, Expires 12/25/1999 135 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 byte in buffer "inputData4" and address of "_OutputLen" and length of free bytes in buffer "inputData4" and address of first initialized byte in buffer "inputData4" and length of initialized bytes in buffer "inputData4" Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "inputData4" by "_OutputLen". Call B_EncodeUpdate passing "pkcsoaep" and address of next free byte in buffer "inputData5" and address of "_OutputLen" and length of free bytes in buffer "inputData5" and address of first initialized byte in buffer "inputData5" and length of initialized bytes in buffer "inputData5" Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "inputData5" by "_OutputLen". Call B_EncodeUpdate passing "pkcsoaep" and address of next free byte in buffer "inputData6" and address of "_OutputLen" and length of free bytes in buffer "inputData6" and address of first initialized byte in buffer "inputData6" and length of initialized bytes in buffer "inputData6" Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "inputData6" by "_OutputLen". Call B_EncodeUpdate passing "pkcsoaep" and address of next free byte in buffer "inputData7" and address of "_OutputLen" and length of free bytes in buffer "inputData7" and address of first initialized byte in buffer "inputData7" and length of initialized bytes in buffer "inputData7" Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "inputData7" by "_OutputLen". Call B_EncodeUpdate passing "pkcsoaep" and address of next free byte in buffer "inputData8" and address of "_OutputLen" and length of free bytes in buffer "inputData8" and address of first initialized byte in buffer "inputData8" and length of initialized bytes in buffer "inputData8" Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "inputData8" by "_OutputLen". Call B_EncodeUpdate passing "pkcsoaep" and address of next free byte in buffer "seedValue" and address of "_OutputLen" and length of free bytes in buffer "seedValue" and address of first initialized byte in buffer "seedValue" and length of initialized bytes in buffer "seedValue" Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "seedValue" by "_OutputLen". Baldwin Informational, Expires 12/25/1999 136 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Call B_EncodeFinal passing "pkcsoaep" and address of next free byte in buffer "encodedData" and address of "_OutputLen" and length of free bytes in buffer "encodedData" Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "encodedData" by "_OutputLen". Finalize buffer "encodedData". Call Call B_DecodeInit passing "pkcsoaep". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_DecodeUpdate passing "pkcsoaep" and address of next free byte in buffer "encodedData" and address of "_OutputLen" and length of free bytes in buffer "encodedData" and address of first initialized byte in buffer "encodedData" and length of initialized bytes in buffer "encodedData" Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "encodedData" by "_OutputLen". Call B_DecodeFinal passing "pkcsoaep" and address of next free byte in buffer "decodedData" and address of "_OutputLen" and length of free bytes in buffer "decodedData" Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "decodedData" by "_OutputLen". Finalize buffer "decodedData". Check equality of buffer "inputData" with contents of buffer "decodedData". This is the end of test case "TVOAEP03". This is the start of test case "TVRC4MAC". Set "_ExpectedStatus" to zero. Set "_Chooser" to "NULL_PTR". Set "_SurrenderContext" to "NULL_PTR". Note: RC4 with MAC vectors test Note: ------------------------------------------------------- Note: Start with the GlobalInit Set "_Chooser" to "AM_RC4_ENCRYPT", "AM_RC4_DECRYPT", "AM_MAC", "AM_RC4_WITH_MAC_ENCRYPT", "AM_RC4_WITH_MAC_DECRYPT", Baldwin Informational, Expires 12/25/1999 137 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 "NULL_PTR". Create algorithm object "macAlg". Call B_CreateAlgorithmObject passing "macAlg". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Create algorithm object "rc4EncAlg". Call B_CreateAlgorithmObject passing "rc4EncAlg". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Create algorithm object "rc4MACEncAlg". Call B_CreateAlgorithmObject passing "rc4MACEncAlg". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Create algorithm object "rc4MACDecAlg". Call B_CreateAlgorithmObject passing "rc4MACDecAlg". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Create buffer "inputData" of decimal value "100" bytes. Create buffer "cypherText" of decimal value "100" bytes. Create buffer "expected" of decimal value "100" bytes. Create buffer "plainText" of decimal value "100" bytes. Create key object "rc4Key". Call B_CreateKeyObject passing "rc4Key". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Create key object "rc4MacKey". Call B_CreateKeyObject passing "rc4MacKey". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Create buffer "key8" of decimal value "8" bytes. Create buffer "key4" of decimal value "4" bytes. Create buffer "temp" of decimal value "16" bytes. Note: Case 1: Mac len = 4 Note: Initialize, set up expected and input data Note: The first 4 bytes of the key is the key for RC4WithMAC Note: algorithm. Note: The last 4 bytes is the salt for RC4WithMAC algorithm. Set buffer "key8" to hex value "fedcba9876543210". Set "_InfoPointer" to address of info structure for "KI_Item" initialized from contents of buffer "key8". Call B_SetKeyInfo passing "rc4Key" and "KI_Item" and "_InfoPointer". Baldwin Informational, Expires 12/25/1999 138 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set "_InfoPointer" to address of info structure for "AI_RC4" initialized from "NULL_PTR". Call B_SetAlgorithmInfo passing "rc4EncAlg" and "AI_RC4" and "_InfoPointer". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set "_InfoPointer" to address of info structure for "AI_MAC" initialized from "4". Call B_SetAlgorithmInfo passing "macAlg" and "AI_MAC" and "_InfoPointer". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set buffer "inputData" to hex value "0123456789abcdeffedcba98765 43210". Note: Simulate RC4 With MAC algorithm by first encrypt using Note: RC4 algorithm and Note: then MAC algorithm. Call Call B_EncryptInit passing "rc4EncAlg" and "rc4Key" and "_Chooser" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_EncryptUpdate passing "rc4EncAlg" and address of next free byte in buffer "expected" and address of "_OutputLen" and length of free bytes in buffer "expected" and address of first initialized byte in buffer "inputData" and length of initialized bytes in buffer "inputData" and "NULL_PTR" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "expected" by "_OutputLen". Call Call B_DigestInit passing "macAlg" and "rc4Key" and "_Chooser" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_DigestUpdate passing "macAlg" and address of first initialized byte in buffer "key8" and length of initialized bytes in buffer "key8" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_DigestUpdate passing "macAlg" and address of first Baldwin Informational, Expires 12/25/1999 139 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 initialized byte in buffer "inputData" and length of initialized bytes in buffer "inputData" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set buffer "temp" to hex value "00000000". Call B_DigestUpdate passing "macAlg" and address of first initialized byte in buffer "temp" and length of initialized bytes in buffer "temp" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_DigestFinal passing "macAlg" and address of next free byte in buffer "temp" and address of "_OutputLen" and length of free bytes in buffer "temp" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "temp" by "_OutputLen". Finalize buffer "temp". Call B_EncryptUpdate passing "rc4EncAlg" and address of next free byte in buffer "expected" and address of "_OutputLen" and length of free bytes in buffer "expected" and address of first initialized byte in buffer "temp" and length of initialized bytes in buffer "temp" and "NULL_PTR" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "expected" by "_OutputLen". Call B_EncryptFinal passing "rc4EncAlg" and address of next free byte in buffer "expected" and address of "_OutputLen" and length of free bytes in buffer "expected" and "NULL_PTR" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "expected" by "_OutputLen". Finalize buffer "expected". Note: Now encrypt the inputData using RC4 with MAC algorithm Set buffer "key4" to hex value "fedcba98". Set "_InfoPointer" to address of info structure for "KI_Item" initialized from contents of buffer "key4". Call B_SetKeyInfo passing "rc4MacKey" and "KI_Item" and "_InfoPointer". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set "_InfoPointer" to address of info structure for Baldwin Informational, Expires 12/25/1999 140 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 "AI_RC4WithMAC" initialized from "76543210", "4". Call B_SetAlgorithmInfo passing "rc4MACEncAlg" and "AI_RC4WithMAC" and "_InfoPointer". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set "_InfoPointer" to address of info structure for "AI_RC4WithMAC" initialized from "76543210", "4". Call B_SetAlgorithmInfo passing "rc4MACDecAlg" and "AI_RC4WithMAC" and "_InfoPointer". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call Call B_EncryptInit passing "rc4MACEncAlg" and "rc4MacKey" and "_Chooser" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_EncryptUpdate passing "rc4MACEncAlg" and address of next free byte in buffer "cypherText" and address of "_OutputLen" and length of free bytes in buffer "cypherText" and address of first initialized byte in buffer "inputData" and length of initialized bytes in buffer "inputData" and "NULL_PTR" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "cypherText" by "_OutputLen". Call B_EncryptFinal passing "rc4MACEncAlg" and address of next free byte in buffer "cypherText" and address of "_OutputLen" and length of free bytes in buffer "cypherText" and "NULL_PTR" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "cypherText" by "_OutputLen". Finalize buffer "cypherText". Check equality of buffer "cypherText" with contents of buffer "expected". Check equality of buffer "cypherText" with hex value "dae10fb4e886c6671003cb322806393d929f6334". Note: Decryption Call Call B_DecryptInit passing "rc4MACDecAlg" and "rc4MacKey" and "_Chooser" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_DecryptUpdate passing "rc4MACDecAlg" and address of next free byte in buffer "plainText" and address of "_OutputLen" and Baldwin Informational, Expires 12/25/1999 141 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 length of free bytes in buffer "plainText" and address of first initialized byte in buffer "cypherText" and length of initialized bytes in buffer "cypherText" and "NULL_PTR" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "plainText" by "_OutputLen". Call B_DecryptFinal passing "rc4MACDecAlg" and address of next free byte in buffer "plainText" and address of "_OutputLen" and length of free bytes in buffer "plainText" and "NULL_PTR" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "plainText" by "_OutputLen". Finalize buffer "plainText". Check equality of buffer "plainText" with contents of buffer "inputData". Note: Case 2: Mac len = 2 Note: Initialize, set up expected and input data Note: The first 4 bytes of the key is the key for RC4WithMAC Note: algorithm. Note: The last 4 bytes is the salt for RC4WithMAC algorithm. Call Call B_DestroyAlgorithmObject passing "macAlg". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call Call B_DestroyAlgorithmObject passing "rc4MACEncAlg". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call Call B_DestroyAlgorithmObject passing "rc4MACDecAlg". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Create algorithm object "macAlg". Call B_CreateAlgorithmObject passing "macAlg". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Create algorithm object "rc4MACEncAlg". Call B_CreateAlgorithmObject passing "rc4MACEncAlg". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Create algorithm object "rc4MACDecAlg". Call B_CreateAlgorithmObject passing "rc4MACDecAlg". Baldwin Informational, Expires 12/25/1999 142 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set "_InfoPointer" to address of info structure for "AI_RC4WithMAC" initialized from "76543210", "2". Call B_SetAlgorithmInfo passing "rc4MACEncAlg" and "AI_RC4WithMAC" and "_InfoPointer". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set "_InfoPointer" to address of info structure for "AI_RC4WithMAC" initialized from "76543210", "2". Call B_SetAlgorithmInfo passing "rc4MACDecAlg" and "AI_RC4WithMAC" and "_InfoPointer". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set "_InfoPointer" to address of info structure for "AI_MAC" initialized from "2". Call B_SetAlgorithmInfo passing "macAlg" and "AI_MAC" and "_InfoPointer". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set length of buffer "plainText" to decimal value "0". Set length of buffer "cypherText" to decimal value "0". Note: Simulate RC4 With MAC algorithm by first encrypt using Note: RC4 algorithm and Note: then MAC algorithm. Call Call B_EncryptInit passing "rc4EncAlg" and "rc4Key" and "_Chooser" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_EncryptUpdate passing "rc4EncAlg" and address of next free byte in buffer "expected" and address of "_OutputLen" and length of free bytes in buffer "expected" and address of first initialized byte in buffer "inputData" and length of initialized bytes in buffer "inputData" and "NULL_PTR" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "expected" by "_OutputLen". Call Call B_DigestInit passing "macAlg" and "rc4Key" and "_Chooser" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Baldwin Informational, Expires 12/25/1999 143 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Set "_ExpectedStatus" to zero. Call B_DigestUpdate passing "macAlg" and address of first initialized byte in buffer "key8" and length of initialized bytes in buffer "key8" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_DigestUpdate passing "macAlg" and address of first initialized byte in buffer "inputData" and length of initialized bytes in buffer "inputData" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set buffer "temp" to hex value "0000". Call B_DigestUpdate passing "macAlg" and address of first initialized byte in buffer "temp" and length of initialized bytes in buffer "temp" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_DigestFinal passing "macAlg" and address of next free byte in buffer "temp" and address of "_OutputLen" and length of free bytes in buffer "temp" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "temp" by "_OutputLen". Finalize buffer "temp". Call B_EncryptUpdate passing "rc4EncAlg" and address of next free byte in buffer "expected" and address of "_OutputLen" and length of free bytes in buffer "expected" and address of first initialized byte in buffer "temp" and length of initialized bytes in buffer "temp" and "NULL_PTR" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "expected" by "_OutputLen". Call B_EncryptFinal passing "rc4EncAlg" and address of next free byte in buffer "expected" and address of "_OutputLen" and length of free bytes in buffer "expected" and "NULL_PTR" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "expected" by "_OutputLen". Finalize buffer "expected". Note: Now encrypt the inputData using RC4 with MAC algorithm Call Call B_EncryptInit passing "rc4MACEncAlg" and "rc4MacKey" and "_Chooser" and "_SurrenderContext". Baldwin Informational, Expires 12/25/1999 144 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_EncryptUpdate passing "rc4MACEncAlg" and address of next free byte in buffer "cypherText" and address of "_OutputLen" and length of free bytes in buffer "cypherText" and address of first initialized byte in buffer "inputData" and length of initialized bytes in buffer "inputData" and "NULL_PTR" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "cypherText" by "_OutputLen". Call B_EncryptFinal passing "rc4MACEncAlg" and address of next free byte in buffer "cypherText" and address of "_OutputLen" and length of free bytes in buffer "cypherText" and "NULL_PTR" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "cypherText" by "_OutputLen". Finalize buffer "cypherText". Check equality of buffer "cypherText" with contents of buffer "expected". Check equality of buffer "cypherText" with hex value "dae10fb4e886c6671003cb322806393d6476". Note: Decryption Call Call B_DecryptInit passing "rc4MACDecAlg" and "rc4MacKey" and "_Chooser" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_DecryptUpdate passing "rc4MACDecAlg" and address of next free byte in buffer "plainText" and address of "_OutputLen" and length of free bytes in buffer "plainText" and address of first initialized byte in buffer "cypherText" and length of initialized bytes in buffer "cypherText" and "NULL_PTR" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "plainText" by "_OutputLen". Call B_DecryptFinal passing "rc4MACDecAlg" and address of next free byte in buffer "plainText" and address of "_OutputLen" and length of free bytes in buffer "plainText" and "NULL_PTR" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "plainText" by "_OutputLen". Baldwin Informational, Expires 12/25/1999 145 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Finalize buffer "plainText". Check equality of buffer "plainText" with contents of buffer "inputData". Note: Case 3: Mac len = 8 Note: Initialize, set up expected and input data Note: The first 4 bytes of the key is the key for RC4WithMAC Note: algorithm. Note: The last 4 bytes is the salt for RC4WithMAC algorithm. Call Call B_DestroyAlgorithmObject passing "macAlg". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call Call B_DestroyAlgorithmObject passing "rc4MACEncAlg". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call Call B_DestroyAlgorithmObject passing "rc4MACDecAlg". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Create algorithm object "macAlg". Call B_CreateAlgorithmObject passing "macAlg". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Create algorithm object "rc4MACEncAlg". Call B_CreateAlgorithmObject passing "rc4MACEncAlg". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Create algorithm object "rc4MACDecAlg". Call B_CreateAlgorithmObject passing "rc4MACDecAlg". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set "_InfoPointer" to address of info structure for "AI_RC4WithMAC" initialized from "76543210", "8". Call B_SetAlgorithmInfo passing "rc4MACEncAlg" and "AI_RC4WithMAC" and "_InfoPointer". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set "_InfoPointer" to address of info structure for "AI_RC4WithMAC" initialized from "76543210", "8". Call B_SetAlgorithmInfo passing "rc4MACDecAlg" and "AI_RC4WithMAC" and "_InfoPointer". Set "_Status" to return value. Baldwin Informational, Expires 12/25/1999 146 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set "_InfoPointer" to address of info structure for "AI_MAC" initialized from "8". Call B_SetAlgorithmInfo passing "macAlg" and "AI_MAC" and "_InfoPointer". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set length of buffer "plainText" to decimal value "0". Set length of buffer "cypherText" to decimal value "0". Note: Simulate RC4 With MAC algorithm by first encrypt using Note: RC4 algorithm and Note: then MAC algorithm. Call Call B_EncryptInit passing "rc4EncAlg" and "rc4Key" and "_Chooser" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_EncryptUpdate passing "rc4EncAlg" and address of next free byte in buffer "expected" and address of "_OutputLen" and length of free bytes in buffer "expected" and address of first initialized byte in buffer "inputData" and length of initialized bytes in buffer "inputData" and "NULL_PTR" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "expected" by "_OutputLen". Call Call B_DigestInit passing "macAlg" and "rc4Key" and "_Chooser" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_DigestUpdate passing "macAlg" and address of first initialized byte in buffer "key8" and length of initialized bytes in buffer "key8" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_DigestUpdate passing "macAlg" and address of first initialized byte in buffer "inputData" and length of initialized bytes in buffer "inputData" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set buffer "temp" to hex value "0000000000000000". Call B_DigestUpdate passing "macAlg" and address of first initialized byte in buffer "temp" and length of initialized Baldwin Informational, Expires 12/25/1999 147 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 bytes in buffer "temp" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_DigestFinal passing "macAlg" and address of next free byte in buffer "temp" and address of "_OutputLen" and length of free bytes in buffer "temp" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "temp" by "_OutputLen". Finalize buffer "temp". Call B_EncryptUpdate passing "rc4EncAlg" and address of next free byte in buffer "expected" and address of "_OutputLen" and length of free bytes in buffer "expected" and address of first initialized byte in buffer "temp" and length of initialized bytes in buffer "temp" and "NULL_PTR" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "expected" by "_OutputLen". Call B_EncryptFinal passing "rc4EncAlg" and address of next free byte in buffer "expected" and address of "_OutputLen" and length of free bytes in buffer "expected" and "NULL_PTR" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "expected" by "_OutputLen". Finalize buffer "expected". Note: Now encrypt the inputData using RC4 with MAC algorithm Call Call B_EncryptInit passing "rc4MACEncAlg" and "rc4MacKey" and "_Chooser" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_EncryptUpdate passing "rc4MACEncAlg" and address of next free byte in buffer "cypherText" and address of "_OutputLen" and length of free bytes in buffer "cypherText" and address of first initialized byte in buffer "inputData" and length of initialized bytes in buffer "inputData" and "NULL_PTR" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "cypherText" by "_OutputLen". Call B_EncryptFinal passing "rc4MACEncAlg" and address of next free byte in buffer "cypherText" and address of "_OutputLen" and length of free bytes in buffer "cypherText" and "NULL_PTR" Baldwin Informational, Expires 12/25/1999 148 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "cypherText" by "_OutputLen". Finalize buffer "cypherText". Check equality of buffer "cypherText" with contents of buffer "expected". Check equality of buffer "cypherText" with hex value "dae10fb4e886c6671003cb322806393d7110b2ab11b2db55". Note: Decryption Call Call B_DecryptInit passing "rc4MACDecAlg" and "rc4MacKey" and "_Chooser" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_DecryptUpdate passing "rc4MACDecAlg" and address of next free byte in buffer "plainText" and address of "_OutputLen" and length of free bytes in buffer "plainText" and address of first initialized byte in buffer "cypherText" and length of initialized bytes in buffer "cypherText" and "NULL_PTR" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "plainText" by "_OutputLen". Call B_DecryptFinal passing "rc4MACDecAlg" and address of next free byte in buffer "plainText" and address of "_OutputLen" and length of free bytes in buffer "plainText" and "NULL_PTR" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "plainText" by "_OutputLen". Finalize buffer "plainText". Check equality of buffer "plainText" with contents of buffer "inputData". Note: Case 4: Mac len = 16 Note: Initialize, set up expected and input data Note: The first 4 bytes of the key is the key for RC4WithMAC Note: algorithm. Note: The last 4 bytes is the salt for RC4WithMAC algorithm. Call Call B_DestroyAlgorithmObject passing "macAlg". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Baldwin Informational, Expires 12/25/1999 149 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Call Call B_DestroyAlgorithmObject passing "rc4MACEncAlg". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call Call B_DestroyAlgorithmObject passing "rc4MACDecAlg". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Create algorithm object "macAlg". Call B_CreateAlgorithmObject passing "macAlg". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Create algorithm object "rc4MACEncAlg". Call B_CreateAlgorithmObject passing "rc4MACEncAlg". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Create algorithm object "rc4MACDecAlg". Call B_CreateAlgorithmObject passing "rc4MACDecAlg". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set "_InfoPointer" to address of info structure for "AI_RC4WithMAC" initialized from "76543210", "16". Call B_SetAlgorithmInfo passing "rc4MACEncAlg" and "AI_RC4WithMAC" and "_InfoPointer". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set "_InfoPointer" to address of info structure for "AI_RC4WithMAC" initialized from "76543210", "16". Call B_SetAlgorithmInfo passing "rc4MACDecAlg" and "AI_RC4WithMAC" and "_InfoPointer". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set "_InfoPointer" to address of info structure for "AI_MAC" initialized from "16". Call B_SetAlgorithmInfo passing "macAlg" and "AI_MAC" and "_InfoPointer". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set length of buffer "plainText" to decimal value "0". Set length of buffer "cypherText" to decimal value "0". Note: Simulate RC4 With MAC algorithm by first encrypt using Note: RC4 algorithm and Note: then MAC algorithm. Baldwin Informational, Expires 12/25/1999 150 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Call Call B_EncryptInit passing "rc4EncAlg" and "rc4Key" and "_Chooser" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_EncryptUpdate passing "rc4EncAlg" and address of next free byte in buffer "expected" and address of "_OutputLen" and length of free bytes in buffer "expected" and address of first initialized byte in buffer "inputData" and length of initialized bytes in buffer "inputData" and "NULL_PTR" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "expected" by "_OutputLen". Call Call B_DigestInit passing "macAlg" and "rc4Key" and "_Chooser" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_DigestUpdate passing "macAlg" and address of first initialized byte in buffer "key8" and length of initialized bytes in buffer "key8" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_DigestUpdate passing "macAlg" and address of first initialized byte in buffer "inputData" and length of initialized bytes in buffer "inputData" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set buffer "temp" to hex value "00000000000000000000000000000000 ". Call B_DigestUpdate passing "macAlg" and address of first initialized byte in buffer "temp" and length of initialized bytes in buffer "temp" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_DigestFinal passing "macAlg" and address of next free byte in buffer "temp" and address of "_OutputLen" and length of free bytes in buffer "temp" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "temp" by "_OutputLen". Finalize buffer "temp". Call B_EncryptUpdate passing "rc4EncAlg" and address of next free byte in buffer "expected" and address of "_OutputLen" and Baldwin Informational, Expires 12/25/1999 151 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 length of free bytes in buffer "expected" and address of first initialized byte in buffer "temp" and length of initialized bytes in buffer "temp" and "NULL_PTR" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "expected" by "_OutputLen". Call B_EncryptFinal passing "rc4EncAlg" and address of next free byte in buffer "expected" and address of "_OutputLen" and length of free bytes in buffer "expected" and "NULL_PTR" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "expected" by "_OutputLen". Finalize buffer "expected". Note: Now encrypt the inputData using RC4 with MAC algorithm Call Call B_EncryptInit passing "rc4MACEncAlg" and "rc4MacKey" and "_Chooser" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_EncryptUpdate passing "rc4MACEncAlg" and address of next free byte in buffer "cypherText" and address of "_OutputLen" and length of free bytes in buffer "cypherText" and address of first initialized byte in buffer "inputData" and length of initialized bytes in buffer "inputData" and "NULL_PTR" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "cypherText" by "_OutputLen". Call B_EncryptFinal passing "rc4MACEncAlg" and address of next free byte in buffer "cypherText" and address of "_OutputLen" and length of free bytes in buffer "cypherText" and "NULL_PTR" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "cypherText" by "_OutputLen". Finalize buffer "cypherText". Check equality of buffer "cypherText" with contents of buffer "expected". Check equality of buffer "cypherText" with hex value "dae10fb4e886c6671003cb322806393dc339816703b3f0525fb5023177faa91 3". Note: Decryption Baldwin Informational, Expires 12/25/1999 152 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Call Call B_DecryptInit passing "rc4MACDecAlg" and "rc4MacKey" and "_Chooser" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_DecryptUpdate passing "rc4MACDecAlg" and address of next free byte in buffer "plainText" and address of "_OutputLen" and length of free bytes in buffer "plainText" and address of first initialized byte in buffer "cypherText" and length of initialized bytes in buffer "cypherText" and "NULL_PTR" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "plainText" by "_OutputLen". Call B_DecryptFinal passing "rc4MACDecAlg" and address of next free byte in buffer "plainText" and address of "_OutputLen" and length of free bytes in buffer "plainText" and "NULL_PTR" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "plainText" by "_OutputLen". Finalize buffer "plainText". Check equality of buffer "plainText" with contents of buffer "inputData". This is the end of test case "TVRC4MAC". This is the start of test case "TVRKG931". Set "_ExpectedStatus" to zero. Set "_Chooser" to "NULL_PTR". Set "_SurrenderContext" to "NULL_PTR". Note: 1024 bit key vector test based on X9.31 example 4.1 for Note: AI_RSAStrongKeyGen, Note: KI_RSAPublic, KI_RSAPrivate Note: AI_FormatX931, AI_SignVerify Note: Depending on AI_DummyRandom algorithm Note: Start with GlobalInit for code resource Set "_Chooser" to "AM_DUMMY_RANDOM_MULT", "AM_FORMAT_X931", "AM_EXTRACT_X931", "AM_RSA_CRT_X931_ENCRYPT", "AM_RSA_X931_DECRYPT", "AM_RSA_STRONG_KEY_GEN", "NULL_PTR". Note: Set up random object for param and key generation Baldwin Informational, Expires 12/25/1999 153 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Create algorithm object "random". Call B_CreateAlgorithmObject passing "random". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set "_InfoPointer" to address of info structure for "AI_DummyRandomMult" initialized from "NULL_PTR". Call B_SetAlgorithmInfo passing "random" and "AI_DummyRandomMult" and "_InfoPointer". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call Call B_RandomInit passing "random" and "_Chooser" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Create buffer "seed" of decimal value "512" bytes. Set buffer "seed" to hex value "1A1916DDB29B4EB7EB6732E128192E8A AC41C576C822D93EA433D8CD81F035EC57EFE822955149D3BFF70C53520D769D 6D76646C7A792E16EBD89FE6FC5B605A649339DFC925A86A4C6D150B71B9EEA0 2D68885F5009B98BD9841A5CF72EE770DE50CB09ACCEA9134E4CAA16D2350A21 D775C404CC1092495D867E64065DEE3E7955F2EBC7D47A2D7C9953388F97DDDC 3E1CA19C35CA659EDC2FC3256D29C2627479C086A699A49C4C9CEE7EF7BD1B34 321DE34A". Call B_RandomUpdate passing "random" and address of first initialized byte in "seed" and length of initialized bytes in "seed" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Note: Generate RSA Keypair Create algorithm object "rsaKeyGen". Call B_CreateAlgorithmObject passing "rsaKeyGen". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set "_InfoPointer" to address of info structure for "AI_RSAStrongKeyGen" initialized from "1024", "3". Call B_SetAlgorithmInfo passing "rsaKeyGen" and "AI_RSAStrongKeyGen" and "_InfoPointer". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Create key object "publicKey". Call B_CreateKeyObject passing "publicKey". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Baldwin Informational, Expires 12/25/1999 154 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Create key object "privateKey". Call B_CreateKeyObject passing "privateKey". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call Call B_GenerateInit passing "rsaKeyGen" and "_Chooser" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call Call B_GenerateKeypair passing "rsaKeyGen" and "publicKey" and "privateKey" and "random" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Note: Check the RSA public Set "_ExpectedInfoPointer" to address of expected info structure for "KI_RSAPublic" initialized from "acd1cc46dfe54fe8f9786672664ca2690d0ad7e5003bc6427954d939eee8b27 152e6a947450d7fa980172de064d6569a28a83fe70fa840f5e9802cb8984ab34 bd5c1e6399ec21e4d3a3a69be4e676f395aafef7c4925fd4faee9f9e5e48af43 15df0ec2db9ad7a350b3df2f4d15dc0039846d1aca3527b1a75049e3fe34f43b d", "03". Set "_InfoPointer" to address of info structure for "KI_RSAPublic". Call B_GetKeyInfo passing "_InfoPointer" and "publicKey" and "KI_RSAPublic". Check equality of info structure for "KI_RSAPublic" with expected info structure for "KI_RSAPublic". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Note: Check the DSA private Set "_ExpectedInfoPointer" to address of expected info structure for "KI_RSAPrivate" initialized from "acd1cc46dfe54fe8f9786672664ca2690d0ad7e5003bc6427954d939eee8b27 152e6a947450d7fa980172de064d6569a28a83fe70fa840f5e9802cb8984ab34 bd5c1e6399ec21e4d3a3a69be4e676f395aafef7c4925fd4faee9f9e5e48af43 15df0ec2db9ad7a350b3df2f4d15dc0039846d1aca3527b1a75049e3fe34f43b d", "1ccda20bcffb8d517ee9666866621b11822c7950d55f4bb5bee37989a7d 17312e326718be0d79546eaae87a56623b919b1715ffbd7f16028fc400774196 1c88c5d7b4daaac8d36a98c9efbb26c8a4a0e6bc15b358e528a1ac9d0f042beb 93bca16b541b33f80c933a3b769285c462ed5677bfe89df07bed5c127fd13241 d3c4b". Set "_InfoPointer" to address of info structure for "KI_RSAPrivate". Call B_GetKeyInfo passing "_InfoPointer" and "privateKey" and "KI_RSAPrivate". Check equality of info structure for "KI_RSAPrivate" with Baldwin Informational, Expires 12/25/1999 155 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 expected info structure for "KI_RSAPrivate". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Note: Now use the generated key in signing and verifying Create buffer "signature" of decimal value "1024" bytes. Create algorithm object "x931RSASigner". Call B_CreateAlgorithmObject passing "x931RSASigner". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set "_InfoPointer" to address of info structure for "AI_SignVerify" initialized from "rsaSignX931", "0", "sha1", "0", "formatX931", "128", "3". Call B_SetAlgorithmInfo passing "x931RSASigner" and "AI_SignVerify" and "_InfoPointer". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Create algorithm object "x931RSAVerifier". Call B_CreateAlgorithmObject passing "x931RSAVerifier". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set "_InfoPointer" to address of info structure for "AI_SignVerify" initialized from "rsaVerifyX931", "0", "sha1", "0", "formatX931", "128", "3". Call B_SetAlgorithmInfo passing "x931RSAVerifier" and "AI_SignVerify" and "_InfoPointer". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Note: Case 1: Sign 3 bytes Set buffer "seed" to hex value "616263". Call Call B_SignInit passing "x931RSASigner" and "privateKey" and "_Chooser" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_SignUpdate passing "x931RSASigner" and address of first initialized byte in buffer "seed" and length of initialized bytes in buffer "seed" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_SignFinal passing "x931RSASigner" and address of next Baldwin Informational, Expires 12/25/1999 156 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 free byte in buffer "signature" and address of "_OutputLen" and length of free bytes in buffer "signature" and "random" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "signature" by "_OutputLen". Finalize buffer "signature". Check equality of buffer "signature" with hex value "061D355237E2A05866867110D32F1D8D3C5193F5CB7AC3892B7FBE89D0D85DB 544E136A549DFCF75297EA9ECE21F0855893BBF23099884E5EDAC82EDFAE44AF 0453AB631CCBA5C76EDD13CBD3D51F37FE40B9A5DD6483513386F5C70401687D FC27D1DDAF6EDBD18CEFAD5CF817504C08F482D262AD3577AA2705AAF0905657 8". Note: Verify the signature of the seed Call Call B_VerifyInit passing "x931RSAVerifier" and "publicKey" and "_Chooser" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_VerifyUpdate passing "x931RSAVerifier" and address of first initialized byte in buffer "seed" and length of initialized bytes in buffer "seed" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_VerifyFinal passing "x931RSAVerifier" and address of first initialized byte in buffer "signature" and length of initialized bytes in buffer "signature" and "random" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. This is the end of test case "TVRKG931". This is the start of test case "TVRKG932". Set "_ExpectedStatus" to zero. Set "_Chooser" to "NULL_PTR". Set "_SurrenderContext" to "NULL_PTR". Note: 1536 bit key vector test based on X9.31 example 4.2 for Note: AI_RSAStrongKeyGen, Note: KI_RSAPublic, KI_RSAPrivate Note: AI_FormatX931, AI_SignVerify Note: Depending on AI_DummyRandom algorithm Baldwin Informational, Expires 12/25/1999 157 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Note: Start with GlobalInit for code resource Set "_Chooser" to "AM_DUMMY_RANDOM_MULT", "AM_FORMAT_X931", "AM_EXTRACT_X931", "AM_RSA_CRT_X931_ENCRYPT", "AM_RSA_X931_DECRYPT", "AM_RSA_STRONG_KEY_GEN", "NULL_PTR". Note: Set up random object for param and key generation Create algorithm object "random". Call B_CreateAlgorithmObject passing "random". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set "_InfoPointer" to address of info structure for "AI_DummyRandomMult" initialized from "NULL_PTR". Call B_SetAlgorithmInfo passing "random" and "AI_DummyRandomMult" and "_InfoPointer". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call Call B_RandomInit passing "random" and "_Chooser" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Create buffer "seed" of decimal value "512" bytes. Set buffer "seed" to hex value "1A1916DDB29B4EB7EB6732E128192E8A AC41C576C822D93EA433D8CD81F035EC57EFE822955149D3BFF70C53520D769D 6D76646C7A792E16EBD89FE6FC5B605A649339DFC925A86A4C6D150B71B9EEA0 2D68885F5009B98BD9841A5CF72EE770DE50CB09ACCEA9134E4CAA16D2350A21 D775C404CC1092495D867E64065DEE3E7955F2EBC7D47A2D7C9953388F97DDDC 3E1CA19C35CA659EDC2FC3256D29C2627479C086A699A49C4C9CEE7EF7BD1B34 321DE34A". Call B_RandomUpdate passing "random" and address of first initialized byte in "seed" and length of initialized bytes in "seed" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Note: Generate RSA Keypair Create algorithm object "rsaKeyGen". Call B_CreateAlgorithmObject passing "rsaKeyGen". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set "_InfoPointer" to address of info structure for "AI_RSAStrongKeyGen" initialized from "1536", "3". Baldwin Informational, Expires 12/25/1999 158 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Call B_SetAlgorithmInfo passing "rsaKeyGen" and "AI_RSAStrongKeyGen" and "_InfoPointer". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Create key object "publicKey". Call B_CreateKeyObject passing "publicKey". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Create key object "privateKey". Call B_CreateKeyObject passing "privateKey". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call Call B_GenerateInit passing "rsaKeyGen" and "_Chooser" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call Call B_GenerateKeypair passing "rsaKeyGen" and "publicKey" and "privateKey" and "random" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set "_InfoPointer" to address of info structure for "KI_RSAPrivate". Call B_GetKeyInfo passing "_InfoPointer" and "privateKey" and "KI_RSAPrivate". Display info structure for "KI_RSAPrivate". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set "_ExpectedInfoPointer" to address of expected info structure for "KI_RSAPrivate" initialized from "99f4b516fb3dacdb0e8f2c208c7c4271d1a51c040d0934014370ae59132f2fa ef9ff6fb3a89fb0b5f36b36121641c2f9582f3dd80a2f0a5807609c3ce2c5ec4 bf46977b85e0bb4394705bc3108b3b6813ad0e86577a460b65b95bb013295218 e4125ab763388f354a22528daf643c179ddf787dce34a5486e2870d1cf17166c f847ef3cdcd9c00a4938a3782e6fe7a5f3872c1d35a602f741403dccb1f704d0 3b612dd472a89f353cf085a641b1ab8fd5e5aefb9fadf0426aaf32cd0e2dc436 1", "066a32364a77e733cb45f72c05da82c4be118bd5808b0cd562cf5c990b7 74ca74a6aa4a77c5bfcb23f79cceb6b9812ca63aca293ab174b19004eb12d341 d94832a2f0fa7ae95d22d0da03d2cb5b2279ab7c8b4598fa6d95cee7b9275621 b8c10877092d44c0f33ad4dde5e0c4cff980a81cb1b622155ffb0baee8fa4a60 d30fc886ff4063271988e6498227a80efcaa44fa19071717be1b3344f5cd4d42 a2d3b78283fea3c92c5c421f2258cff1cf86f1a08211c2ffa20f53d467d4d231 bc8b3". Set "_InfoPointer" to address of info structure for "KI_RSAPrivate". Call B_GetKeyInfo passing "_InfoPointer" and "privateKey" and Baldwin Informational, Expires 12/25/1999 159 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 "KI_RSAPrivate". Check equality of info structure for "KI_RSAPrivate" with expected info structure for "KI_RSAPrivate". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Note: Check the DSA private Set "_InfoPointer" to address of info structure for "KI_RSAPublic". Call B_GetKeyInfo passing "_InfoPointer" and "publicKey" and "KI_RSAPublic". Display info structure for "KI_RSAPublic". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set "_ExpectedInfoPointer" to address of expected info structure for "KI_RSAPublic" initialized from "99f4b516fb3dacdb0e8f2c208c7c4271d1a51c040d0934014370ae59132f2fa ef9ff6fb3a89fb0b5f36b36121641c2f9582f3dd80a2f0a5807609c3ce2c5ec4 bf46977b85e0bb4394705bc3108b3b6813ad0e86577a460b65b95bb013295218 e4125ab763388f354a22528daf643c179ddf787dce34a5486e2870d1cf17166c f847ef3cdcd9c00a4938a3782e6fe7a5f3872c1d35a602f741403dccb1f704d0 3b612dd472a89f353cf085a641b1ab8fd5e5aefb9fadf0426aaf32cd0e2dc436 1", "03". Set "_InfoPointer" to address of info structure for "KI_RSAPublic". Call B_GetKeyInfo passing "_InfoPointer" and "publicKey" and "KI_RSAPublic". Check equality of info structure for "KI_RSAPublic" with expected info structure for "KI_RSAPublic". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Note: Now use the generated key in signing and verifying Create buffer "signature" of decimal value "1024" bytes. Create algorithm object "x931RSASigner". Call B_CreateAlgorithmObject passing "x931RSASigner". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set "_InfoPointer" to address of info structure for "AI_SignVerify" initialized from "rsaSignX931", "0", "sha1", "0", "formatX931", "192", "3". Call B_SetAlgorithmInfo passing "x931RSASigner" and "AI_SignVerify" and "_InfoPointer". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Baldwin Informational, Expires 12/25/1999 160 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Create algorithm object "x931RSAVerifier". Call B_CreateAlgorithmObject passing "x931RSAVerifier". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set "_InfoPointer" to address of info structure for "AI_SignVerify" initialized from "rsaVerifyX931", "0", "sha1", "0", "formatX931", "192", "3". Call B_SetAlgorithmInfo passing "x931RSAVerifier" and "AI_SignVerify" and "_InfoPointer". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Note: Case 1: Sign 3 bytes Set buffer "seed" to hex value "616263". Call Call B_SignInit passing "x931RSASigner" and "privateKey" and "_Chooser" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_SignUpdate passing "x931RSASigner" and address of first initialized byte in buffer "seed" and length of initialized bytes in buffer "seed" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_SignFinal passing "x931RSASigner" and address of next free byte in buffer "signature" and address of "_OutputLen" and length of free bytes in buffer "signature" and "random" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "signature" by "_OutputLen". Finalize buffer "signature". Check equality of buffer "signature" with hex value "2bd1aedbe89a4da184ed40155c8b2f2980b98158ac6eab6df6c440f6af07f5f 88e00f3682b5e74a01929727bb6464f31b9b5b9343e1b4d75bf317211e274db9 0b11105720d363c0506c2803723f121d68c94ba70bf2e8cfbc379f4ecb7754b6 19e524f9fc336d70a597d0d89a0a314b25191040425c0f7740755b8e51cb6201 786c14fb910dc6193bb65790c002b38d1ce05e473bcfb670496c2c51d236410c 7129bf0ac3e29519e42eb3aed76f75f8233a91e87f566ebdfbb5fef46987da4a 7". Note: Verify the signature of the seed Call Call B_VerifyInit passing "x931RSAVerifier" and "publicKey" and "_Chooser" and "_SurrenderContext". Baldwin Informational, Expires 12/25/1999 161 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_VerifyUpdate passing "x931RSAVerifier" and address of first initialized byte in buffer "seed" and length of initialized bytes in buffer "seed" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_VerifyFinal passing "x931RSAVerifier" and address of first initialized byte in buffer "signature" and length of initialized bytes in buffer "signature" and "random" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. This is the end of test case "TVRKG932". This is the start of test case "TVRKG933". Set "_ExpectedStatus" to zero. Set "_Chooser" to "NULL_PTR". Set "_SurrenderContext" to "NULL_PTR". Note: 2024 bit key vector test based on X9.31 example 4.2 for Note: AI_RSAStrongKeyGen, Note: KI_RSAPublic, KI_RSAPrivate Note: AI_FormatX931, AI_SignVerify Note: Depending on AI_DummyRandom algorithm Note: Start with GlobalInit for code resource Set "_Chooser" to "AM_DUMMY_RANDOM_MULT", "AM_FORMAT_X931", "AM_EXTRACT_X931", "AM_RSA_CRT_X931_ENCRYPT", "AM_RSA_X931_DECRYPT", "AM_RSA_STRONG_KEY_GEN", "NULL_PTR". Note: Set up random object for param and key generation Create algorithm object "random". Call B_CreateAlgorithmObject passing "random". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set "_InfoPointer" to address of info structure for "AI_DummyRandomMult" initialized from "NULL_PTR". Call B_SetAlgorithmInfo passing "random" and "AI_DummyRandomMult" and "_InfoPointer". Set "_Status" to return value. Baldwin Informational, Expires 12/25/1999 162 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call Call B_RandomInit passing "random" and "_Chooser" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Create buffer "seed" of decimal value "700" bytes. Set buffer "seed" to hex value "1a1916ddb29b4eb7eb6732e128192e8a ac41c576c822d93ea433e532cf6e17e192b694e1313a3ce043534cd24e264e77 3f7bde8d9a190ef1a5ab841c4d3932a85b48d428875dd710176489e6973dcbb9 dc379432c26b33aa6fb3b19b03e06bd8afdfd0452aa293a77fee18a6a41aed3a daecc8d8f4f25c2dd7b13fcdf8b6c0b4c92673bf924b50d498da2a16e373dd40 5ad110bea0137317b3081f2654ce23e5f7770f8728670c1d867e64065dee3e79 55f2ebc7D2DDB9275760C8AACFC46AD6C3D78F0788D18733D6B024043E04AE70 E71794C0231ACBAD28FC0FC137D8CFA848747594F6EE8D5D318C6962A70AB471 BA439B1227EEEAFDEAB75AC119D72178BAF4685B931DF1C87E230F33EB120CDF E7A618A48C63B2069E62610152752C113990A21A551FE17F6F711CE812197E1C 9CE5DEA6". Call B_RandomUpdate passing "random" and address of first initialized byte in "seed" and length of initialized bytes in "seed" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Note: Generate RSA Keypair Create algorithm object "rsaKeyGen". Call B_CreateAlgorithmObject passing "rsaKeyGen". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set "_InfoPointer" to address of info structure for "AI_RSAStrongKeyGen" initialized from "2048", "3". Call B_SetAlgorithmInfo passing "rsaKeyGen" and "AI_RSAStrongKeyGen" and "_InfoPointer". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Create key object "publicKey". Call B_CreateKeyObject passing "publicKey". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Create key object "privateKey". Call B_CreateKeyObject passing "privateKey". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call Call B_GenerateInit passing "rsaKeyGen" and "_Chooser" and "_SurrenderContext". Baldwin Informational, Expires 12/25/1999 163 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call Call B_GenerateKeypair passing "rsaKeyGen" and "publicKey" and "privateKey" and "random" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Note: Check the RSA public Set "_ExpectedInfoPointer" to address of expected info structure for "KI_RSAPublic" initialized from "bcca30ca5280bc51e758dbaffedfe46a5d2a78d83969e154780f9b27ad4e76e 63e8fa96029c04de3f2c4b01fecbebb44fc2f5f8ac69bd0e3278ff0658a6f9ac 23bcfb2c9aaaf1ac4d5571a55d3b1ec3550cf34d8f789235dd3b5c4e2f3df176 119d918f2d35e805b62fc35fee5fd07854824b9846dc1665e35a31873bf6a24f e50842d0aa0305c35d0f45b0d7c2f1e9432d850d67956d383bbef52fc2acbf7a e6f7ca21488a56456bdf6672696ee037c3caa2199904e37aa40134e10155fc81 393a225bd129c4b3bc91ad3a5fc958a6abcabe3550390b67787625d78f8d3172 b673c4482ce354b8951d7e8c4ddce5d4cdfa6790c6ce8c02c8d807ae26f27fe3 3", "03". Set "_InfoPointer" to address of info structure for "KI_RSAPublic". Call B_GetKeyInfo passing "_InfoPointer" and "publicKey" and "KI_RSAPublic". Check equality of info structure for "KI_RSAPublic" with expected info structure for "KI_RSAPublic". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Note: Check the RSA private Set "_ExpectedInfoPointer" to address of expected info structure for "KI_PKCS_RSAPrivate" initialized from "bcca30ca5280bc51e758dbaffedfe46a5d2a78d83969e154780f9b27ad4e76e 63e8fa96029c04de3f2c4b01fecbebb44fc2f5f8ac69bd0e3278ff0658a6f9ac 23bcfb2c9aaaf1ac4d5571a55d3b1ec3550cf34d8f789235dd3b5c4e2f3df176 119d918f2d35e805b62fc35fee5fd07854824b9846dc1665e35a31873bf6a24f e50842d0aa0305c35d0f45b0d7c2f1e9432d850d67956d383bbef52fc2acbf7a e6f7ca21488a56456bdf6672696ee037c3caa2199904e37aa40134e10155fc81 393a225bd129c4b3bc91ad3a5fc958a6abcabe3550390b67787625d78f8d3172 b673c4482ce354b8951d7e8c4ddce5d4cdfa6790c6ce8c02c8d807ae26f27fe3 3", "03", "1f770821b86aca0da68ecf47ffcffb670f8714240991a58e14029 9dbf237be7bb517f19006f56250a8761d5aa7751f362a07e541cbc4a2d08697f d6641bd4475b4a29dcc471d2f20ce392f0e4df2fcb38d77de24294185e4f89e4 b7b28a52e902ef98428788fc00f3b2a08ffd0ff8140e15b7440bcf5910fb39b2 ebdf53c5b7f6ebdf0be32d25578bcb7ca7f69e9375ee4de1494b8b292ab453a2 c685e2074e076b64187b22ad43772fe2d5abe9193c074a37f7fc32bfdad5623a 3dddbe84a379f0409251f576019cfd516971cfef05ad8268ce844087763cde93 Baldwin Informational, Expires 12/25/1999 164 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 9f11e2a8678ef2c6ef63d2aa48c997c7c75548d9d4eb23043583c3eac1cd990e 6a4178b18eb", "e532cf6e17e192b694e1313a3ce043534cd24e264e773f7bd e8d9a190ef1a5ab841c4d3932a85b48d428875dd710176489e6973dcbb9dc379 432c26b33aa6fb3b19b03e06bd8afdfd0452aa293a77fee18a6a41aed3adaecc 8d8f4f25c2dd7b13fcdf8b6c0c8a33e72998487de550e0d7188aa87b2cf20d5c 7f83eb0c95ed0c1", "d2ddb9275760c8aacfc46ad6c3d78f0788d18733d6b02 4043e04ae70e71794c0231acbad28fc0fc137d8cfa848747594f6ee8d5d318c6 962a70ab471ba439b1227eeeafdeab75ac119d72178baf4685b931df1c87e230 f33eb120cdfe7a618a48c63b2069e6cccff4653797d04279f6740fc3a7350a19 6a9ac22d459188697f3", "98cc8a4965410c79b89620d17dead78cdde1896ed efa2a52945e66bb5f4bc3c7ad68337b771ae785e2c5af93e4b564edb14464d3d d2692cfb821d6f222719fcd211202959d3b1fea8ad8c7170d1a554965c46d674 8d1e74885e5f8a192c93a762a895079d5db177ef71103053ee35eb3a105c7052 1df6b392ffad475db948b2b", "8c93d0c4e4eb3071dfd84739d7e50a0505e10 4cd39cac2ad7eadc9a09a0fb8801767327370a80a80cfe5dfc585a2f90df9f45 e3e21084641c4b1cda126d7bcb6c549f1fe9c7a3c80bbe4c0fb274d9ae7b7694 bdafec20a229cb6b33fefc4106db2ed2159bef33354d98cfba8ad6fbf9a2b52d 1a235c10f1bc817383b65af0ff7", "ba91456e8aafa0451a3f564d6580a1d89 79f85f33a9c46c8f904328b5f2743d65e98563d158fb4d289efc8b39fd79e969 dae6152c8cc3b1f2bce9f5cb7f593eed9e50169edecf82b0361828852c7b700c a3655d434916fc5a13eef4ffa4136f41e3ef11aa76a67294480d8eb6973bafd7 7c2d8ca6c33ad71c079d3d65e30352a". Set "_InfoPointer" to address of info structure for "KI_PKCS_RSAPrivate". Call B_GetKeyInfo passing "_InfoPointer" and "privateKey" and "KI_PKCS_RSAPrivate". Check equality of info structure for "KI_PKCS_RSAPrivate" with expected info structure for "KI_PKCS_RSAPrivate". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Note: Now use the generated key in signing and verifying Create buffer "signature" of decimal value "1024" bytes. Create algorithm object "x931RSASigner". Call B_CreateAlgorithmObject passing "x931RSASigner". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set "_InfoPointer" to address of info structure for "AI_SignVerify" initialized from "rsaSignX931", "0", "sha1", "0", "formatX931", "256", "3". Call B_SetAlgorithmInfo passing "x931RSASigner" and "AI_SignVerify" and "_InfoPointer". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Create algorithm object "x931RSAVerifier". Call B_CreateAlgorithmObject passing "x931RSAVerifier". Baldwin Informational, Expires 12/25/1999 165 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set "_InfoPointer" to address of info structure for "AI_SignVerify" initialized from "rsaVerifyX931", "0", "sha1", "0", "formatX931", "256", "3". Call B_SetAlgorithmInfo passing "x931RSAVerifier" and "AI_SignVerify" and "_InfoPointer". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Note: Case 1: Sign 3 bytes Set buffer "seed" to hex value "616263". Call Call B_SignInit passing "x931RSASigner" and "privateKey" and "_Chooser" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_SignUpdate passing "x931RSASigner" and address of first initialized byte in buffer "seed" and length of initialized bytes in buffer "seed" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_SignFinal passing "x931RSASigner" and address of next free byte in buffer "signature" and address of "_OutputLen" and length of free bytes in buffer "signature" and "random" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "signature" by "_OutputLen". Finalize buffer "signature". Display buffer "signature". Check equality of buffer "signature" with contents of buffer "signature". Check equality of buffer "signature" with hex value "2b6557434af5230b2693648c2c797a47e197da08d4aef6f3d49edfa22e7332a 227366f2bc597e0d54863c84e9139aeadc9d174604119fad959b2bf8eddfb15c a6b06c3efd7f6a740719e541d289833845f5ae3888003711ecb1027cf8600c20 a3719903592c63533ab7258eba709f5f45b8e9df33532cc70d9165be2aa7bce2 99c951d585f74c3fc25685788abc3325714fdf5933ca6ac528ebbead99e02dc7 9c1151156bc59dbb8f32bdfab92f7b28fb35c646a281cdd75460f07436a140bc b47a971cf157d0773888b9c07723e774922fcdfd204cd4bc317b4d5f6ef6f4cb 4e6840bb56e2ddef88c349e8fd9cba049d1df2329848a7f4227e44021813b7f8 d". Baldwin Informational, Expires 12/25/1999 166 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Note: Verify the signature of the seed Call Call B_VerifyInit passing "x931RSAVerifier" and "publicKey" and "_Chooser" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_VerifyUpdate passing "x931RSAVerifier" and address of first initialized byte in buffer "seed" and length of initialized bytes in buffer "seed" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_VerifyFinal passing "x931RSAVerifier" and address of first initialized byte in buffer "signature" and length of initialized bytes in buffer "signature" and "random" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. This is the end of test case "TVRKG933". This is the start of test case "TVRKG935". Set "_ExpectedStatus" to zero. Set "_Chooser" to "NULL_PTR". Set "_SurrenderContext" to "NULL_PTR". Note: 1024 bit key vector test based on X9.31 example 4.5 for Note: AI_RSAStrongKeyGen, Note: KI_RSAPublic, KI_RSAPrivate Note: AI_FormatX931, AI_SignVerify Note: Depending on AI_DummyRandom algorithm Note: Start with GlobalInit for code resource Set "_Chooser" to "AM_DUMMY_RANDOM_MULT", "AM_FORMAT_X931", "AM_EXTRACT_X931", "AM_RSA_CRT_X931_ENCRYPT", "AM_RSA_X931_DECRYPT", "AM_RSA_STRONG_KEY_GEN", "NULL_PTR". Note: Set up random object for param and key generation Create algorithm object "random". Call B_CreateAlgorithmObject passing "random". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Baldwin Informational, Expires 12/25/1999 167 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Set "_ExpectedStatus" to zero. Set "_InfoPointer" to address of info structure for "AI_DummyRandomMult" initialized from "NULL_PTR". Call B_SetAlgorithmInfo passing "random" and "AI_DummyRandomMult" and "_InfoPointer". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call Call B_RandomInit passing "random" and "_Chooser" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Create buffer "seed" of decimal value "512" bytes. Set buffer "seed" to hex value "1857FA8D9D0B0E4E033B68CE401A416A 5C0DAB5E4CEB97EB9EECDBB3CB4C375C0ECD2FD300DB4F08547293CA004CEDD2 019CE79CA08A15EEFB25DD3BAF981823961F4148FF03C6E96930B78C7A758D69 BC5070137900403807A4198C4AD4DBA81A560183DD19BA1A5A797EB98BEFF431 2D0C9EF7EEAA4A5347999FE76FB7876064BBEC66CB409A7739EF5A5906613DC3 7225D41D2BEB1F9F5EBF4CC95B6BF916A47C5EF2146BE00ECD4A1C5D88B3E85A 9569BE97". Call B_RandomUpdate passing "random" and address of first initialized byte in "seed" and length of initialized bytes in "seed" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Note: Generate RSA Keypair Create algorithm object "rsaKeyGen". Call B_CreateAlgorithmObject passing "rsaKeyGen". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set "_InfoPointer" to address of info structure for "AI_RSAStrongKeyGen" initialized from "1024", "2". Call B_SetAlgorithmInfo passing "rsaKeyGen" and "AI_RSAStrongKeyGen" and "_InfoPointer". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Create key object "publicKey". Call B_CreateKeyObject passing "publicKey". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Create key object "privateKey". Call B_CreateKeyObject passing "privateKey". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call Call B_GenerateInit passing "rsaKeyGen" and "_Chooser" and Baldwin Informational, Expires 12/25/1999 168 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call Call B_GenerateKeypair passing "rsaKeyGen" and "publicKey" and "privateKey" and "random" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Note: Check the RSA public Set "_ExpectedInfoPointer" to address of expected info structure for "KI_RSAPublic" initialized from "ccd34c2f4d95ffad1420e666c07e39d1450a13304c3f5891ede57595c772a36 91ab51d2bece1476b8f22ae223365f183bc3ee2d4cacdba3ad0c4d4781c523a1 0efe6203d6f3bc226bf9a459727b8f122c482d8c86019f9a869329187096430a 6c67cb103742bcbc66906ad23836ebabb511d5d80ab8cb59974e9aac62d785c4 5", "02". Set "_InfoPointer" to address of info structure for "KI_RSAPublic". Call B_GetKeyInfo passing "_InfoPointer" and "publicKey" and "KI_RSAPublic". Check equality of info structure for "KI_RSAPublic" with expected info structure for "KI_RSAPublic". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Note: Check the RSA private Set "_ExpectedInfoPointer" to address of expected info structure for "KI_RSAPrivate" initialized from "ccd34c2f4d95ffad1420e666c07e39d1450a13304c3f5891ede57595c772a36 91ab51d2bece1476b8f22ae223365f183bc3ee2d4cacdba3ad0c4d4781c523a1 0efe6203d6f3bc226bf9a459727b8f122c482d8c86019f9a869329187096430a 6c67cb103742bcbc66906ad23836ebabb511d5d80ab8cb59974e9aac62d785c4 5", "199a6985e9b2bff5a2841cccd80fc73a28a142660987eb123dbcaeb2b8e e546d2356a3a57d9c28ed71e455c4466cbe307787dc5a9959b7475a189a8f038 a4741e4b10153be08c26e4401f7ab6e7e96092caf07c0870b13b64f669667302 9ec2c77aabc397fa528a245d7073ce69cc9bdcd7bef91599dca484000c0bd8ab 0814e". Set "_InfoPointer" to address of info structure for "KI_RSAPrivate". Call B_GetKeyInfo passing "_InfoPointer" and "privateKey" and "KI_RSAPrivate". Check equality of info structure for "KI_RSAPrivate" with expected info structure for "KI_RSAPrivate". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Baldwin Informational, Expires 12/25/1999 169 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Note: Now use the generated key in signing and verifying Create buffer "signature" of decimal value "1024" bytes. Create algorithm object "x931RSASigner". Call B_CreateAlgorithmObject passing "x931RSASigner". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set "_InfoPointer" to address of info structure for "AI_SignVerify" initialized from "rsaSignX931", "0", "sha1", "0", "formatX931", "128", "3". Call B_SetAlgorithmInfo passing "x931RSASigner" and "AI_SignVerify" and "_InfoPointer". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Create algorithm object "x931RSAVerifier". Call B_CreateAlgorithmObject passing "x931RSAVerifier". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set "_InfoPointer" to address of info structure for "AI_SignVerify" initialized from "rsaVerifyX931", "0", "sha1", "0", "formatX931", "128", "3". Call B_SetAlgorithmInfo passing "x931RSAVerifier" and "AI_SignVerify" and "_InfoPointer". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Note: Case 1: Sign 3 bytes Set buffer "seed" to hex value "616263". Call Call B_SignInit passing "x931RSASigner" and "privateKey" and "_Chooser" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_SignUpdate passing "x931RSASigner" and address of first initialized byte in buffer "seed" and length of initialized bytes in buffer "seed" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_SignFinal passing "x931RSASigner" and address of next free byte in buffer "signature" and address of "_OutputLen" and length of free bytes in buffer "signature" and "random" and "_SurrenderContext". Baldwin Informational, Expires 12/25/1999 170 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "signature" by "_OutputLen". Finalize buffer "signature". Check equality of buffer "signature" with hex value "232F0E08EB9A23957646697FC7884796D39A04FD0EFF5B72B60813D4E691917 891C96603876D08793AAD86DAF2E6187FF62C226E81BD6B993B27091E0864895 AF10F222AEB022961B444D312EA3DB7891D4550B280CF24693D4465B957E53CB DB0F8C29D2B5EE1545D6C91A45EAAACEC0096D8A5E4CFE06A2CD320BDF853D81 7". Note: Verify the signature of the seed Call Call B_VerifyInit passing "x931RSAVerifier" and "publicKey" and "_Chooser" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_VerifyUpdate passing "x931RSAVerifier" and address of first initialized byte in buffer "seed" and length of initialized bytes in buffer "seed" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_VerifyFinal passing "x931RSAVerifier" and address of first initialized byte in buffer "signature" and length of initialized bytes in buffer "signature" and "random" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. This is the end of test case "TVRKG935". This is the start of test case "TVRSAP01". Set "_ExpectedStatus" to zero. Set "_Chooser" to "NULL_PTR". Set "_SurrenderContext" to "NULL_PTR". Note: Vector tests, PKCS RSA encryption and decryption Note: ---------------------------------------------------------- Note: ---------- Note: Start with the GlobalInit Set "_Chooser" to "AM_RSA_ENCRYPT", "AM_RSA_CRT_ENCRYPT", "AM_MD2_RANDOM", "NULL_PTR". Baldwin Informational, Expires 12/25/1999 171 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Note: Use the following random algorithm object througout. Create algorithm object "random". Call B_CreateAlgorithmObject passing "random". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set "_InfoPointer" to address of info structure for "AI_MD2Random" initialized from "NULL_PTR". Call B_SetAlgorithmInfo passing "random" and "AI_MD2Random" and "_InfoPointer". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call Call B_RandomInit passing "random" and "_Chooser" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Create buffer "seed" of decimal value "2" bytes. Set buffer "seed" to hex value "0000". Call B_RandomUpdate passing "random" and address of first initialized byte in "seed" and length of initialized bytes in "seed" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Note: ---------------------------------------------------------- Note: ---------- Note: Test 01-1 Note: Input the value given and check the result against the Note: result Note: produced by BSAFE 2.1.2 Note: Use an the following 777-bit keypair Create key object "publicKey". Call B_CreateKeyObject passing "publicKey". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set "_InfoPointer" to address of info structure for "KI_RSAPublic" initialized from "01aff1bfa898e4656dc06f97f5cda85 345e4813a92e57c39a72f277a4dfeaad685507241f61b0c5e744a2bf12ee2b16 2d7674c8de231bedbf3af349bf92199d2e97c735033c39e109fac775d12ebdae d0132ee1e9125816f8099c84b93f946379cb7", "010001". Call B_SetKeyInfo passing "publicKey" and "KI_RSAPublic" and "_InfoPointer". Baldwin Informational, Expires 12/25/1999 172 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Create key object "privateKey". Call B_CreateKeyObject passing "privateKey". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set "_InfoPointer" to address of info structure for "KI_PKCS_RSAPrivate" initialized from "01aff1bfa898e4656dc06f97f 5cda85345e4813a92e57c39a72f277a4dfeaad685507241f61b0c5e744a2bf12 ee2b162d7674c8de231bedbf3af349bf92199d2e97c735033c39e109fac775d1 2ebdaed0132ee1e9125816f8099c84b93f946379cb7", "010001", "cb58ef16ab2bd3085130f80433168c657a06d0917951fb3e56b7aa1f6fc5f38 9fd6e5cd944b09503002c21b625e8c69476687355240df3c2177d7564c2780bb baa855b70103cf7a540c5d7e7136cbcb6aa8d5518b3ae9032f7468b7d81ee616 d89", "1fb6d010eab6f59a4421a6778f911a33148eb2a70513d9b5648a30d8b 27874bfea18ee6a869ad6d5236b538a62a46f1325", "0d9eb46fbf1a16db07b 10030fed4d1ce687b613520575a33c48502801c4ba475d46dac29e667d89af03 2b64e103d5f97ab", "1145d240c4756d82ddc4ae13c43fb55348c907886bfd8 9bf7fc8bc1de9e62d403151eed85a038f2a7aa603d40531a5c579", "0d0596d85c6b123d19ee7613622191f2f9dc34c579856afda1bfd5f32c9a79c 41a753d2cd658a53505c046a2fe4ddf8e7f", "0382dd6cc2d80db494cc60908 1b56d37e4dcbc592ffedaa02a225ee8a09204a4b094ab514f69d668b8423499d ae135ffac". Call B_SetKeyInfo passing "privateKey" and "KI_PKCS_RSAPrivate" and "_InfoPointer". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Note: Encrypt and decrypt the following data. Create buffer "input" of decimal value "32" bytes. Set buffer "input" to hex value "10cae34ddaf234b5feedd98ac544e02 79ae2c5c14d1ec835feb6f48aeb26414b". Create buffer "output" of decimal value "98" bytes. Note: Public key encryption. Create algorithm object "encryptObj". Call B_CreateAlgorithmObject passing "encryptObj". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set "_InfoPointer" to address of info structure for "AI_PKCS_RSAPublic" initialized from "NULL_PTR". Call B_SetAlgorithmInfo passing "encryptObj" and "AI_PKCS_RSAPublic" and "_InfoPointer". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Baldwin Informational, Expires 12/25/1999 173 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Call Call B_EncryptInit passing "encryptObj" and "publicKey" and "_Chooser" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_EncryptUpdate passing "encryptObj" and address of next free byte in buffer "output" and address of "_OutputLen" and length of free bytes in buffer "output" and address of first initialized byte in buffer "input" and length of initialized bytes in buffer "input" and "random" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "output" by "_OutputLen". Call B_EncryptFinal passing "encryptObj" and address of next free byte in buffer "output" and address of "_OutputLen" and length of free bytes in buffer "output" and "random" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "output" by "_OutputLen". Finalize buffer "output". Check equality of buffer "output" with hex value "0192bb944584995809f6414d0ec12d8a64356cbdc7a21ccccd3c09f3a0c49da ed0f2731c6b16368346f5dd46f065292461aaca8cf1f5d862d43e97c05024984 78be39a44e512698e3b0cf7db816914d328dec9d5728a63ae906514e8fd493b0 8f219". Call Call B_DestroyAlgorithmObject passing "encryptObj". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Note: Private key encryption. Create algorithm object "encryptObj". Call B_CreateAlgorithmObject passing "encryptObj". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set "_InfoPointer" to address of info structure for "AI_PKCS_RSAPrivate" initialized from "NULL_PTR". Call B_SetAlgorithmInfo passing "encryptObj" and "AI_PKCS_RSAPrivate" and "_InfoPointer". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call Call B_EncryptInit passing "encryptObj" and "privateKey" and "_Chooser" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_EncryptUpdate passing "encryptObj" and address of next Baldwin Informational, Expires 12/25/1999 174 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 free byte in buffer "output" and address of "_OutputLen" and length of free bytes in buffer "output" and address of first initialized byte in buffer "input" and length of initialized bytes in buffer "input" and "random" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "output" by "_OutputLen". Call B_EncryptFinal passing "encryptObj" and address of next free byte in buffer "output" and address of "_OutputLen" and length of free bytes in buffer "output" and "random" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "output" by "_OutputLen". Finalize buffer "output". Check equality of buffer "output" with hex value "010851a47f356b9d3487c1e0625802e0ff87f48ac4df12b2efa2baacab9f99b e7d379ee8d9408c4e981f3c058bd7bc66df6a3cb57371adf08ef9d02a15c0439 2064b6dbac3d154b86ca59384df6c7ede557460ef95415b4eed56325d5982a90 5efb7". Note: ---------------------------------------------------------- Note: ---------- Note: ---------------------------------------------------------- Note: ---------- This is the end of test case "TVRSAP01". This is the start of test case "TVRSAP02". Set "_ExpectedStatus" to zero. Set "_Chooser" to "NULL_PTR". Set "_SurrenderContext" to "NULL_PTR". Note: Vector tests, PKCS RSA encryption and decryption Note: ---------------------------------------------------------- Note: ---------- Note: Start with the GlobalInit Set "_Chooser" to "AM_RSA_ENCRYPT", "AM_RSA_CRT_ENCRYPT", "AM_MD5_RANDOM", "NULL_PTR". Note: Use the following random algorithm object througout. Create algorithm object "random". Call B_CreateAlgorithmObject passing "random". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Baldwin Informational, Expires 12/25/1999 175 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Set "_InfoPointer" to address of info structure for "AI_MD5Random" initialized from "NULL_PTR". Call B_SetAlgorithmInfo passing "random" and "AI_MD5Random" and "_InfoPointer". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call Call B_RandomInit passing "random" and "_Chooser" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Create buffer "seed" of decimal value "2" bytes. Set buffer "seed" to hex value "0000". Call B_RandomUpdate passing "random" and address of first initialized byte in "seed" and length of initialized bytes in "seed" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Note: ---------------------------------------------------------- Note: ---------- Note: Test 02-1 Note: Input the value given and check the result against the Note: result Note: produced by BSAFE 2.1.2 Note: Use an the following 1994-bit keypair Create key object "publicKey". Call B_CreateKeyObject passing "publicKey". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set "_InfoPointer" to address of info structure for "KI_RSAPublic" initialized from "03a886ca1029bb5ee2e8e455b2dd4a3 632315cf58e0c5ad9a5422bff4dbe7a0cec258ae7932e49c58986c56f932ca88 501187e8e92aa4a28fb2e83ed107a2b4b1c63bd6ba18e00d0bd6b359fe01f7b5 66895f943c40f5d012149ea4c4a7337e1fe5498b40728616509219ba54323bb6 e78a84ab7b74fb3b195afab14aa9ad0061cb813693a6de691c42164385ca6b9d 8173aba42180aa3d2fadd63118adcdc23be6e30921ff4a23460ec413f9ee3a17 d516359cbcd6d411aab16db5d697c388cfd4e3f295e4a7413b7fa06032fc6700 fb6a64be8b8400040282938a1dbfe550f3e3bb9b1807dd67474dee187307f0fe 088437c44e19ecd9e50e9", "010001". Call B_SetKeyInfo passing "publicKey" and "KI_RSAPublic" and "_InfoPointer". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Baldwin Informational, Expires 12/25/1999 176 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Create key object "privateKey". Call B_CreateKeyObject passing "privateKey". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set "_InfoPointer" to address of info structure for "KI_PKCS_RSAPrivate" initialized from "03a886ca1029bb5ee2e8e455b 2dd4a3632315cf58e0c5ad9a5422bff4dbe7a0cec258ae7932e49c58986c56f9 32ca88501187e8e92aa4a28fb2e83ed107a2b4b1c63bd6ba18e00d0bd6b359fe 01f7b566895f943c40f5d012149ea4c4a7337e1fe5498b40728616509219ba54 323bb6e78a84ab7b74fb3b195afab14aa9ad0061cb813693a6de691c42164385 ca6b9d8173aba42180aa3d2fadd63118adcdc23be6e30921ff4a23460ec413f9 ee3a17d516359cbcd6d411aab16db5d697c388cfd4e3f295e4a7413b7fa06032 fc6700fb6a64be8b8400040282938a1dbfe550f3e3bb9b1807dd67474dee1873 07f0fe088437c44e19ecd9e50e9", "010001", "024b1b3cff86f9f4d131893 b84672007fbcd60667c479888cb0641c8ca7737d2741451113dfe8db6edb1748 2aef4172d5273859b61aca9d3292c8efe060f60a6b4c47e5244345ea47dab013 219f20283380b94f97ba6d9fa44612f25e6a2768d11c0fcfe1762a4340fd666d 9e2ce3ac95590c34e8af7c741f401edb185e02af243897e26dca7e106731f97e 263d9afbb8e488c4bfad7e3a26f28855a456f377a897c208301ee5bddfaa58e7 f43a0fdd206bfa53bf11e7ef0aab81e2424f29ee71833c21eaabdfe8550dd145 c361f224d9a45cf77fa71fd87bb60685557b1aabfdda51263bd6b07e02893e2a 85f6bda02a2f7554494e6edb62311", "1ead516e9ba0f918d62db10280e1518 50820e6e56179a4ad05d63c3cc7af0c15924d21e62974fa7260c9dfd579da1f0 5039b5e6830cd793cad1361501bc67eac1bdd5af6beedf8135e06cb53060a8ab 633c9e6246de5398183aa4e4f22f0b28342a573361a6d1615e0549f2d0805e84 355ac3f155e1e102423a7bb36e5", "1e87522f167933e0f9055fab0a16ce84a 5b276781a33588a34a5d8797695ea1c98abb89b2505f88dfbf0ed9642b291268 b512dd7d23f9593d5121b78792f600370654dc8b4ad173784218b11d913555dd 491fb5bcd7440273d4ad62b98bf9247cc1a1333ff20d91abaaf5e34249353cae ef8944d347670583e394d6db5", "1822cf3e122e5dae3fdd2536ce05f9288cd 3ae36ed3152f25af44ae29b4d4b59b1890451dd6e4f1a2cb2c86c6279ce0c18e 1662eddaedc6373dd1aa477a5fdc6160a5be665244019a4d1fda92dc89f88694 8c1cd09b5df3fda42e567f81a9ea90d87b514ed47c4a7a39f90b95265ab6f46f 9c58c5f4791f58d240bf54d", "11929b3ff793b4c51f1274cb23779550cd803 8a9518b94bf99268dc0fcfdb650d7a0a116cceceef1ebbff742b309ce7b7d5e3 1213628db94c8e52f62dd7ee3a9971cf8f53aeb179e21349db49c5b809c0e2c2 99fe257b445e2061dd9e2870350c8af89b6387953ff0acebf4f0c6eb1a0f285a bf7f4e6e82c234520c8b1", "020086ab73e7b4cd307f963c0f50d6468c6a589 a8ae5ef82211d58600569c9e3ecc5839543131cad2880fff40289fff44cafa4a 1eb56e5211a48e8193b10c9320f5d5d66966aaa7bd5eac0d5d04d78621267b2c 9cbb1dcda49b94f1a88ffc4bc4b949e4c28baa9a4e310de344db17b974aa2e16 41cfd727ad46d16ec96". Call B_SetKeyInfo passing "privateKey" and "KI_PKCS_RSAPrivate" and "_InfoPointer". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Note: Encrypt and decrypt the following data. Create buffer "input" of decimal value "32" bytes. Set buffer "input" to hex value "2b98bf9247cc1a1333ff2f894422cf3 Baldwin Informational, Expires 12/25/1999 177 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 536c36ed3152f25af446ecb2c2eddaedc". Create buffer "output" of decimal value "251" bytes. Note: Public key encryption. Create algorithm object "encryptObj". Call B_CreateAlgorithmObject passing "encryptObj". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set "_InfoPointer" to address of info structure for "AI_PKCS_RSAPublic" initialized from "NULL_PTR". Call B_SetAlgorithmInfo passing "encryptObj" and "AI_PKCS_RSAPublic" and "_InfoPointer". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call Call B_EncryptInit passing "encryptObj" and "publicKey" and "_Chooser" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_EncryptUpdate passing "encryptObj" and address of next free byte in buffer "output" and address of "_OutputLen" and length of free bytes in buffer "output" and address of first initialized byte in buffer "input" and length of initialized bytes in buffer "input" and "random" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "output" by "_OutputLen". Call B_EncryptFinal passing "encryptObj" and address of next free byte in buffer "output" and address of "_OutputLen" and length of free bytes in buffer "output" and "random" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "output" by "_OutputLen". Finalize buffer "output". Check equality of buffer "output" with hex value "0016c2127c2b9168f3a05c206f6b916184f55bdc94937f0e0751234be72dc91 a70827014583dd56096544c527e3d183ff9eaf634ec1d1515c58031c782fc367 ba1f5a94ed3ef5d7be7024dfd71766fa1f1cc6fa6107e782d554e0012c8c4591 d8717f81f850cfc56b4696ff8cc46d04021ba26c2dd40e2a82cbdd54a2c07cc9 b2412fe5a584f6a10d051c5ca8d38882e0b1c1f1d21e171fb2b7d3c5f614d9aa 0b5bfee22ce6afced8096590e34545467a80a2ace4f53577b1da62bfe38516c8 760c509406b1037908f648739aa0c52a2c4ace9364eb9ee645270466f64f8338 4b16403bc5610adf98296e7c4e0da75344fb811ad8bdfcd2a7899". Call Call B_DestroyAlgorithmObject passing "encryptObj". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Baldwin Informational, Expires 12/25/1999 178 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Note: Private key encryption. Create algorithm object "encryptObj". Call B_CreateAlgorithmObject passing "encryptObj". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set "_InfoPointer" to address of info structure for "AI_PKCS_RSAPrivate" initialized from "NULL_PTR". Call B_SetAlgorithmInfo passing "encryptObj" and "AI_PKCS_RSAPrivate" and "_InfoPointer". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call Call B_EncryptInit passing "encryptObj" and "privateKey" and "_Chooser" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_EncryptUpdate passing "encryptObj" and address of next free byte in buffer "output" and address of "_OutputLen" and length of free bytes in buffer "output" and address of first initialized byte in buffer "input" and length of initialized bytes in buffer "input" and "random" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "output" by "_OutputLen". Call B_EncryptFinal passing "encryptObj" and address of next free byte in buffer "output" and address of "_OutputLen" and length of free bytes in buffer "output" and "random" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "output" by "_OutputLen". Finalize buffer "output". Check equality of buffer "output" with hex value "018a5aeb53a816ed677c0d3240807025dfed44ac0c8a92a2461bd847a2aa257 f437ea8977666b09f07ea83dbe6dbed5e7c0f28723decf099a3dfd569825a457 0f96bdbec49e2b8f7d8a67d5e01e13469661403debc70bff9fcba6dbd226c80a 27e25b4f9eb01b53fe904a11ec46cdf2447df4512b7dc2fb4f4f2050f99f7e8d a526122d352b55ee3db2cea7deecb3e7611de03ca8a350c83217449d2a3c87a0 d80c587b92937f83e16d6f42e69761981f5d64148861dd1a5790b58cd702ee21 e18abd310d5d2604a4adeeaaf2274a0c0caf43c1a48d0ffe8264e756fa223f1b 51b6741dd7d21e8b52224dc2cf86c1c030b2a323c69122980a85d". Note: ---------------------------------------------------------- Note: ---------- Note: ---------------------------------------------------------- Baldwin Informational, Expires 12/25/1999 179 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Note: ---------- This is the end of test case "TVRSAP02". This is the start of test case "TVRSAPK1". Set "_ExpectedStatus" to zero. Set "_Chooser" to "NULL_PTR". Set "_SurrenderContext" to "NULL_PTR". Note: Vector tests, PKCS 1 V2 OAEP RSA encryption and Note: decryption Note: ---------------------------------------------------------- Note: ---------- Note: Start with the GlobalInit Set "_Chooser" to "AM_RSA_ENCRYPT", "AM_RSA_CRT_ENCRYPT", "AM_MD2_RANDOM", "NULL_PTR". Note: Use the following random algorithm object througout. Create algorithm object "random". Call B_CreateAlgorithmObject passing "random". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set "_InfoPointer" to address of info structure for "AI_MD5Random" initialized from "NULL_PTR". Call B_SetAlgorithmInfo passing "random" and "AI_MD5Random" and "_InfoPointer". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call Call B_RandomInit passing "random" and "_Chooser" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Create buffer "seed" of decimal value "2" bytes. Set buffer "seed" to hex value "0000". Call B_RandomUpdate passing "random" and address of first initialized byte in "seed" and length of initialized bytes in "seed" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Note: ---------------------------------------------------------- Note: ---------- Note: Test 01-1 Note: Input the value given and check the result. Baldwin Informational, Expires 12/25/1999 180 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Note: Use the following 777-bit keypair Create key object "publicKey". Call B_CreateKeyObject passing "publicKey". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set "_InfoPointer" to address of info structure for "KI_RSAPublic" initialized from "01aff1bfa898e4656dc06f97f5cda85 345e4813a92e57c39a72f277a4dfeaad685507241f61b0c5e744a2bf12ee2b16 2d7674c8de231bedbf3af349bf92199d2e97c735033c39e109fac775d12ebdae d0132ee1e9125816f8099c84b93f946379cb7", "010001". Call B_SetKeyInfo passing "publicKey" and "KI_RSAPublic" and "_InfoPointer". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Create key object "privateKey". Call B_CreateKeyObject passing "privateKey". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set "_InfoPointer" to address of info structure for "KI_PKCS_RSAPrivate" initialized from "01aff1bfa898e4656dc06f97f 5cda85345e4813a92e57c39a72f277a4dfeaad685507241f61b0c5e744a2bf12 ee2b162d7674c8de231bedbf3af349bf92199d2e97c735033c39e109fac775d1 2ebdaed0132ee1e9125816f8099c84b93f946379cb7", "010001", "cb58ef16ab2bd3085130f80433168c657a06d0917951fb3e56b7aa1f6fc5f38 9fd6e5cd944b09503002c21b625e8c69476687355240df3c2177d7564c2780bb baa855b70103cf7a540c5d7e7136cbcb6aa8d5518b3ae9032f7468b7d81ee616 d89", "1fb6d010eab6f59a4421a6778f911a33148eb2a70513d9b5648a30d8b 27874bfea18ee6a869ad6d5236b538a62a46f1325", "0d9eb46fbf1a16db07b 10030fed4d1ce687b613520575a33c48502801c4ba475d46dac29e667d89af03 2b64e103d5f97ab", "1145d240c4756d82ddc4ae13c43fb55348c907886bfd8 9bf7fc8bc1de9e62d403151eed85a038f2a7aa603d40531a5c579", "0d0596d85c6b123d19ee7613622191f2f9dc34c579856afda1bfd5f32c9a79c 41a753d2cd658a53505c046a2fe4ddf8e7f", "0382dd6cc2d80db494cc60908 1b56d37e4dcbc592ffedaa02a225ee8a09204a4b094ab514f69d668b8423499d ae135ffac". Call B_SetKeyInfo passing "privateKey" and "KI_PKCS_RSAPrivate" and "_InfoPointer". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Note: Encrypt and decrypt the following data. Create buffer "input" of decimal value "32" bytes. Set buffer "input" with string value "RSA Data Security Bsafe Toolkit". Baldwin Informational, Expires 12/25/1999 181 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Create buffer "encryptedResult" of decimal value "400" bytes. Set buffer "encryptedResult" to hex value "0118f15daa7e60ec2a8b7 6c3e3c94c6e1c684b98461d6986f442f695e5568472b30f8bb304d039a1ef705 c29c59f50e6c9b5066aa3d5af6e29f2a2608c9f4016eb7195d230274334631e5 8925129b36b3be655adbdbbeac5f7319ce1104fe39d1786". Create buffer "output" of decimal value "200" bytes. Note: Public key encryption. Create algorithm object "encryptObj". Call B_CreateAlgorithmObject passing "encryptObj". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set "_InfoPointer" to address of info structure for "AI_PKCS_OAEP_RSAPublic" initialized from "sha1", "mgf1", "sha1", "specifiedParameters",. Call B_SetAlgorithmInfo passing "encryptObj" and "AI_PKCS_OAEP_RSAPublic" and "_InfoPointer". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call Call B_EncryptInit passing "encryptObj" and "publicKey" and "_Chooser" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_EncryptUpdate passing "encryptObj" and address of next free byte in buffer "output" and address of "_OutputLen" and length of free bytes in buffer "output" and address of first initialized byte in buffer "input" and length of initialized bytes in buffer "input" and "random" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "output" by "_OutputLen". Call B_EncryptFinal passing "encryptObj" and address of next free byte in buffer "output" and address of "_OutputLen" and length of free bytes in buffer "output" and "random" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "output" by "_OutputLen". Finalize buffer "output". Check equality of buffer "encryptedResult" with contents of buffer "output". Set "_InfoPointer" to address of info structure for "AI_PKCS_OAEP_RSAPublic". Call B_GetAlgorithmInfo passing "_InfoPointer" and "encryptObj" and "AI_PKCS_OAEP_RSAPublic". Baldwin Informational, Expires 12/25/1999 182 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Display info structure for "AI_PKCS_OAEP_RSAPublic". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Create buffer "output" of decimal value "200" bytes. Note: Private key decryption. Create algorithm object "decryptObj". Call B_CreateAlgorithmObject passing "decryptObj". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set "_InfoPointer" to address of info structure for "AI_PKCS_OAEP_RSAPrivate" initialized from "sha1", "mgf1", "sha1", "specifiedParameters",. Call B_SetAlgorithmInfo passing "decryptObj" and "AI_PKCS_OAEP_RSAPrivate" and "_InfoPointer". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call Call B_DecryptInit passing "decryptObj" and "privateKey" and "_Chooser" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_DecryptUpdate passing "decryptObj" and address of next free byte in buffer "output" and address of "_OutputLen" and length of free bytes in buffer "output" and address of first initialized byte in buffer "encryptedResult" and length of initialized bytes in buffer "encryptedResult" and "random" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "output" by "_OutputLen". Call B_DecryptFinal passing "decryptObj" and address of next free byte in buffer "output" and address of "_OutputLen" and length of free bytes in buffer "output" and "random" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "output" by "_OutputLen". Finalize buffer "output". Check equality of buffer "input" with contents of buffer "output". Set "_InfoPointer" to address of info structure for "AI_PKCS_OAEP_RSAPrivate". Baldwin Informational, Expires 12/25/1999 183 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Call B_GetAlgorithmInfo passing "_InfoPointer" and "decryptObj" and "AI_PKCS_OAEP_RSAPrivate". Display info structure for "AI_PKCS_OAEP_RSAPrivate". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Note: ---------------------------------------------------------- Note: ---------- Note: ---------------------------------------------------------- Note: ---------- This is the end of test case "TVRSAPK1". This is the start of test case "TVRSAPK2". Set "_ExpectedStatus" to zero. Set "_Chooser" to "NULL_PTR". Set "_SurrenderContext" to "NULL_PTR". Note: Vector tests, PKCS 1 V2 OAEP RSA encryption and Note: decryption Note: ---------------------------------------------------------- Note: ---------- Note: Start with the GlobalInit Set "_Chooser" to "AM_RSA_ENCRYPT", "AM_RSA_CRT_ENCRYPT", "AM_MD2_RANDOM", "NULL_PTR". Note: Use the following random algorithm object througout. Create algorithm object "random". Call B_CreateAlgorithmObject passing "random". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set "_InfoPointer" to address of info structure for "AI_MD5Random" initialized from "NULL_PTR". Call B_SetAlgorithmInfo passing "random" and "AI_MD5Random" and "_InfoPointer". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call Call B_RandomInit passing "random" and "_Chooser" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Create buffer "seed" of decimal value "2" bytes. Set buffer "seed" to hex value "0000". Baldwin Informational, Expires 12/25/1999 184 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Call B_RandomUpdate passing "random" and address of first initialized byte in "seed" and length of initialized bytes in "seed" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Note: ---------------------------------------------------------- Note: ---------- Note: Test 01-1 Note: Input the value given and check the result. Note: Use the following 777-bit keypair Create key object "publicKey". Call B_CreateKeyObject passing "publicKey". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set "_InfoPointer" to address of info structure for "KI_RSAPublic" initialized from "01aff1bfa898e4656dc06f97f5cda85 345e4813a92e57c39a72f277a4dfeaad685507241f61b0c5e744a2bf12ee2b16 2d7674c8de231bedbf3af349bf92199d2e97c735033c39e109fac775d12ebdae d0132ee1e9125816f8099c84b93f946379cb7", "010001". Call B_SetKeyInfo passing "publicKey" and "KI_RSAPublic" and "_InfoPointer". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Create key object "privateKey". Call B_CreateKeyObject passing "privateKey". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set "_InfoPointer" to address of info structure for "KI_PKCS_RSAPrivate" initialized from "01aff1bfa898e4656dc06f97f 5cda85345e4813a92e57c39a72f277a4dfeaad685507241f61b0c5e744a2bf12 ee2b162d7674c8de231bedbf3af349bf92199d2e97c735033c39e109fac775d1 2ebdaed0132ee1e9125816f8099c84b93f946379cb7", "010001", "cb58ef16ab2bd3085130f80433168c657a06d0917951fb3e56b7aa1f6fc5f38 9fd6e5cd944b09503002c21b625e8c69476687355240df3c2177d7564c2780bb baa855b70103cf7a540c5d7e7136cbcb6aa8d5518b3ae9032f7468b7d81ee616 d89", "1fb6d010eab6f59a4421a6778f911a33148eb2a70513d9b5648a30d8b 27874bfea18ee6a869ad6d5236b538a62a46f1325", "0d9eb46fbf1a16db07b 10030fed4d1ce687b613520575a33c48502801c4ba475d46dac29e667d89af03 2b64e103d5f97ab", "1145d240c4756d82ddc4ae13c43fb55348c907886bfd8 9bf7fc8bc1de9e62d403151eed85a038f2a7aa603d40531a5c579", "0d0596d85c6b123d19ee7613622191f2f9dc34c579856afda1bfd5f32c9a79c 41a753d2cd658a53505c046a2fe4ddf8e7f", "0382dd6cc2d80db494cc60908 1b56d37e4dcbc592ffedaa02a225ee8a09204a4b094ab514f69d668b8423499d Baldwin Informational, Expires 12/25/1999 185 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 ae135ffac". Call B_SetKeyInfo passing "privateKey" and "KI_PKCS_RSAPrivate" and "_InfoPointer". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Note: Encrypt and decrypt the following data. Create buffer "input" of decimal value "32" bytes. Set buffer "input" with string value "RSA Data Security Bsafe Toolkit". Create buffer "encryptedResult" of decimal value "400" bytes. Set buffer "encryptedResult" to hex value "0118f15daa7e60ec2a8b7 6c3e3c94c6e1c684b98461d6986f442f695e5568472b30f8bb304d039a1ef705 c29c59f50e6c9b5066aa3d5af6e29f2a2608c9f4016eb7195d230274334631e5 8925129b36b3be655adbdbbeac5f7319ce1104fe39d1786". Create buffer "output" of decimal value "200" bytes. Note: Public key encryption. Create algorithm object "encryptObj". Call B_CreateAlgorithmObject passing "encryptObj". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set "_InfoPointer" to address of info structure for "AI_PKCS_OAEP_RSAPublicBER" initialized from "304506092a864886f70d0101073038a00b300906052b0e03021a0500a118301 606092a864886f70d010108300906052b0e03021a0500a20f300d06092a86488 6f70d0101090400". Call B_SetAlgorithmInfo passing "encryptObj" and "AI_PKCS_OAEP_RSAPublicBER" and "_InfoPointer". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call Call B_EncryptInit passing "encryptObj" and "publicKey" and "_Chooser" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_EncryptUpdate passing "encryptObj" and address of next free byte in buffer "output" and address of "_OutputLen" and length of free bytes in buffer "output" and address of first initialized byte in buffer "input" and length of initialized bytes in buffer "input" and "random" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "output" by "_OutputLen". Call B_EncryptFinal passing "encryptObj" and address of next Baldwin Informational, Expires 12/25/1999 186 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 free byte in buffer "output" and address of "_OutputLen" and length of free bytes in buffer "output" and "random" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "output" by "_OutputLen". Finalize buffer "output". Check equality of buffer "encryptedResult" with contents of buffer "output". Set "_InfoPointer" to address of info structure for "AI_PKCS_OAEP_RSAPublic". Call B_GetAlgorithmInfo passing "_InfoPointer" and "encryptObj" and "AI_PKCS_OAEP_RSAPublic". Display info structure for "AI_PKCS_OAEP_RSAPublic". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Create buffer "output" of decimal value "200" bytes. Note: Private key decryption. Create algorithm object "decryptObj". Call B_CreateAlgorithmObject passing "decryptObj". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set "_InfoPointer" to address of info structure for "AI_PKCS_OAEP_RSAPrivateBER" initialized from "304506092a864886f70d0101073038a00b300906052b0e03021a0500a118301 606092a864886f70d010108300906052b0e03021a0500a20f300d06092a86488 6f70d0101090400". Call B_SetAlgorithmInfo passing "decryptObj" and "AI_PKCS_OAEP_RSAPrivateBER" and "_InfoPointer". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call Call B_DecryptInit passing "decryptObj" and "privateKey" and "_Chooser" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_DecryptUpdate passing "decryptObj" and address of next free byte in buffer "output" and address of "_OutputLen" and length of free bytes in buffer "output" and address of first initialized byte in buffer "encryptedResult" and length of initialized bytes in buffer "encryptedResult" and "random" and "_SurrenderContext". Set "_Status" to return value. Baldwin Informational, Expires 12/25/1999 187 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "output" by "_OutputLen". Call B_DecryptFinal passing "decryptObj" and address of next free byte in buffer "output" and address of "_OutputLen" and length of free bytes in buffer "output" and "random" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "output" by "_OutputLen". Finalize buffer "output". Check equality of buffer "input" with contents of buffer "output". Set "_InfoPointer" to address of info structure for "AI_PKCS_OAEP_RSAPrivate". Call B_GetAlgorithmInfo passing "_InfoPointer" and "decryptObj" and "AI_PKCS_OAEP_RSAPrivate". Display info structure for "AI_PKCS_OAEP_RSAPrivate". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Note: ---------------------------------------------------------- Note: ---------- Note: ---------------------------------------------------------- Note: ---------- This is the end of test case "TVRSAPK2". This is the start of test case "TVRSAS01". Set "_ExpectedStatus" to zero. Set "_Chooser" to "NULL_PTR". Set "_SurrenderContext" to "NULL_PTR". Note: Vector tests, RSA Sign and Verify Note: ---------------------------------------------------------- Note: ---------- Note: Start with the GlobalInit Set "_Chooser" to "AM_RSA_DECRYPT", "AM_RSA_CRT_ENCRYPT", "NULL_PTR". Set "_Chooser" to "AM_MD2", "AM_MD5", "AM_SHA", "NULL_PTR". Note: Test 01-1 Note: Create a signature, compare it to the result from 2.1.2. Baldwin Informational, Expires 12/25/1999 188 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Note: Use an arbitrary public/private keypair, this one Note: contains a Note: 768-bit modulus. Create key object "publicKey". Call B_CreateKeyObject passing "publicKey". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set "_InfoPointer" to address of info structure for "KI_RSAPublic" initialized from "cc76652b4b5d972b25c464d23b965fa a52ca08b1012239f4aa3f8d518bf550c56dc4c684c78fe4ed492728005a7c101 2a072ecd28592a6b0f520445e41eb4884a2b801d8b579e6920fa7d25c0b02359 263af4dd4beececaa9dd59671351bb59f", "010001". Call B_SetKeyInfo passing "publicKey" and "KI_RSAPublic" and "_InfoPointer". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Create key object "privateKey". Call B_CreateKeyObject passing "privateKey". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set "_InfoPointer" to address of info structure for "KI_PKCS_RSAPrivate" initialized from "cc76652b4b5d972b25c464d23 b965faa52ca08b1012239f4aa3f8d518bf550c56dc4c684c78fe4ed492728005 a7c1012a072ecd28592a6b0f520445e41eb4884a2b801d8b579e6920fa7d25c0 b02359263af4dd4beececaa9dd59671351bb59f", "010001", "8ce64e23bec51946bfb90ead9e28ab7669a516c63bfcc529a9253092f0bb365 547a6e213609ef5e8db8fa34e530cc9d980ea4253c6624734e57fbc5d5df7775 536ecdd195e9e7e640f4301d3d12f391d012a1e552208c1c396a49d2d561390a 9", "e5db12250f865ace6d9613df55b2bddbbf3887e061f55c9228906873216 ff0c03a146bfd3d279ef57221fed054b502fb", "e3b7eca5658d8530e3f6e5e 0806a533b0d2bd86a348339548140ddab84b27247a6235b3d563d053802d652c 671eb76ad", "b9aa07f109a643e92459aa79a6d677476e2132980b684ebafca b10c39689be14f79511597fb16653ea3a0d82a839824b", "104bcf419edcdbd53ddb2364478c545c7b7ad1c7f7ee14223a05bc5753edb94 3eb5dc85fc1562893739086e7f0ab1b19", "875198f828082848eac2487c92d 6093d576382ab367eadcf059cd6a5a9062c9d6157a45631648cbffab6273361c 6ccb7". Call B_SetKeyInfo passing "privateKey" and "KI_PKCS_RSAPrivate" and "_InfoPointer". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Note: Set the data to sign Create buffer "input" of decimal value "1" bytes. Set buffer "input" to hex value "00". Baldwin Informational, Expires 12/25/1999 189 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Note: The signature will be the same size as the modulus. Create buffer "output" of decimal value "96" bytes. Note: Use AI_MD2WithRSAEncryption Create algorithm object "signObj". Call B_CreateAlgorithmObject passing "signObj". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set "_InfoPointer" to address of info structure for "AI_MD2WithRSAEncryption" initialized from "NULL_PTR". Call B_SetAlgorithmInfo passing "signObj" and "AI_MD2WithRSAEncryption" and "_InfoPointer". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set "_ExpectedInfoPointer" to address of expected info structure for "AI_MD2WithRSAEncryptionBER" initialized from "300d06092a864886f70d0101020500". Set "_InfoPointer" to address of info structure for "AI_MD2WithRSAEncryptionBER". Call B_GetAlgorithmInfo passing "_InfoPointer" and "signObj" and "AI_MD2WithRSAEncryptionBER". Check equality of info structure for "AI_MD2WithRSAEncryptionBER " with expected info structure for "AI_MD2WithRSAEncryptionBER". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call Call B_SignInit passing "signObj" and "privateKey" and "_Chooser" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_SignUpdate passing "signObj" and address of first initialized byte in buffer "input" and length of initialized bytes in buffer "input" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_SignFinal passing "signObj" and address of next free byte in buffer "output" and address of "_OutputLen" and length of free bytes in buffer "output" and "NULL_PTR" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "output" by "_OutputLen". Finalize buffer "output". Check equality of buffer "output" with hex value "454aba121005f84e408d3d5d9c8402028f42e8d44b112fd20ae916036edaf28 Baldwin Informational, Expires 12/25/1999 190 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 cde5f1ca09d9447e874695ef335dcb7eef68a42bf4d936d95884764a8dd2844c a90af3123a92798c11a778f1e1144b12ee2a7b9047ae8dc57e4218545a9e9bb9 6". Note: Might as well verify it. Create algorithm object "verifyObj". Call B_CreateAlgorithmObject passing "verifyObj". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set "_InfoPointer" to address of info structure for "AI_MD2WithRSAEncryptionBER" initialized from "300d06092a864886f70d0101020500". Call B_SetAlgorithmInfo passing "verifyObj" and "AI_MD2WithRSAEncryptionBER" and "_InfoPointer". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set "_ExpectedInfoPointer" to address of expected info structure for "AI_MD2WithRSAEncryption" initialized from "NULL_PTR". Set "_InfoPointer" to address of info structure for "AI_MD2WithRSAEncryption". Call B_GetAlgorithmInfo passing "_InfoPointer" and "verifyObj" and "AI_MD2WithRSAEncryption". Check equality of info structure for "AI_MD2WithRSAEncryption" with expected info structure for "AI_MD2WithRSAEncryption". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call Call B_VerifyInit passing "verifyObj" and "publicKey" and "_Chooser" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_VerifyUpdate passing "verifyObj" and address of first initialized byte in buffer "input" and length of initialized bytes in buffer "input" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_VerifyFinal passing "verifyObj" and address of first initialized byte in buffer "output" and length of initialized bytes in buffer "output" and "NULL_PTR" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Note: ---------------------------------------------------------- Note: ---------- Note: Test 01-2 Baldwin Informational, Expires 12/25/1999 191 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Note: Perform the same test as 01-1 except use Note: AI_MD5WithRSAEncryption. Call Call B_DestroyAlgorithmObject passing "signObj". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call Call B_DestroyAlgorithmObject passing "verifyObj". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Create algorithm object "signObj". Call B_CreateAlgorithmObject passing "signObj". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set "_InfoPointer" to address of info structure for "AI_MD5WithRSAEncryption" initialized from "NULL_PTR". Call B_SetAlgorithmInfo passing "signObj" and "AI_MD5WithRSAEncryption" and "_InfoPointer". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set "_ExpectedInfoPointer" to address of expected info structure for "AI_MD5WithRSAEncryptionBER" initialized from "300d06092a864886f70d0101040500". Set "_InfoPointer" to address of info structure for "AI_MD5WithRSAEncryptionBER". Call B_GetAlgorithmInfo passing "_InfoPointer" and "signObj" and "AI_MD5WithRSAEncryptionBER". Check equality of info structure for "AI_MD5WithRSAEncryptionBER " with expected info structure for "AI_MD5WithRSAEncryptionBER". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call Call B_SignInit passing "signObj" and "privateKey" and "_Chooser" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_SignUpdate passing "signObj" and address of first initialized byte in buffer "input" and length of initialized bytes in buffer "input" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_SignFinal passing "signObj" and address of next free byte in buffer "output" and address of "_OutputLen" and length of free bytes in buffer "output" and "NULL_PTR" and "_SurrenderContext". Set "_Status" to return value. Baldwin Informational, Expires 12/25/1999 192 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "output" by "_OutputLen". Finalize buffer "output". Check equality of buffer "output" with hex value "372e8ebcf4bd1b57b948ecaedc3decd9daca72a314b915f45db655978fea1ee e90fc822cb145621cc3b5de6a431f83edb169c9a8e4affcb2db45ef097ff89cd 6f1c7595f5e39d3a781019300b11c66271931c8391664ec4e40fcdb28fe26d6f 0". Create algorithm object "verifyObj". Call B_CreateAlgorithmObject passing "verifyObj". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set "_InfoPointer" to address of info structure for "AI_MD5WithRSAEncryptionBER" initialized from "300d06092a864886f70d0101040500". Call B_SetAlgorithmInfo passing "verifyObj" and "AI_MD5WithRSAEncryptionBER" and "_InfoPointer". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set "_ExpectedInfoPointer" to address of expected info structure for "AI_MD5WithRSAEncryption" initialized from "NULL_PTR". Set "_InfoPointer" to address of info structure for "AI_MD5WithRSAEncryption". Call B_GetAlgorithmInfo passing "_InfoPointer" and "verifyObj" and "AI_MD5WithRSAEncryption". Check equality of info structure for "AI_MD5WithRSAEncryption" with expected info structure for "AI_MD5WithRSAEncryption". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call Call B_VerifyInit passing "verifyObj" and "publicKey" and "_Chooser" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_VerifyUpdate passing "verifyObj" and address of first initialized byte in buffer "input" and length of initialized bytes in buffer "input" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_VerifyFinal passing "verifyObj" and address of first initialized byte in buffer "output" and length of initialized bytes in buffer "output" and "NULL_PTR" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Baldwin Informational, Expires 12/25/1999 193 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Note: ---------------------------------------------------------- Note: ---------- Note: Test 01-3 Note: Perform the same test as 01-1 except use Note: AI_SHA1WithRSAEncryption. Call Call B_DestroyAlgorithmObject passing "signObj". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call Call B_DestroyAlgorithmObject passing "verifyObj". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Create algorithm object "signObj". Call B_CreateAlgorithmObject passing "signObj". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set "_InfoPointer" to address of info structure for "AI_SHA1WithRSAEncryption" initialized from "NULL_PTR". Call B_SetAlgorithmInfo passing "signObj" and "AI_SHA1WithRSAEncryption" and "_InfoPointer". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set "_ExpectedInfoPointer" to address of expected info structure for "AI_SHA1WithRSAEncryptionBER" initialized from "300d06092a864886f70d0101050500". Set "_InfoPointer" to address of info structure for "AI_SHA1WithRSAEncryptionBER". Call B_GetAlgorithmInfo passing "_InfoPointer" and "signObj" and "AI_SHA1WithRSAEncryptionBER". Check equality of info structure for "AI_SHA1WithRSAEncryptionBE R" with expected info structure for "AI_SHA1WithRSAEncryptionBER ". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call Call B_SignInit passing "signObj" and "privateKey" and "_Chooser" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_SignUpdate passing "signObj" and address of first initialized byte in buffer "input" and length of initialized bytes in buffer "input" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Baldwin Informational, Expires 12/25/1999 194 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Call B_SignFinal passing "signObj" and address of next free byte in buffer "output" and address of "_OutputLen" and length of free bytes in buffer "output" and "NULL_PTR" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "output" by "_OutputLen". Finalize buffer "output". Check equality of buffer "output" with hex value "7d58a091070949865161c648af0056914db6814f8795e2bbd9ae1b98040c635 15238d60abf891f60cb7794b0e641a3da81226b57caaa2634a0bafc502f7e1cb 3179884845f3087e054a69f00a4f2e7e0faecfe00592f109f342589fbc67ed14 7". Create algorithm object "verifyObj". Call B_CreateAlgorithmObject passing "verifyObj". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set "_InfoPointer" to address of info structure for "AI_SHA1WithRSAEncryptionBER" initialized from "300d06092a864886f70d0101050500". Call B_SetAlgorithmInfo passing "verifyObj" and "AI_SHA1WithRSAEncryptionBER" and "_InfoPointer". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set "_ExpectedInfoPointer" to address of expected info structure for "AI_SHA1WithRSAEncryption" initialized from "NULL_PTR". Set "_InfoPointer" to address of info structure for "AI_SHA1WithRSAEncryption". Call B_GetAlgorithmInfo passing "_InfoPointer" and "verifyObj" and "AI_SHA1WithRSAEncryption". Check equality of info structure for "AI_SHA1WithRSAEncryption" with expected info structure for "AI_SHA1WithRSAEncryption". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call Call B_VerifyInit passing "verifyObj" and "publicKey" and "_Chooser" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_VerifyUpdate passing "verifyObj" and address of first initialized byte in buffer "input" and length of initialized bytes in buffer "input" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_VerifyFinal passing "verifyObj" and address of first initialized byte in buffer "output" and length of initialized Baldwin Informational, Expires 12/25/1999 195 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 bytes in buffer "output" and "NULL_PTR" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Note: ---------------------------------------------------------- Note: ---------- Note: ---------------------------------------------------------- Note: ---------- This is the end of test case "TVRSAS01". This is the start of test case "TVRSAS02". Set "_ExpectedStatus" to zero. Set "_Chooser" to "NULL_PTR". Set "_SurrenderContext" to "NULL_PTR". Note: Vector tests, RSA Sign and Verify Note: ---------------------------------------------------------- Note: ---------- Note: Start with the GlobalInit Set "_Chooser" to "AM_RSA_DECRYPT", "AM_RSA_CRT_ENCRYPT", "NULL_PTR". Set "_Chooser" to "AM_MD2", "AM_MD5", "AM_SHA", "NULL_PTR". Note: Test 02-1 Note: Create a signature, compare it to the result from 2.1.2. Note: Use an arbitrary public/private keypair, this one Note: contains a Note: 1024-bit modulus. Create key object "publicKey". Call B_CreateKeyObject passing "publicKey". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set "_InfoPointer" to address of info structure for "KI_RSAPublic" initialized from "d1bb134b2583eb6008cfcb10943f4b5 40872876a2e3f31ffd704b99f62d005cb4eac429d625b0bd4de002d63f74e5e8 a09c3be7a269dc941739e6d8532ba5b32695350bf9659f5ea71ee8bf4102ce71 2272e12a849e4e62342c2ce6c5143327eb3007e5bf4d709e89e0181d6d603514 7a93d79ddc4175cccf2ceecf4c298fc17", "010001". Call B_SetKeyInfo passing "publicKey" and "KI_RSAPublic" and "_InfoPointer". Set "_Status" to return value. Baldwin Informational, Expires 12/25/1999 196 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Create key object "privateKey". Call B_CreateKeyObject passing "privateKey". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set "_InfoPointer" to address of info structure for "KI_PKCS_RSAPrivate" initialized from "d1bb134b2583eb6008cfcb109 43f4b540872876a2e3f31ffd704b99f62d005cb4eac429d625b0bd4de002d63f 74e5e8a09c3be7a269dc941739e6d8532ba5b32695350bf9659f5ea71ee8bf41 02ce712272e12a849e4e62342c2ce6c5143327eb3007e5bf4d709e89e0181d6d 6035147a93d79ddc4175cccf2ceecf4c298fc17", "010001", "309d3368acc67a4da55d3d0d97bf601f9761acbfd0fe77017d7eabe4250c60f b723dfda6eb807d2a9756e52e91c989a2678706e4db84a17cd966f4adf6473a1 1f6e9f1d208cb569c8d3bc1a01625364d6db2aab90bfa0b5e3925e5c9c1a8dc8 4fdb6546b8217a657741aa7b21a7fafff9ed0d758deeb4fc3af0d416be8398f7 1", "e8fefba76de45cfaf347ce2ed30e935ff19db5e0c99f685c0ca2e42f567 a5fcbdefbba4242519491bd9f9676addac54d51ad11d78572687b9a626f999a0 579b9", "e6700efd7438554f5a1c5f07dbe07d357858dc85de049f30fbb69b7 e86d4eb793da00e44e5bfbe0dea93806b64d8a486b4c8336ac34d0688f18af79 4ddb1cc4f", "d5ea550e315cbae9443726dbe2b6bd2417671eb75525dfe0b35 152830bb8aaff38a89127884ff241a48142d98f610e48a0b66f6d1a7e21e369a 8faa161c1a931", "85ab7b068ae42298652d0ff2ff18b988cac6c124e624c83 321d04b6299d3e8c3eb7b6ccb8a7a2f44e34dacb09f4f0c2117bd0a166433ca1 6a606769764023f01", "ac6b6150f924e3d0968b3bc9031bf96ffaa3cf146ef 043545187714f3b099b1165bbd88e84f237a171ac0685b7c5b7c840d393c0fa2 d2bf4d0aa77b9791ab9c3". Call B_SetKeyInfo passing "privateKey" and "KI_PKCS_RSAPrivate" and "_InfoPointer". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Note: Set the data to sign Create buffer "input" of decimal value "1" bytes. Set buffer "input" to hex value "00". Note: The signature will be the same size as the modulus. Create buffer "output" of decimal value "128" bytes. Note: Use AI_MD2WithRSAEncryption Create algorithm object "signObj". Call B_CreateAlgorithmObject passing "signObj". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set "_InfoPointer" to address of info structure for "AI_MD2WithRSAEncryption" initialized from "NULL_PTR". Baldwin Informational, Expires 12/25/1999 197 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Call B_SetAlgorithmInfo passing "signObj" and "AI_MD2WithRSAEncryption" and "_InfoPointer". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set "_ExpectedInfoPointer" to address of expected info structure for "AI_MD2WithRSAEncryptionBER" initialized from "300d06092a864886f70d0101020500". Set "_InfoPointer" to address of info structure for "AI_MD2WithRSAEncryptionBER". Call B_GetAlgorithmInfo passing "_InfoPointer" and "signObj" and "AI_MD2WithRSAEncryptionBER". Check equality of info structure for "AI_MD2WithRSAEncryptionBER " with expected info structure for "AI_MD2WithRSAEncryptionBER". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call Call B_SignInit passing "signObj" and "privateKey" and "_Chooser" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_SignUpdate passing "signObj" and address of first initialized byte in buffer "input" and length of initialized bytes in buffer "input" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_SignFinal passing "signObj" and address of next free byte in buffer "output" and address of "_OutputLen" and length of free bytes in buffer "output" and "NULL_PTR" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "output" by "_OutputLen". Finalize buffer "output". Check equality of buffer "output" with hex value "59d9fe3d1e3e73e14263da270690ed4e93ecaa4479b512962cb06f0673e1e6c f4695651274eae7779736a344fc1159392c1b35afeff4ce168a9e85e79ba1d65 180c712aaf11532b65b088113de260414adbd1b878952adc27b01367c8427dad 9749c0f5aa42af0254c6c16388af2e27e3e3c392b22bdf82d77486d6ad60349b 8". Note: Might as well verify it. Create algorithm object "verifyObj". Call B_CreateAlgorithmObject passing "verifyObj". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set "_InfoPointer" to address of info structure for "AI_MD2WithRSAEncryptionBER" initialized from Baldwin Informational, Expires 12/25/1999 198 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 "300d06092a864886f70d0101020500". Call B_SetAlgorithmInfo passing "verifyObj" and "AI_MD2WithRSAEncryptionBER" and "_InfoPointer". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set "_ExpectedInfoPointer" to address of expected info structure for "AI_MD2WithRSAEncryption" initialized from "NULL_PTR". Set "_InfoPointer" to address of info structure for "AI_MD2WithRSAEncryption". Call B_GetAlgorithmInfo passing "_InfoPointer" and "verifyObj" and "AI_MD2WithRSAEncryption". Check equality of info structure for "AI_MD2WithRSAEncryption" with expected info structure for "AI_MD2WithRSAEncryption". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call Call B_VerifyInit passing "verifyObj" and "publicKey" and "_Chooser" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_VerifyUpdate passing "verifyObj" and address of first initialized byte in buffer "input" and length of initialized bytes in buffer "input" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_VerifyFinal passing "verifyObj" and address of first initialized byte in buffer "output" and length of initialized bytes in buffer "output" and "NULL_PTR" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Note: ---------------------------------------------------------- Note: ---------- Note: Test 02-2 Note: Perform the same test as 02-1 except use Note: AI_MD5WithRSAEncryption. Call Call B_DestroyAlgorithmObject passing "signObj". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call Call B_DestroyAlgorithmObject passing "verifyObj". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Baldwin Informational, Expires 12/25/1999 199 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Create algorithm object "signObj". Call B_CreateAlgorithmObject passing "signObj". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set "_InfoPointer" to address of info structure for "AI_MD5WithRSAEncryption" initialized from "NULL_PTR". Call B_SetAlgorithmInfo passing "signObj" and "AI_MD5WithRSAEncryption" and "_InfoPointer". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set "_ExpectedInfoPointer" to address of expected info structure for "AI_MD5WithRSAEncryptionBER" initialized from "300d06092a864886f70d0101040500". Set "_InfoPointer" to address of info structure for "AI_MD5WithRSAEncryptionBER". Call B_GetAlgorithmInfo passing "_InfoPointer" and "signObj" and "AI_MD5WithRSAEncryptionBER". Check equality of info structure for "AI_MD5WithRSAEncryptionBER " with expected info structure for "AI_MD5WithRSAEncryptionBER". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call Call B_SignInit passing "signObj" and "privateKey" and "_Chooser" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_SignUpdate passing "signObj" and address of first initialized byte in buffer "input" and length of initialized bytes in buffer "input" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_SignFinal passing "signObj" and address of next free byte in buffer "output" and address of "_OutputLen" and length of free bytes in buffer "output" and "NULL_PTR" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "output" by "_OutputLen". Finalize buffer "output". Check equality of buffer "output" with hex value "aaea3e551cf5bd00d861912a93acbce0e36b1ca16871eab85430ced31071f6b 23ad99ac9387afd99203466ba53132e3e3c3f9e46d4f64bc0f5bf3f55d47b967 113ae888b6f7e084d4db8ebf7d896c3734b0d59126010621d3f1cc0ef2217f89 34c980753be98112904d3d7dfaf7ee659d553f48ebd6f115950a179436519c3c 8". Create algorithm object "verifyObj". Call B_CreateAlgorithmObject passing "verifyObj". Baldwin Informational, Expires 12/25/1999 200 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set "_InfoPointer" to address of info structure for "AI_MD5WithRSAEncryptionBER" initialized from "300d06092a864886f70d0101040500". Call B_SetAlgorithmInfo passing "verifyObj" and "AI_MD5WithRSAEncryptionBER" and "_InfoPointer". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set "_ExpectedInfoPointer" to address of expected info structure for "AI_MD5WithRSAEncryption" initialized from "NULL_PTR". Set "_InfoPointer" to address of info structure for "AI_MD5WithRSAEncryption". Call B_GetAlgorithmInfo passing "_InfoPointer" and "verifyObj" and "AI_MD5WithRSAEncryption". Check equality of info structure for "AI_MD5WithRSAEncryption" with expected info structure for "AI_MD5WithRSAEncryption". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call Call B_VerifyInit passing "verifyObj" and "publicKey" and "_Chooser" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_VerifyUpdate passing "verifyObj" and address of first initialized byte in buffer "input" and length of initialized bytes in buffer "input" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_VerifyFinal passing "verifyObj" and address of first initialized byte in buffer "output" and length of initialized bytes in buffer "output" and "NULL_PTR" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Note: ---------------------------------------------------------- Note: ---------- Note: Test 02-3 Note: Perform the same test as 02-1 except use Note: AI_SHA1WithRSAEncryption. Call Call B_DestroyAlgorithmObject passing "signObj". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Baldwin Informational, Expires 12/25/1999 201 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Call Call B_DestroyAlgorithmObject passing "verifyObj". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Create algorithm object "signObj". Call B_CreateAlgorithmObject passing "signObj". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set "_InfoPointer" to address of info structure for "AI_SHA1WithRSAEncryption" initialized from "NULL_PTR". Call B_SetAlgorithmInfo passing "signObj" and "AI_SHA1WithRSAEncryption" and "_InfoPointer". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set "_ExpectedInfoPointer" to address of expected info structure for "AI_SHA1WithRSAEncryptionBER" initialized from "300d06092a864886f70d0101050500". Set "_InfoPointer" to address of info structure for "AI_SHA1WithRSAEncryptionBER". Call B_GetAlgorithmInfo passing "_InfoPointer" and "signObj" and "AI_SHA1WithRSAEncryptionBER". Check equality of info structure for "AI_SHA1WithRSAEncryptionBE R" with expected info structure for "AI_SHA1WithRSAEncryptionBER ". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call Call B_SignInit passing "signObj" and "privateKey" and "_Chooser" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_SignUpdate passing "signObj" and address of first initialized byte in buffer "input" and length of initialized bytes in buffer "input" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_SignFinal passing "signObj" and address of next free byte in buffer "output" and address of "_OutputLen" and length of free bytes in buffer "output" and "NULL_PTR" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "output" by "_OutputLen". Finalize buffer "output". Check equality of buffer "output" with hex value "3b796db5eda47a67b86933d2fadddf87b88192e8ea690a010b0006e87e9de95 d4e0a1e8c78253001c5d1fe49078850da12feeba244b156d8085279af8fcb5f6 Baldwin Informational, Expires 12/25/1999 202 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 746ecaf02711e361093af3bb812effab9606b64d22b63acb4fb1e68f43b0ceed 65d05506d045e1371d9c37fca2f0a764077cfd6193df02c4a9891d9f4de322cd f". Create algorithm object "verifyObj". Call B_CreateAlgorithmObject passing "verifyObj". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set "_InfoPointer" to address of info structure for "AI_SHA1WithRSAEncryptionBER" initialized from "300d06092a864886f70d0101050500". Call B_SetAlgorithmInfo passing "verifyObj" and "AI_SHA1WithRSAEncryptionBER" and "_InfoPointer". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set "_ExpectedInfoPointer" to address of expected info structure for "AI_SHA1WithRSAEncryption" initialized from "NULL_PTR". Set "_InfoPointer" to address of info structure for "AI_SHA1WithRSAEncryption". Call B_GetAlgorithmInfo passing "_InfoPointer" and "verifyObj" and "AI_SHA1WithRSAEncryption". Check equality of info structure for "AI_SHA1WithRSAEncryption" with expected info structure for "AI_SHA1WithRSAEncryption". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call Call B_VerifyInit passing "verifyObj" and "publicKey" and "_Chooser" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_VerifyUpdate passing "verifyObj" and address of first initialized byte in buffer "input" and length of initialized bytes in buffer "input" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_VerifyFinal passing "verifyObj" and address of first initialized byte in buffer "output" and length of initialized bytes in buffer "output" and "NULL_PTR" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Note: ---------------------------------------------------------- Note: ---------- Note: ---------------------------------------------------------- Note: ---------- Baldwin Informational, Expires 12/25/1999 203 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 This is the end of test case "TVRSAS02". This is the start of test case "TVRSAS03". Set "_ExpectedStatus" to zero. Set "_Chooser" to "NULL_PTR". Set "_SurrenderContext" to "NULL_PTR". Note: Vector tests, RSA Sign and Verify Note: ---------------------------------------------------------- Note: ---------- Note: Start with the GlobalInit Set "_Chooser" to "AM_RSA_DECRYPT", "AM_RSA_CRT_ENCRYPT", "NULL_PTR". Set "_Chooser" to "AM_MD2", "AM_MD5", "AM_SHA", "NULL_PTR". Note: Test 03-1 Note: Create a signature, compare it to the result from 2.1.2. Note: Use an arbitrary public/private keypair, this one Note: contains a Note: 2048-bit modulus. Create key object "publicKey". Call B_CreateKeyObject passing "publicKey". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set "_InfoPointer" to address of info structure for "KI_RSAPublic" initialized from "a40d55504a4a99261ac819e53536b50 a922b6f9e130899606cb3c5bc16ff61376d2538f10e13560b6c49006049b9a1e af070feeac92313074e4a65471d510609ddbe97de1da3817a47f6d3632b9275c ed442a308869a17a29582cc693ac2616bc90bb8c06f9ab88a0c61a08fd2e8eb7 f1b6e04910de8d5d0bd30fdc4b836e70ad992400a96d2845b2bb023a9ce81296 827732e3d68ccae2fd66849179572c7e0e4b5fbb7a92b2f222e020b413ac198b 24f3d297819e0e98f9d8e5291a4918bf4af71476c7b3cd0f7c888151bf5ca9d5 4b98297731ded8ec120920a62b9bc5bbbf9955536abe41ae6731c8ad2f43bfbb b5648961f12d4c26408baec8e609b53bf", "010001". Call B_SetKeyInfo passing "publicKey" and "KI_RSAPublic" and "_InfoPointer". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Create key object "privateKey". Call B_CreateKeyObject passing "privateKey". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Baldwin Informational, Expires 12/25/1999 204 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Set "_InfoPointer" to address of info structure for "KI_PKCS_RSAPrivate" initialized from "a40d55504a4a99261ac819e53 536b50a922b6f9e130899606cb3c5bc16ff61376d2538f10e13560b6c4900604 9b9a1eaf070feeac92313074e4a65471d510609ddbe97de1da3817a47f6d3632 b9275ced442a308869a17a29582cc693ac2616bc90bb8c06f9ab88a0c61a08fd 2e8eb7f1b6e04910de8d5d0bd30fdc4b836e70ad992400a96d2845b2bb023a9c e81296827732e3d68ccae2fd66849179572c7e0e4b5fbb7a92b2f222e020b413 ac198b24f3d297819e0e98f9d8e5291a4918bf4af71476c7b3cd0f7c888151bf 5ca9d54b98297731ded8ec120920a62b9bc5bbbf9955536abe41ae6731c8ad2f 43bfbbb5648961f12d4c26408baec8e609b53bf", "010001", "75bed422e28f9448532497e1794620becb96bd70197d2c8896bc99099d00030 8c31fda34b9c38b187bca11a90a816003be3b7bdb8c2dce7489eebfae410e6c6 51c70b593c876187269c0708c5733b1b697869479841289303a5b3cd7b242dda 57d111ab393e6dad8ca762fc5cabd3e7966789a727a27497f9eaad1192696d15 043feec9ce697b51a5b9e8ef89aecee3a2285088c9213f7f00b26b9130329c0f 29cf26bfa4e8be0c8d7dffaf5b2fdb5dee6ead68af8afeeb0fdbd7f13e464832 612f2171576231d695c0406da99a411bed8f9cad077375a74854ae0dd86cb617 cc639843561e86c5ffaf9fe010736c30c237b9be05d76a9a7bdf9ff332fbc208 1", "d2359d139c5e94e1d7ced3f4dfd3a37a5d68b89196a21dd0619ec71c3dd 221ca9e571382c307aa768029d999ee1f8e24f7cf73c34c1c071495b4f7a28a3 f7aebd09f17cf3f80565f3981bfde9ff55349cbdfd42dfaeaa863a4005ca25fb 7c014a9e16fe38ec741ab07a5cf9df32854344fcf47a00124b81cfcf2ed72c6e 1c221", "c7c9be1f927787728816f008a5e4c1e06b29959c007d365830aa70f 59acdf09d04c326b40aaacc63022a29b860bd8da809a5a6594ca06f506f9f4a8 8adf88d63f704602f477789737cf593959bc3b3e47d74116bf0e3426dfd463ef f0472909d922cb9cd61d9f2edd0878b00e720e659861c4f6bf57d8a15b7d132d bd23e19df", "2cabb6089fd73d9e4cc52827c694ec0da9e2022ef62ad7591c1 5a8cc689aca118bda874be7742e96661ffe9d068c70218d03e9dedbc2ad0283d 9e432075cfc1b36c7484103869b543b1d468fe1c03985da2c63a3adc9c624fe8 a1125745fd112d313143af0718993f5d917a8c22e94ce5513806e1130236c0d9 8f63ac8e6dae1", "374e33a14dcc64e461a3e7e29cf9cc69b1809b77c9f2df7 e5e4a7066ace9e177b5ffc7d1033af0c55fae084a900d290fa14c07d6a48dad0 2d943814080d8535b9edfc9388d521becaa64d8ec0b688b7deef498760703023 aac682bbc30a0fe4380597d3dcb9ea7cf0970dc1beddf7fa4bca94d9b17241f7 b8f9d0bb52a682285", "acc125113028f8150feb24d14672db7f59118d349ff 7a2b0584c841e1e6bfc6033729edd2c7a44cfbe54869f0dbfe21f39f6c7f0419 172c832b83d167e0d2d474c39d1457d47ed986659d216c06edd0b16ece129801 56f5215634ae61995818057fc8bde64994d60743f89d0dbf8f6762efda3fa04c 8acdc983c60a0ad41cc0e". Call B_SetKeyInfo passing "privateKey" and "KI_PKCS_RSAPrivate" and "_InfoPointer". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Note: Set the data to sign Create buffer "input" of decimal value "1" bytes. Set buffer "input" to hex value "00". Note: The signature will be the same size as the modulus. Create buffer "output" of decimal value "256" bytes. Baldwin Informational, Expires 12/25/1999 205 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Note: Use AI_MD2WithRSAEncryption Create algorithm object "signObj". Call B_CreateAlgorithmObject passing "signObj". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set "_InfoPointer" to address of info structure for "AI_MD2WithRSAEncryption" initialized from "NULL_PTR". Call B_SetAlgorithmInfo passing "signObj" and "AI_MD2WithRSAEncryption" and "_InfoPointer". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set "_ExpectedInfoPointer" to address of expected info structure for "AI_MD2WithRSAEncryptionBER" initialized from "300d06092a864886f70d0101020500". Set "_InfoPointer" to address of info structure for "AI_MD2WithRSAEncryptionBER". Call B_GetAlgorithmInfo passing "_InfoPointer" and "signObj" and "AI_MD2WithRSAEncryptionBER". Check equality of info structure for "AI_MD2WithRSAEncryptionBER " with expected info structure for "AI_MD2WithRSAEncryptionBER". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call Call B_SignInit passing "signObj" and "privateKey" and "_Chooser" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_SignUpdate passing "signObj" and address of first initialized byte in buffer "input" and length of initialized bytes in buffer "input" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_SignFinal passing "signObj" and address of next free byte in buffer "output" and address of "_OutputLen" and length of free bytes in buffer "output" and "NULL_PTR" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "output" by "_OutputLen". Finalize buffer "output". Check equality of buffer "output" with hex value "1b984d77e81d87fea72af09e0d8faf5e51d068cb7706f371c81a5bfb509f75a 374a7bfa5991447e734fa4d2319dac524e782d865b305db3d8523cd7f00773e4 252d6d805ceda06b6db10be44c8b5c86241efe2b9117ac5730a1ee261ee323da 998a1562ef61efb81e85e503703d1cf0e1778caccd185d49b4d608e59bcf5609 d81b2c5ad345a87004d238c5069e8c653489862311acd8dc7b66d0979c98006f Baldwin Informational, Expires 12/25/1999 206 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 5d7103cd9758df55d2a27ffca34ef051c12c4c68270881586155c4d4165cedb7 0b6a3286e859c59d277f2548e89410179866d932399df1373900641259eb0ebe 938d16a10507fdc2893a3692b9ed9f55e4d723884403123d5765d0c621ed1bbe d". Note: Might as well verify it. Create algorithm object "verifyObj". Call B_CreateAlgorithmObject passing "verifyObj". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set "_InfoPointer" to address of info structure for "AI_MD2WithRSAEncryptionBER" initialized from "300d06092a864886f70d0101020500". Call B_SetAlgorithmInfo passing "verifyObj" and "AI_MD2WithRSAEncryptionBER" and "_InfoPointer". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set "_ExpectedInfoPointer" to address of expected info structure for "AI_MD2WithRSAEncryption" initialized from "NULL_PTR". Set "_InfoPointer" to address of info structure for "AI_MD2WithRSAEncryption". Call B_GetAlgorithmInfo passing "_InfoPointer" and "verifyObj" and "AI_MD2WithRSAEncryption". Check equality of info structure for "AI_MD2WithRSAEncryption" with expected info structure for "AI_MD2WithRSAEncryption". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call Call B_VerifyInit passing "verifyObj" and "publicKey" and "_Chooser" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_VerifyUpdate passing "verifyObj" and address of first initialized byte in buffer "input" and length of initialized bytes in buffer "input" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_VerifyFinal passing "verifyObj" and address of first initialized byte in buffer "output" and length of initialized bytes in buffer "output" and "NULL_PTR" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Note: ---------------------------------------------------------- Note: ---------- Baldwin Informational, Expires 12/25/1999 207 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Note: Test 03-2 Note: Perform the same test as 03-1 except use Note: AI_MD5WithRSAEncryption. Call Call B_DestroyAlgorithmObject passing "signObj". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call Call B_DestroyAlgorithmObject passing "verifyObj". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Create algorithm object "signObj". Call B_CreateAlgorithmObject passing "signObj". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set "_InfoPointer" to address of info structure for "AI_MD5WithRSAEncryption" initialized from "NULL_PTR". Call B_SetAlgorithmInfo passing "signObj" and "AI_MD5WithRSAEncryption" and "_InfoPointer". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set "_ExpectedInfoPointer" to address of expected info structure for "AI_MD5WithRSAEncryptionBER" initialized from "300d06092a864886f70d0101040500". Set "_InfoPointer" to address of info structure for "AI_MD5WithRSAEncryptionBER". Call B_GetAlgorithmInfo passing "_InfoPointer" and "signObj" and "AI_MD5WithRSAEncryptionBER". Check equality of info structure for "AI_MD5WithRSAEncryptionBER " with expected info structure for "AI_MD5WithRSAEncryptionBER". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call Call B_SignInit passing "signObj" and "privateKey" and "_Chooser" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_SignUpdate passing "signObj" and address of first initialized byte in buffer "input" and length of initialized bytes in buffer "input" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_SignFinal passing "signObj" and address of next free byte in buffer "output" and address of "_OutputLen" and length of free bytes in buffer "output" and "NULL_PTR" and "_SurrenderContext". Baldwin Informational, Expires 12/25/1999 208 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "output" by "_OutputLen". Finalize buffer "output". Check equality of buffer "output" with hex value "07580efc0144ea7f63dfcbf39324c143ecd679f0ffa66d035ae297d5d57fa2e 6892ccb10946bfdde89ed5eefb787c4f3c72b3a3ff5b5a21ae5b1cfe714fd112 c4ff37af4bcc6ea0de5665769ec36438d9f5882da869c380d5e23ee219aedbca 97ed8915798b38d2642fcaa7c636e4e3eb5906ada68a0094ab7ac4571f423e16 f5b2dabf03b7ef801d70e6a5b972c0d0ec39d096619b4873a0caccf17d8856f2 50318d5c583021ee3ecfc6f50f692570fd7dd01cc418a5a5c0bf96860613d166 ca7de3a62fa4f689771ca1e330b52d576bfc14faa106084f5a376b8bba005b98 661c6ef46612a74fb9de62c542baa582921b9ae4f5eec1baadfec04f4fff98c5 b". Create algorithm object "verifyObj". Call B_CreateAlgorithmObject passing "verifyObj". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set "_InfoPointer" to address of info structure for "AI_MD5WithRSAEncryptionBER" initialized from "300d06092a864886f70d0101040500". Call B_SetAlgorithmInfo passing "verifyObj" and "AI_MD5WithRSAEncryptionBER" and "_InfoPointer". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set "_ExpectedInfoPointer" to address of expected info structure for "AI_MD5WithRSAEncryption" initialized from "NULL_PTR". Set "_InfoPointer" to address of info structure for "AI_MD5WithRSAEncryption". Call B_GetAlgorithmInfo passing "_InfoPointer" and "verifyObj" and "AI_MD5WithRSAEncryption". Check equality of info structure for "AI_MD5WithRSAEncryption" with expected info structure for "AI_MD5WithRSAEncryption". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call Call B_VerifyInit passing "verifyObj" and "publicKey" and "_Chooser" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_VerifyUpdate passing "verifyObj" and address of first initialized byte in buffer "input" and length of initialized bytes in buffer "input" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_VerifyFinal passing "verifyObj" and address of first Baldwin Informational, Expires 12/25/1999 209 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 initialized byte in buffer "output" and length of initialized bytes in buffer "output" and "NULL_PTR" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Note: ---------------------------------------------------------- Note: ---------- Note: Test 03-3 Note: Perform the same test as 03-1 except use Note: AI_SHA1WithRSAEncryption. Call Call B_DestroyAlgorithmObject passing "signObj". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call Call B_DestroyAlgorithmObject passing "verifyObj". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Create algorithm object "signObj". Call B_CreateAlgorithmObject passing "signObj". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set "_InfoPointer" to address of info structure for "AI_SHA1WithRSAEncryption" initialized from "NULL_PTR". Call B_SetAlgorithmInfo passing "signObj" and "AI_SHA1WithRSAEncryption" and "_InfoPointer". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set "_ExpectedInfoPointer" to address of expected info structure for "AI_SHA1WithRSAEncryptionBER" initialized from "300d06092a864886f70d0101050500". Set "_InfoPointer" to address of info structure for "AI_SHA1WithRSAEncryptionBER". Call B_GetAlgorithmInfo passing "_InfoPointer" and "signObj" and "AI_SHA1WithRSAEncryptionBER". Check equality of info structure for "AI_SHA1WithRSAEncryptionBE R" with expected info structure for "AI_SHA1WithRSAEncryptionBER ". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call Call B_SignInit passing "signObj" and "privateKey" and "_Chooser" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Baldwin Informational, Expires 12/25/1999 210 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Call B_SignUpdate passing "signObj" and address of first initialized byte in buffer "input" and length of initialized bytes in buffer "input" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_SignFinal passing "signObj" and address of next free byte in buffer "output" and address of "_OutputLen" and length of free bytes in buffer "output" and "NULL_PTR" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "output" by "_OutputLen". Finalize buffer "output". Check equality of buffer "output" with hex value "622bbc3656cce331718ac86441bd27d90db8f78399ee10789b2212e8bba8a1f 5eb35cb1c5905ab505aa50b26850234aa8badec44c4b79eeabc57a4209d5e3b1 52d05f259fcb4f9cfbcc82db130f27ba4d6079f159d25d7086d4f432ac60de8e 6cc7a9dc1d1e3f4700f153343edc68712a61f587f96bc6b67662705f531896d7 8a892f8e9e00e29e37c581edf68bc3e1f54922c604806204ffa169b2d56d6401 b7323e7de5b0ea2df961c61c8896149cb8935a564f2c0fdfe88da64bd8d020c6 a6289ecd97408b233d5110de00314ace4cefe2667cc8b6431e5dd06c89969a63 61395f1deeecaea7ec09a7aebe7e1031bc8cdb0e28c24b21de47453aa67dfe37 2". Create algorithm object "verifyObj". Call B_CreateAlgorithmObject passing "verifyObj". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set "_InfoPointer" to address of info structure for "AI_SHA1WithRSAEncryptionBER" initialized from "300d06092a864886f70d0101050500". Call B_SetAlgorithmInfo passing "verifyObj" and "AI_SHA1WithRSAEncryptionBER" and "_InfoPointer". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set "_ExpectedInfoPointer" to address of expected info structure for "AI_SHA1WithRSAEncryption" initialized from "NULL_PTR". Set "_InfoPointer" to address of info structure for "AI_SHA1WithRSAEncryption". Call B_GetAlgorithmInfo passing "_InfoPointer" and "verifyObj" and "AI_SHA1WithRSAEncryption". Check equality of info structure for "AI_SHA1WithRSAEncryption" with expected info structure for "AI_SHA1WithRSAEncryption". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call Call B_VerifyInit passing "verifyObj" and "publicKey" and "_Chooser" and "_SurrenderContext". Baldwin Informational, Expires 12/25/1999 211 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_VerifyUpdate passing "verifyObj" and address of first initialized byte in buffer "input" and length of initialized bytes in buffer "input" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_VerifyFinal passing "verifyObj" and address of first initialized byte in buffer "output" and length of initialized bytes in buffer "output" and "NULL_PTR" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Note: ---------------------------------------------------------- Note: ---------- Note: ---------------------------------------------------------- Note: ---------- This is the end of test case "TVRSAS03". This is the start of test case "TVSHADES". Set "_ExpectedStatus" to zero. Set "_Chooser" to "NULL_PTR". Set "_SurrenderContext" to "NULL_PTR". Note: vectors test for AI_SHA1WithDES_CBCPad, Note: AI_SHA1WithDES_CBCPadBER Note: ------------------------------------------------------- Note: Start with the GlobalInit Set "_Chooser" to "AM_SHA", "AM_DES_CBC_ENCRYPT", "AM_DES_CBC_DECRYPT", "NULL_PTR". Note: Create global data objects Create buffer "inputData" of decimal value "32" bytes. Create buffer "cypherText" of decimal value "32" bytes. Create buffer "plainText" of decimal value "32" bytes. Create buffer "expectedCypherText" of decimal value "32" bytes. Create buffer "expectedPlainText" of decimal value "32" bytes. Create buffer "salt" of decimal value "8" bytes. Create buffer "password" of decimal value "8" bytes. Note: Initialize global data object Set buffer "salt" to hex value "0011223344556677". Set buffer "password" to hex value "70617373776F7264". Baldwin Informational, Expires 12/25/1999 212 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Set buffer "inputData" to hex value "000102030405060708090A0B0C0 D0E0F101112131415161718191A". Note: Case 1: Note: Set up pbe encryption/decryption algorithm with Note: pbe salt = 0011223344556677 and iteration = 1 Note: Encrypt/Decrypt the inputData with the password Create algorithm object "encryptionAlg". Call B_CreateAlgorithmObject passing "encryptionAlg". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Create algorithm object "decryptionAlg". Call B_CreateAlgorithmObject passing "decryptionAlg". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set "_InfoPointer" to address of info structure for "AI_SHA1WithDES_CBCPad" initialized from contents of buffer "salt", "1". Call B_SetAlgorithmInfo passing "encryptionAlg" and "AI_SHA1WithDES_CBCPad" and "_InfoPointer". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Note: Check its BER encoding Set "_ExpectedInfoPointer" to address of expected info structure for "AI_SHA1WithDES_CBCPadBER" initialized from "301a06092a864886f70d01050a300d04080011223344556677020101". Set "_InfoPointer" to address of info structure for "AI_SHA1WithDES_CBCPadBER". Call B_GetAlgorithmInfo passing "_InfoPointer" and "encryptionAlg" and "AI_SHA1WithDES_CBCPadBER". Check equality of info structure for "AI_SHA1WithDES_CBCPadBER" with expected info structure for "AI_SHA1WithDES_CBCPadBER". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Note: Set the decryption algorithm with the AI_SHA1WithDES_CBCPa Note: dBER Note: 30 1a Note: 06 09 2a 86 48 86 f7 0d 01 05 0a Note: 30 0d Note: 04 08 00 11 22 33 44 55 66 77 Note: 02 01 01 Set "_InfoPointer" to address of info structure for "AI_SHA1WithDES_CBCPadBER" initialized from "301a06092a864886f70 d01050a300d04080011223344556677020101". Call B_SetAlgorithmInfo passing "decryptionAlg" and Baldwin Informational, Expires 12/25/1999 213 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 "AI_SHA1WithDES_CBCPadBER" and "_InfoPointer". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Note: Set up keyobject with 'password' key Create key object "pbekey". Call B_CreateKeyObject passing "pbekey". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set "_InfoPointer" to address of info structure for "KI_Item" initialized from contents of buffer "password". Call B_SetKeyInfo passing "pbekey" and "KI_Item" and "_InfoPointer". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call Call B_EncryptInit passing "encryptionAlg" and "pbekey" and "_Chooser" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_EncryptUpdate passing "encryptionAlg" and address of next free byte in buffer "cypherText" and address of "_OutputLen" and length of free bytes in buffer "cypherText" and address of first initialized byte in buffer "inputData" and length of initialized bytes in buffer "inputData" and "NULL_PTR" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "cypherText" by "_OutputLen". Call B_EncryptFinal passing "encryptionAlg" and address of next free byte in buffer "cypherText" and address of "_OutputLen" and length of free bytes in buffer "cypherText" and "NULL_PTR" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "cypherText" by "_OutputLen". Finalize buffer "cypherText". Check equality of buffer "cypherText" with hex value "1854453d8ce8083ea6be20495854aeefeca33fec2be6e92a29ba6c8983b4403 3". Note: Password base unprotect the protected data Call Call B_DecryptInit passing "decryptionAlg" and "pbekey" and "_Chooser" and "_SurrenderContext". Set "_Status" to return value. Baldwin Informational, Expires 12/25/1999 214 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_DecryptUpdate passing "decryptionAlg" and address of next free byte in buffer "plainText" and address of "_OutputLen" and length of free bytes in buffer "plainText" and address of first initialized byte in buffer "cypherText" and length of initialized bytes in buffer "cypherText" and "NULL_PTR" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "plainText" by "_OutputLen". Call B_DecryptFinal passing "decryptionAlg" and address of next free byte in buffer "plainText" and address of "_OutputLen" and length of free bytes in buffer "plainText" and "NULL_PTR" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "plainText" by "_OutputLen". Finalize buffer "plainText". Check equality of buffer "plainText" with contents of buffer "inputData". Note: Verify the pbe encryption by digest password || salt -> Note: Use the output of the digest as the input to des Note: algorithm and key Create buffer "digest" of decimal value "20" bytes. Create algorithm object "digestAlg". Call B_CreateAlgorithmObject passing "digestAlg". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set "_InfoPointer" to address of info structure for "AI_SHA1" initialized from "NULL_PTR". Call B_SetAlgorithmInfo passing "digestAlg" and "AI_SHA1" and "_InfoPointer". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call Call B_DigestInit passing "digestAlg" and "NULL_PTR" and "_Chooser" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_DigestUpdate passing "digestAlg" and address of first initialized byte in buffer "password" and length of initialized bytes in buffer "password" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Baldwin Informational, Expires 12/25/1999 215 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Call B_DigestUpdate passing "digestAlg" and address of first initialized byte in buffer "salt" and length of initialized bytes in buffer "salt" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_DigestFinal passing "digestAlg" and address of next free byte in buffer "digest" and address of "_OutputLen" and length of free bytes in buffer "digest" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "digest" by "_OutputLen". Finalize buffer "digest". Check equality of buffer "digest" with hex value "52ede8a078f04af8f1d92c170d4492c1fada7ea8". Note: Set up symetric key encryption Create key object "symetricKey". Call B_CreateKeyObject passing "symetricKey". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set "_InfoPointer" to address of info structure for "KI_Item" initialized from "52ede8a078f04af8". Call B_SetKeyInfo passing "symetricKey" and "KI_Item" and "_InfoPointer". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Create algorithm object "symetricEncryptionAlg". Call B_CreateAlgorithmObject passing "symetricEncryptionAlg". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set "_InfoPointer" to address of info structure for "AI_DES_CBCPadIV8" initialized from "f1d92c170d4492c1". Call B_SetAlgorithmInfo passing "symetricEncryptionAlg" and "AI_DES_CBCPadIV8" and "_InfoPointer". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Create algorithm object "symetricDecryptionAlg". Call B_CreateAlgorithmObject passing "symetricDecryptionAlg". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set "_InfoPointer" to address of info structure for "AI_DES_CBCPadIV8" initialized from "f1d92c170d4492c1". Call B_SetAlgorithmInfo passing "symetricDecryptionAlg" and "AI_DES_CBCPadIV8" and "_InfoPointer". Baldwin Informational, Expires 12/25/1999 216 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call Call B_EncryptInit passing "symetricEncryptionAlg" and "symetricKey" and "_Chooser" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_EncryptUpdate passing "symetricEncryptionAlg" and address of next free byte in buffer "expectedCypherText" and address of "_OutputLen" and length of free bytes in buffer "expectedCypherText" and address of first initialized byte in buffer "inputData" and length of initialized bytes in buffer "inputData" and "NULL_PTR" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "expectedCypherText" by "_OutputLen". Call B_EncryptFinal passing "symetricEncryptionAlg" and address of next free byte in buffer "expectedCypherText" and address of "_OutputLen" and length of free bytes in buffer "expectedCypherText" and "NULL_PTR" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "expectedCypherText" by "_OutputLen". Finalize buffer "expectedCypherText". Check equality of buffer "expectedCypherText" with contents of buffer "cypherText". Call Call B_DecryptInit passing "symetricDecryptionAlg" and "symetricKey" and "_Chooser" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_DecryptUpdate passing "symetricDecryptionAlg" and address of next free byte in buffer "expectedPlainText" and address of "_OutputLen" and length of free bytes in buffer "expectedPlainText" and address of first initialized byte in buffer "expectedCypherText" and length of initialized bytes in buffer "expectedCypherText" and "NULL_PTR" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "expectedPlainText" by "_OutputLen". Call B_DecryptFinal passing "symetricDecryptionAlg" and address of next free byte in buffer "expectedPlainText" and address of "_OutputLen" and length of free bytes in buffer "expectedPlainText" and "NULL_PTR" and "_SurrenderContext". Baldwin Informational, Expires 12/25/1999 217 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "expectedPlainText" by "_OutputLen". Finalize buffer "expectedPlainText". Check equality of buffer "expectedPlainText" with contents of buffer "inputData". Note: Destroy algorithm objects, and symetric algorithm & key Note: objects Call Call B_DestroyAlgorithmObject passing "encryptionAlg". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call Call B_DestroyAlgorithmObject passing "decryptionAlg". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call Call B_DestroyAlgorithmObject passing "symetricEncryptionAl g". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call Call B_DestroyAlgorithmObject passing "symetricDecryptionAl g". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call Call B_DestroyKeyObject passing "symetricKey". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Note: Case 2: Note: Set up pbe encryption/decryption algorithm with Note: pbe salt = 0011223344556677 and iteration = 4 Note: Encrypt/Decrypt the inputData with the password Create algorithm object "encryptionAlg". Call B_CreateAlgorithmObject passing "encryptionAlg". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Create algorithm object "decryptionAlg". Call B_CreateAlgorithmObject passing "decryptionAlg". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set "_InfoPointer" to address of info structure for "AI_SHA1WithDES_CBCPad" initialized from contents of buffer "salt", "4". Call B_SetAlgorithmInfo passing "encryptionAlg" and Baldwin Informational, Expires 12/25/1999 218 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 "AI_SHA1WithDES_CBCPad" and "_InfoPointer". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Note: Check its BER encoding Set "_ExpectedInfoPointer" to address of expected info structure for "AI_SHA1WithDES_CBCPadBER" initialized from "301a06092a864886f70d01050a300d04080011223344556677020104". Set "_InfoPointer" to address of info structure for "AI_SHA1WithDES_CBCPadBER". Call B_GetAlgorithmInfo passing "_InfoPointer" and "encryptionAlg" and "AI_SHA1WithDES_CBCPadBER". Check equality of info structure for "AI_SHA1WithDES_CBCPadBER" with expected info structure for "AI_SHA1WithDES_CBCPadBER". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Note: Set the decryption algorithm with the AI_SHA1WithDES_CBCPa Note: dBER Note: 30 1a Note: 06 09 2a 86 48 86 f7 0d 01 05 0a Note: 30 0d Note: 04 08 00 11 22 33 44 55 66 77 Note: 02 01 04 Set "_InfoPointer" to address of info structure for "AI_SHA1WithDES_CBCPadBER" initialized from "301a06092a864886f70 d01050a300d04080011223344556677020104". Call B_SetAlgorithmInfo passing "decryptionAlg" and "AI_SHA1WithDES_CBCPadBER" and "_InfoPointer". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call Call B_EncryptInit passing "encryptionAlg" and "pbekey" and "_Chooser" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_EncryptUpdate passing "encryptionAlg" and address of next free byte in buffer "cypherText" and address of "_OutputLen" and length of free bytes in buffer "cypherText" and address of first initialized byte in buffer "inputData" and length of initialized bytes in buffer "inputData" and "NULL_PTR" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "cypherText" by "_OutputLen". Call B_EncryptFinal passing "encryptionAlg" and address of next free byte in buffer "cypherText" and address of "_OutputLen" Baldwin Informational, Expires 12/25/1999 219 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 and length of free bytes in buffer "cypherText" and "NULL_PTR" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "cypherText" by "_OutputLen". Finalize buffer "cypherText". Check equality of buffer "cypherText" with hex value "be020792451b2907d01ea8c1c5826be2b1b10c31470c779726ffeef0bad8b7f 9". Note: Password base unprotect the protected data Call Call B_DecryptInit passing "decryptionAlg" and "pbekey" and "_Chooser" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_DecryptUpdate passing "decryptionAlg" and address of next free byte in buffer "plainText" and address of "_OutputLen" and length of free bytes in buffer "plainText" and address of first initialized byte in buffer "cypherText" and length of initialized bytes in buffer "cypherText" and "NULL_PTR" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "plainText" by "_OutputLen". Call B_DecryptFinal passing "decryptionAlg" and address of next free byte in buffer "plainText" and address of "_OutputLen" and length of free bytes in buffer "plainText" and "NULL_PTR" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "plainText" by "_OutputLen". Finalize buffer "plainText". Check equality of buffer "plainText" with contents of buffer "inputData". Note: Verify the pbe encryption by digest password || salt -> Note: des key Note: Take the digest output and digest 3 more time. Note: Use the output of the last digest as the input to des Note: algorithm and key Call B_DigestUpdate passing "digestAlg" and address of first initialized byte in buffer "password" and length of initialized bytes in buffer "password" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_DigestUpdate passing "digestAlg" and address of first Baldwin Informational, Expires 12/25/1999 220 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 initialized byte in buffer "salt" and length of initialized bytes in buffer "salt" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_DigestFinal passing "digestAlg" and address of next free byte in buffer "digest" and address of "_OutputLen" and length of free bytes in buffer "digest" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "digest" by "_OutputLen". Finalize buffer "digest". Note: now digest the digest output 3 more time Begin a loop of decimal value "3" iterations. Call B_DigestUpdate passing "digestAlg" and address of first initialized byte in buffer "digest" and length of initialized bytes in buffer "digest" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_DigestFinal passing "digestAlg" and address of next free byte in buffer "digest" and address of "_OutputLen" and length of free bytes in buffer "digest" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "digest" by "_OutputLen". Finalize buffer "digest". End the loop and display execution times. Check equality of buffer "digest" with hex value "147f42ef55c239e38a18f6121a4627693b328299". Note: Set up symetric key encryption Create key object "symetricKey". Call B_CreateKeyObject passing "symetricKey". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set "_InfoPointer" to address of info structure for "KI_Item" initialized from "147f42ef55c239e3". Call B_SetKeyInfo passing "symetricKey" and "KI_Item" and "_InfoPointer". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Create algorithm object "symetricEncryptionAlg". Call B_CreateAlgorithmObject passing "symetricEncryptionAlg". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Baldwin Informational, Expires 12/25/1999 221 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Set "_ExpectedStatus" to zero. Set "_InfoPointer" to address of info structure for "AI_DES_CBCPadIV8" initialized from "8a18f6121a462769". Call B_SetAlgorithmInfo passing "symetricEncryptionAlg" and "AI_DES_CBCPadIV8" and "_InfoPointer". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Create algorithm object "symetricDecryptionAlg". Call B_CreateAlgorithmObject passing "symetricDecryptionAlg". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set "_InfoPointer" to address of info structure for "AI_DES_CBCPadIV8" initialized from "8a18f6121a462769". Call B_SetAlgorithmInfo passing "symetricDecryptionAlg" and "AI_DES_CBCPadIV8" and "_InfoPointer". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call Call B_EncryptInit passing "symetricEncryptionAlg" and "symetricKey" and "_Chooser" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_EncryptUpdate passing "symetricEncryptionAlg" and address of next free byte in buffer "expectedCypherText" and address of "_OutputLen" and length of free bytes in buffer "expectedCypherText" and address of first initialized byte in buffer "inputData" and length of initialized bytes in buffer "inputData" and "NULL_PTR" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "expectedCypherText" by "_OutputLen". Call B_EncryptFinal passing "symetricEncryptionAlg" and address of next free byte in buffer "expectedCypherText" and address of "_OutputLen" and length of free bytes in buffer "expectedCypherText" and "NULL_PTR" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "expectedCypherText" by "_OutputLen". Finalize buffer "expectedCypherText". Check equality of buffer "expectedCypherText" with contents of buffer "cypherText". Call Call B_DecryptInit passing "symetricDecryptionAlg" and "symetricKey" and "_Chooser" and "_SurrenderContext". Set "_Status" to return value. Baldwin Informational, Expires 12/25/1999 222 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_DecryptUpdate passing "symetricDecryptionAlg" and address of next free byte in buffer "expectedPlainText" and address of "_OutputLen" and length of free bytes in buffer "expectedPlainText" and address of first initialized byte in buffer "expectedCypherText" and length of initialized bytes in buffer "expectedCypherText" and "NULL_PTR" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "expectedPlainText" by "_OutputLen". Call B_DecryptFinal passing "symetricDecryptionAlg" and address of next free byte in buffer "expectedPlainText" and address of "_OutputLen" and length of free bytes in buffer "expectedPlainText" and "NULL_PTR" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "expectedPlainText" by "_OutputLen". Finalize buffer "expectedPlainText". Check equality of buffer "expectedPlainText" with contents of buffer "inputData". This is the end of test case "TVSHADES". This is the start of test case "TVSHARSA". Set "_ExpectedStatus" to zero. Set "_Chooser" to "NULL_PTR". Set "_SurrenderContext" to "NULL_PTR". Note: Vector tests, RSA Sign and Verify for AI_SHA1WithRSAEncryp Note: tion Note: ---------------------------------------------------------- Note: ---------- Note: Start with the GlobalInit Set "_Chooser" to "AM_RSA_DECRYPT", "AM_RSA_CRT_ENCRYPT", "NULL_PTR". Set "_Chooser" to "AM_SHA", "NULL_PTR". Note: Case 1: Note: Use an arbitrary public/private keypair, this one Note: contains a Note: 768-bit modulus. Create key object "publicKey". Baldwin Informational, Expires 12/25/1999 223 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Call B_CreateKeyObject passing "publicKey". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set "_InfoPointer" to address of info structure for "KI_RSAPublic" initialized from "cc76652b4b5d972b25c464d23b965fa a52ca08b1012239f4aa3f8d518bf550c56dc4c684c78fe4ed492728005a7c101 2a072ecd28592a6b0f520445e41eb4884a2b801d8b579e6920fa7d25c0b02359 263af4dd4beececaa9dd59671351bb59f", "010001". Call B_SetKeyInfo passing "publicKey" and "KI_RSAPublic" and "_InfoPointer". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Create key object "privateKey". Call B_CreateKeyObject passing "privateKey". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set "_InfoPointer" to address of info structure for "KI_PKCS_RSAPrivate" initialized from "cc76652b4b5d972b25c464d23 b965faa52ca08b1012239f4aa3f8d518bf550c56dc4c684c78fe4ed492728005 a7c1012a072ecd28592a6b0f520445e41eb4884a2b801d8b579e6920fa7d25c0 b02359263af4dd4beececaa9dd59671351bb59f", "010001", "8ce64e23bec51946bfb90ead9e28ab7669a516c63bfcc529a9253092f0bb365 547a6e213609ef5e8db8fa34e530cc9d980ea4253c6624734e57fbc5d5df7775 536ecdd195e9e7e640f4301d3d12f391d012a1e552208c1c396a49d2d561390a 9", "e5db12250f865ace6d9613df55b2bddbbf3887e061f55c9228906873216 ff0c03a146bfd3d279ef57221fed054b502fb", "e3b7eca5658d8530e3f6e5e 0806a533b0d2bd86a348339548140ddab84b27247a6235b3d563d053802d652c 671eb76ad", "b9aa07f109a643e92459aa79a6d677476e2132980b684ebafca b10c39689be14f79511597fb16653ea3a0d82a839824b", "104bcf419edcdbd53ddb2364478c545c7b7ad1c7f7ee14223a05bc5753edb94 3eb5dc85fc1562893739086e7f0ab1b19", "875198f828082848eac2487c92d 6093d576382ab367eadcf059cd6a5a9062c9d6157a45631648cbffab6273361c 6ccb7". Call B_SetKeyInfo passing "privateKey" and "KI_PKCS_RSAPrivate" and "_InfoPointer". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Note: Set the data to sign Create buffer "input" of decimal value "1024" bytes. Set buffer "input" to hex value "616263". Note: The signature will be the same size as the modulus. Create buffer "output" of decimal value "96" bytes. Note: ---------------------------------------------------------- Note: ---------- Baldwin Informational, Expires 12/25/1999 224 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Note: Test 1-1: input is "abc" Note: SHA1 ("abc") = a9993e364706816aba3e25717850c26c9cd0d89d Note: Perform the test use AI_SHA1WithRSAEncryption. Create algorithm object "signObj". Call B_CreateAlgorithmObject passing "signObj". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set "_InfoPointer" to address of info structure for "AI_SHA1WithRSAEncryption" initialized from "NULL_PTR". Call B_SetAlgorithmInfo passing "signObj" and "AI_SHA1WithRSAEncryption" and "_InfoPointer". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set "_ExpectedInfoPointer" to address of expected info structure for "AI_SHA1WithRSAEncryptionBER" initialized from "300d06092a864886f70d0101050500". Set "_InfoPointer" to address of info structure for "AI_SHA1WithRSAEncryptionBER". Call B_GetAlgorithmInfo passing "_InfoPointer" and "signObj" and "AI_SHA1WithRSAEncryptionBER". Check equality of info structure for "AI_SHA1WithRSAEncryptionBE R" with expected info structure for "AI_SHA1WithRSAEncryptionBER ". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call Call B_SignInit passing "signObj" and "privateKey" and "_Chooser" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_SignUpdate passing "signObj" and address of first initialized byte in buffer "input" and length of initialized bytes in buffer "input" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_SignFinal passing "signObj" and address of next free byte in buffer "output" and address of "_OutputLen" and length of free bytes in buffer "output" and "NULL_PTR" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "output" by "_OutputLen". Finalize buffer "output". Check equality of buffer "output" with hex value "583b2209827d3fd9a111ac19cfdccfb0974ec22633dbdf6a5d8fcaa0e98c89e 3e3f0ab5130674bc7677325b4f4b9f08926fa4a3f14cbeaba03fb74aa31a3ff1 Baldwin Informational, Expires 12/25/1999 225 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 016c42991b5a79c2b24cb041493f50bbbc468888c9bfb6bedcc5f844f3dc18d2 0". Create algorithm object "verifyObj". Call B_CreateAlgorithmObject passing "verifyObj". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set "_InfoPointer" to address of info structure for "AI_SHA1WithRSAEncryptionBER" initialized from "300d06092a864886f70d0101050500". Call B_SetAlgorithmInfo passing "verifyObj" and "AI_SHA1WithRSAEncryptionBER" and "_InfoPointer". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set "_ExpectedInfoPointer" to address of expected info structure for "AI_SHA1WithRSAEncryption" initialized from "NULL_PTR". Set "_InfoPointer" to address of info structure for "AI_SHA1WithRSAEncryption". Call B_GetAlgorithmInfo passing "_InfoPointer" and "verifyObj" and "AI_SHA1WithRSAEncryption". Check equality of info structure for "AI_SHA1WithRSAEncryption" with expected info structure for "AI_SHA1WithRSAEncryption". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call Call B_VerifyInit passing "verifyObj" and "publicKey" and "_Chooser" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_VerifyUpdate passing "verifyObj" and address of first initialized byte in buffer "input" and length of initialized bytes in buffer "input" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_VerifyFinal passing "verifyObj" and address of first initialized byte in buffer "output" and length of initialized bytes in buffer "output" and "NULL_PTR" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Note: ---------------------------------------------------------- Note: ---------- Note: Test 1-2: Note: Check the signature result of 1-1 by signing the Note: digestinfo with Note: AI_PKCS_RSAPrivate Baldwin Informational, Expires 12/25/1999 226 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Create buffer "expectOutput" of decimal value "96" bytes. Create buffer "digestInfo" of decimal value "36" bytes. Create algorithm object "encrytpionObj". Call B_CreateAlgorithmObject passing "encrytpionObj". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set buffer "digestInfo" to hex value "3021300906052b0e03021a0500 0414a9993e364706816aba3e25717850c26c9cd0d89d". Set "_InfoPointer" to address of info structure for "AI_PKCS_RSAPrivate" initialized from "NULL_PTR". Call B_SetAlgorithmInfo passing "encrytpionObj" and "AI_PKCS_RSAPrivate" and "_InfoPointer". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call Call B_EncryptInit passing "encrytpionObj" and "privateKey" and "_Chooser" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_EncryptUpdate passing "encrytpionObj" and address of next free byte in buffer "expectOutput" and address of "_OutputLen" and length of free bytes in buffer "expectOutput" and address of first initialized byte in buffer "digestInfo" and length of initialized bytes in buffer "digestInfo" and "NULL_PTR" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "expectOutput" by "_OutputLen". Call B_EncryptFinal passing "encrytpionObj" and address of next free byte in buffer "expectOutput" and address of "_OutputLen" and length of free bytes in buffer "expectOutput" and "NULL_PTR" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "expectOutput" by "_OutputLen". Finalize buffer "expectOutput". Check equality of buffer "expectOutput" with contents of buffer "output". Note: ---------------------------------------------------------- Note: ---------- Note: Test 2-1:input = "abcdbcdecdefdefgefghfghighijhijkijkljklm Note: klmnlmnomnopnopq" Note: SHA1 ("abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomno Note: pnopq") = Baldwin Informational, Expires 12/25/1999 227 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Note: 84983e441c3bd26ebaae4aa1f95129e5e54670f1 Note: Perform the test use AI_SHA1WithRSAEncryption. Set length of buffer "output" to decimal value "0". Set length of buffer "expectOutput" to decimal value "0". Set buffer "input" to hex value "6162636462636465636465666465666 765666768666768696768696a68696a6b696a6b6c6a6b6c6d6b6c6d6e6c6d6e6 f6d6e6f706e6f7071". Call B_SignUpdate passing "signObj" and address of first initialized byte in buffer "input" and length of initialized bytes in buffer "input" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_SignFinal passing "signObj" and address of next free byte in buffer "output" and address of "_OutputLen" and length of free bytes in buffer "output" and "NULL_PTR" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "output" by "_OutputLen". Finalize buffer "output". Check equality of buffer "output" with hex value "a751f1593b23dc86d70cec4ed60f77be415c49a2da5e6f84f868c93652930c8 60171e4e084cc8eb6f1f61ee176efdf146cf71aa82f9ed16944139283b3c7642 bf99be4235ffff7d48d03409060328b9f1ff956c6c62750bb552fd718d6084d5 1". Note: Verify the signature Call B_VerifyUpdate passing "verifyObj" and address of first initialized byte in buffer "input" and length of initialized bytes in buffer "input" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_VerifyFinal passing "verifyObj" and address of first initialized byte in buffer "output" and length of initialized bytes in buffer "output" and "NULL_PTR" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Note: ---------------------------------------------------------- Note: ---------- Note: Test 2-2: Note: Check the signature result of 2-1 by signing the Note: digestinfo with Note: AI_PKCS_RSAPrivate Baldwin Informational, Expires 12/25/1999 228 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Set buffer "digestInfo" to hex value "3021300906052b0e03021a0500 041484983e441c3bd26ebaae4aa1f95129e5e54670f1". Call B_EncryptUpdate passing "encrytpionObj" and address of next free byte in buffer "expectOutput" and address of "_OutputLen" and length of free bytes in buffer "expectOutput" and address of first initialized byte in buffer "digestInfo" and length of initialized bytes in buffer "digestInfo" and "NULL_PTR" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "expectOutput" by "_OutputLen". Call B_EncryptFinal passing "encrytpionObj" and address of next free byte in buffer "expectOutput" and address of "_OutputLen" and length of free bytes in buffer "expectOutput" and "NULL_PTR" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "expectOutput" by "_OutputLen". Finalize buffer "expectOutput". Check equality of buffer "expectOutput" with contents of buffer "output". Note: ---------------------------------------------------------- Note: ---------- Note: Test 3-1:input = "abcdbcdecdefdefgefghfghighijhijkijkljklm Note: klmnlmnomnopnopq" Note: SHA1 ("1,000,00 repetition of a" = 34aa973cd4c4daa4f61eeb2 Note: bdbad27316534016f Note: Perform the test use AI_SHA1WithRSAEncryption. Set length of buffer "output" to decimal value "0". Set length of buffer "expectOutput" to decimal value "0". Set buffer "input" to hex value "6161616161616161616161616161616 1616161616161616161616161616161616161616161616161616161616161616 1616161616161616161616161616161616161616161616161616161616161616 1616161616161616161616161616161616161616161616161616161616161616 1616161616161616161616161616161616161616161616161616161616161616 1616161616161616161616161616161616161616161616161616161616161616 1616161616161616161616161616161616161616161616161616161616161616 1616161616161616161616161616161616161616161616161616161616161616 1616161616161616161616161616161616161616161616161616161616161616 1616161616161616161616161616161616161616161616161616161616161616 1616161616161616161616161616161616161616161616161616161616161616 1616161616161616161616161616161616161616161616161616161616161616 1616161616161616161616161616161616161616161616161616161616161616 1616161616161616161616161616161616161616161616161616161616161616 1616161616161616161616161616161616161616161616161616161616161616 Baldwin Informational, Expires 12/25/1999 229 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 1616161616161616161616161616161616161616161616161616161616161616 1616161616161616161616161616161616161616161616161616161616161616 1616161616161616161616161616161616161616161616161616161616161616 1616161616161616161616161616161616161616161616161616161616161616 1616161616161616161616161616161616161616161616161616161616161616 1616161616161616161616161616161616161616161616161616161616161616 1616161616161616161616161616161616161616161616161616161616161616 1616161616161616161616161616161616161616161616161616161616161616 1616161616161616161616161616161616161616161616161616161616161616 1616161616161616161616161616161616161616161616161616161616161616 1616161616161616161616161616161616161616161616161616161616161616 1616161616161616161616161616161616161616161616161616161616161616 1616161616161616161616161616161616161616161616161616161616161616 1616161616161616161616161616161616161616161616161616161616161616 1616161616161616161616161616161616161616161616161616161616161616 1616161616161616161616161616161616161616161616161616161616161616 1616161616161616161616161616161616161616161616161". Begin a loop of decimal value "1000" iterations. Call B_SignUpdate passing "signObj" and address of first initialized byte in buffer "input" and length of initialized bytes in buffer "input" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. End the loop and display execution times. Call B_SignFinal passing "signObj" and address of next free byte in buffer "output" and address of "_OutputLen" and length of free bytes in buffer "output" and "NULL_PTR" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "output" by "_OutputLen". Finalize buffer "output". Check equality of buffer "output" with hex value "845f7adbacb97303c16449107f27b98ce3df09b9e840be7fcca33c6d1f51018 d59a429f18bccc37e9a4384374b440f23f26159c0297d671290586da92a3befe a60f783bbef5e10b0a1c0f2029bcd2d74807500c5847db820f90d6cbdae36e1e 2". Note: Verify the signature Begin a loop of decimal value "1000" iterations. Call B_VerifyUpdate passing "verifyObj" and address of first initialized byte in buffer "input" and length of initialized bytes in buffer "input" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. End the loop and display execution times. Call B_VerifyFinal passing "verifyObj" and address of first initialized byte in buffer "output" and length of initialized bytes in buffer "output" and "NULL_PTR" and "_SurrenderContext". Baldwin Informational, Expires 12/25/1999 230 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Note: ---------------------------------------------------------- Note: ---------- Note: Test 3-2: Note: Check the signature result of 3-1 by signing the Note: digestinfo with Note: AI_PKCS_RSAPrivate Set buffer "digestInfo" to hex value "3021300906052b0e03021a0500 041434aa973cd4c4daa4f61eeb2bdbad27316534016f". Call B_EncryptUpdate passing "encrytpionObj" and address of next free byte in buffer "expectOutput" and address of "_OutputLen" and length of free bytes in buffer "expectOutput" and address of first initialized byte in buffer "digestInfo" and length of initialized bytes in buffer "digestInfo" and "NULL_PTR" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "expectOutput" by "_OutputLen". Call B_EncryptFinal passing "encrytpionObj" and address of next free byte in buffer "expectOutput" and address of "_OutputLen" and length of free bytes in buffer "expectOutput" and "NULL_PTR" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "expectOutput" by "_OutputLen". Finalize buffer "expectOutput". Check equality of buffer "expectOutput" with contents of buffer "output". Note: ---------------------------------------------------------- Note: ---------- Note: Case 2: Note: Use an arbitrary public/private keypair, this one Note: contains a Note: 512-bit modulus. Create key object "publicKey". Call B_CreateKeyObject passing "publicKey". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Baldwin Informational, Expires 12/25/1999 231 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Set "_ExpectedStatus" to zero. Set "_InfoPointer" to address of info structure for "KI_RSAPublic" initialized from "ab383940542cac9ac03740d04904ed5 10e95720251c2ad9da7ebba29aed4497953fadf016cbc69464c831bd93b59420 4990f632475a0be6f924d9da240daf849", "010001". Call B_SetKeyInfo passing "publicKey" and "KI_RSAPublic" and "_InfoPointer". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Create key object "privateKey". Call B_CreateKeyObject passing "privateKey". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set "_InfoPointer" to address of info structure for "KI_PKCS_RSAPrivate" initialized from "ab383940542cac9ac03740d04 904ed510e95720251c2ad9da7ebba29aed4497953fadf016cbc69464c831bd93 b594204990f632475a0be6f924d9da240daf849", "010001", "4ad2e7321596f0573068f50a10def656d5e8b94a0a30e96e5c53c7a72f9fd5f b589b1e5be86eae02aa152367aa209e82764cade195dee325662fb0ab1ce5a00 1", "d1eb51bd09267ee7128ceb5c3218d1600b49678f783c58c5b00170ee1ac f6ee1", "d0ce21834173f6843206a8a6ad132b65278628ef0e8cca4f20c0199 5fe6c3e69", "1a499cb7ce808a9dc73dec6f643aa565a0a4359acad4cbcd1dc 8606b00e27f21", "a793d77794ef31785501dd16afaec3d4120d6d0ab6ddad7 c25e7a66127e8cd89", "0bdb907f33c51f5b4da486da77d4b31dbcc3ae0bac9 1f3384acf10b15e5ad186". Call B_SetKeyInfo passing "privateKey" and "KI_PKCS_RSAPrivate" and "_InfoPointer". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Note: Set the data to sign Create buffer "input" of decimal value "1024" bytes. Set buffer "input" to hex value "616263". Note: The signature will be the same size as the modulus. Create buffer "output" of decimal value "64" bytes. Note: ---------------------------------------------------------- Note: ---------- Note: Test 1-1: input is "abc" Note: SHA1 ("abc") = a9993e364706816aba3e25717850c26c9cd0d89d Note: Perform the test use AI_SHA1WithRSAEncryption. Create algorithm object "signObj". Call B_CreateAlgorithmObject passing "signObj". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Baldwin Informational, Expires 12/25/1999 232 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 Set "_ExpectedStatus" to zero. Set "_InfoPointer" to address of info structure for "AI_SHA1WithRSAEncryption" initialized from "NULL_PTR". Call B_SetAlgorithmInfo passing "signObj" and "AI_SHA1WithRSAEncryption" and "_InfoPointer". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set "_ExpectedInfoPointer" to address of expected info structure for "AI_SHA1WithRSAEncryptionBER" initialized from "300d06092a864886f70d0101050500". Set "_InfoPointer" to address of info structure for "AI_SHA1WithRSAEncryptionBER". Call B_GetAlgorithmInfo passing "_InfoPointer" and "signObj" and "AI_SHA1WithRSAEncryptionBER". Check equality of info structure for "AI_SHA1WithRSAEncryptionBE R" with expected info structure for "AI_SHA1WithRSAEncryptionBER ". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call Call B_SignInit passing "signObj" and "privateKey" and "_Chooser" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_SignUpdate passing "signObj" and address of first initialized byte in buffer "input" and length of initialized bytes in buffer "input" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_SignFinal passing "signObj" and address of next free byte in buffer "output" and address of "_OutputLen" and length of free bytes in buffer "output" and "NULL_PTR" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Increment length of buffer "output" by "_OutputLen". Finalize buffer "output". Check equality of buffer "output" with hex value "4423a0a405c767fb48f0a376acdb10a4388d9702d88ce13ed878e25099c13c4 a72439972cbeb5993a1231a7717c924759969f9f9792abd32a6ca66a1e3f696a 3". Create algorithm object "verifyObj". Call B_CreateAlgorithmObject passing "verifyObj". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set "_InfoPointer" to address of info structure for Baldwin Informational, Expires 12/25/1999 233 draft-baldwin-bsafe-test-00.txt TESTING BSAFE June 1999 "AI_SHA1WithRSAEncryptionBER" initialized from "300d06092a864886f70d0101050500". Call B_SetAlgorithmInfo passing "verifyObj" and "AI_SHA1WithRSAEncryptionBER" and "_InfoPointer". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Set "_ExpectedInfoPointer" to address of expected info structure for "AI_SHA1WithRSAEncryption" initialized from "NULL_PTR". Set "_InfoPointer" to address of info structure for "AI_SHA1WithRSAEncryption". Call B_GetAlgorithmInfo passing "_InfoPointer" and "verifyObj" and "AI_SHA1WithRSAEncryption". Check equality of info structure for "AI_SHA1WithRSAEncryption" with expected info structure for "AI_SHA1WithRSAEncryption". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call Call B_VerifyInit passing "verifyObj" and "publicKey" and "_Chooser" and "_SurrenderContext". Set "_Status" to return value. Check equality of "_Status" with "_ExpectedStatus". Set "_ExpectedStatus" to zero. Call B_VerifyUpdate passing "verifyObj" and address of first initialized byte in buffer "input" and length of initialized by