Posts

Showing posts from July, 2022

Day 20 : 21 July 2022 : Test Program Update : Message Digest Algorithms

Image
My 100 Daze of Code https://github.com/davidjwalling/100-days-of-code #20 : Test Program Update: Message Digest Algorithms A couple of posts ago we added a test program "testava" to the project. At that time, the test program simply logged startup and completion messages. Here, we add some reusable functions to the test harness and demonstrate them by adding the first code under test, message digest algorithms. A message digest is, usually, a fixed-length binary output of an algorithm applied to a variable-length data input, where the computed output, the message "digest" is highly likely to differ if any bit of the input data changes. Over the years, numerous message digest algorithms have come and gone. Some are preferable for speed and others for applicability to certain problem domains such as cryptology. Here, we'll introduce message digest classes to our Ava library that implement the MD5, SHA-1 and SHA-2 message digest algorithms. MD5 is no longer recomme...

Day 19 : 20 July 2022 : Adding Support for Android

Image
 My 100 Daze of Code https://github.com/davidjwalling/100-days-of-code #19 : Adding Support for Android In this episode, we'll add Android to our list of supported platforms for the Ava program, its library, libava, and its test program, testava. I'm using Android Studio Chipmunk 2021.2.1 Patch 1, built on May 18, 2022. I'll test and debug using a physical device, a Samsung Galaxy S9, connected to my development laptop using a USB-C cable. Since all supported platforms reference the same code, I'll update the CMakeLists.txt file that Android Studio generates to reference Ava source modules in their current location within the repository. Folder and File Hierarchy Updates For Window and iOS, we created folders at the top level of the repository to hold platform-specific project files. We'll follow the same example here. We'll create and android folder in the repository and create the Android Studio project there. Update to .gitignore It is not necessary to includ...

Day 18 : 14 July 2022 : Adding a Test Program

Image
  My 100 Daze of Code https://github.com/davidjwalling/100-days-of-code #18 : Adding a Test Program To now, we've used the Ava program itself for testing. Now, though, we'll be starting to add a lot of code that performs specific algorithms related to message encryption, creation of digital signatures, compression, etc. So it's very helpful to have a dedicated program that will test the implementation of these algorithms before we have the Ava program use them. We'll start on Windows and create a new Visual Studio project (.vcxproj, .vcxproj.filter, .vcxproj.user) that includes a single C++ source file, testava.cpp. For today, the test program will simply log a couple of startup messages and a completion message. Under the hood, though, I've made some other changes to enable calling the Log class methods from either the Ava or TestAva programs. This required making the "EXPORT" definition accessible independently from the "idriver.h" header where...