It would be better if that project made a library to link against, soWhy I do not like your code snippets:
$ gcc hmac.c -o hmac
hmac.c:29:10: fatal error: hmac_sha2.h: No such file or directory
29 | #include "hmac_sha2.h"
| ^~~~~~~~~~~~~
compilation terminated.
Well, it uses the following lib:
https://github.com/ogay/hmac
"Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> writes:
It would be better if that project made a library to link against, soWhy I do not like your code snippets:
$ gcc hmac.c -o hmac
hmac.c:29:10: fatal error: hmac_sha2.h: No such file or directory
29 | #include "hmac_sha2.h"
| ^~~~~~~~~~~~~
compilation terminated.
Well, it uses the following lib:
https://github.com/ogay/hmac
that you didn't have to put it all on the command line.
[12:24] jayjwa@ibushi:~/hmac$ gcc -pipe -o ct_hmac_sha2_512
jayjwa <jayjwa@atr2.ath.cx.invalid> writes:...
[12:24] jayjwa@ibushi:~/hmac$ gcc -pipe -o ct_hmac_sha2_512
You'd have more command line to work with if you set PS1="$ ".
I mean, surely you know which host you're logged into and
which user you logged in with without a constant reminder
eating up half the command line :-)
In my case, the current host and working directory is stashed in the
xterm title bar automatically by a shell function wrapping the cd command.
On 2026-02-18 13:06, Scott Lurndal wrote:
jayjwa <jayjwa@atr2.ath.cx.invalid> writes:...
[12:24] jayjwa@ibushi:~/hmac$ gcc -pipe -o ct_hmac_sha2_512
You'd have more command line to work with if you set PS1="$ ".
I mean, surely you know which host you're logged into and
which user you logged in with without a constant reminder
eating up half the command line :-)
It depends very much upon your work environment. I've worked in
environments where I might often be logged into multiple hosts in
different windows at the same time, and in some cases there were
multiple different users I might have been logged into a given host.
In my case, the current host and working directory is stashed in the
xterm title bar automatically by a shell function wrapping the cd command.
I agree that the title bar is a more appropriate location for current
host and current user information. However, I've found it useful to be
able to tell directly which directory was the current one when I issued
each command. If the cd (or pushd or popd) command is still on screen,
it can be figured out, but it is easier when it's part of the prompt. Of course, the value of this depends upon how much work you do at the
command line. While I was working on NASA projects, most of my work was
done at the command line.
"Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> writes:
It would be better if that project made a library to link against, soWhy I do not like your code snippets:
$ gcc hmac.c -o hmac
hmac.c:29:10: fatal error: hmac_sha2.h: No such file or directory
29 | #include "hmac_sha2.h"
| ^~~~~~~~~~~~~
compilation terminated.
Well, it uses the following lib:
https://github.com/ogay/hmac
that you didn't have to put it all on the command line.
[12:24] jayjwa@ibushi:~/hmac$ gcc -pipe -o ct_hmac_sha2_512 ct_hmac_sha2_512.c hmac_sha2.c sha2.c
[12:25] jayjwa@ibushi:~/hmac$ echo "How now brown cow?" > test.txt
[12:26] jayjwa@ibushi:~/hmac$ ./ct_hmac_sha2_512 test.txt test.enc -e
=== DrMoron Cipher (Fixed TRNG Version) ===
Mode: ENCRYPT
WARNING: Using hardcoded demo key - NOT SECURE for production!
Input file: test.txt
Output file: test.enc
Generating 73 bytes of cryptographically secure random data...
Random prefix generated successfully
Crypt Round 0:
________________________
P_I = 92 of 92
Crypt Round 1:
________________________
P_I = 92 of 92
Encryption complete!
[12:26] jayjwa@ibushi:~/hmac$ ./ct_hmac_sha2_512 test.enc test.new -d
=== DrMoron Cipher (Fixed TRNG Version) ===
Mode: DECRYPT
WARNING: Using hardcoded demo key - NOT SECURE for production!
Input file: test.enc
Output file: test.new
Crypt Round 0:
________________________
P_I = 92 of 92
Crypt Round 1:
________________________
P_I = 92 of 92
Decryption complete!
[12:27] jayjwa@ibushi:~/hmac$ cat test.new
How now brown cow?
[12:34] jayjwa@ibushi:~/hmac$ uname -a
SunOS ibushi 5.11 illumos-f8f3128c12 i86pc i386 i86pc
On 2/18/2026 9:41 AM, jayjwa wrote:[...]
"Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> writes:
It would be better if that project made a library to link against, soWhy I do not like your code snippets:
$ gcc hmac.c -o hmac
hmac.c:29:10: fatal error: hmac_sha2.h: No such file or directory
-a-a-a-a 29 | #include "hmac_sha2.h"
-a-a-a-a-a-a-a |-a-a-a-a-a-a-a-a-a ^~~~~~~~~~~~~
compilation terminated.
Well, it uses the following lib:
https://github.com/ogay/hmac
that you didn't have to put it all on the command line.
It would be more convenient for sure. Also, I don't want to put ogay's
hmac files in my repository. A makefile would also help.
Excellent! Thanks for giving it a go. My next version will allow one to create a secret key file and use it.
Well, it uses the following lib:
https://github.com/ogay/hmac
So, go get it. Actually, its pretty nice. That is the only
dependency. After that, it should work fine. I cannot just copy
those files from ogay into my repository, right? :^)
| Sysop: | Amessyroom |
|---|---|
| Location: | Fayetteville, NC |
| Users: | 74 |
| Nodes: | 6 (0 / 6) |
| Uptime: | 26:22:36 |
| Calls: | 1,195 |
| Files: | 1,354 |
| D/L today: |
7 files (9,491K bytes) |
| Messages: | 293,879 |