After removing ~/.critcl, the following script,

<code><verbatim>
package require critcl
package require sha256
package require sha256c
::critcl::tcl 9.0
::critcl::ccode {}
::critcl::api import sha256c 1


, results in the error:

<code><verbatim>
Headers for API sha256c not found in
-
    while executing
"error "Headers for API $name not found in $searched
    (procedure "::critcl::APIimport" line 24)
    invoked from within
"::critcl::APIimport sha256c 1"
    ("eval" body line 1)
    invoked from within
"eval [linsert $args 0 ::critcl::API$cmd $file]"
    (procedure "::critcl::api" line 10)
    invoked from within
"::critcl::api import sha256c 1"


With the following modification the script completes successfully :

<code><verbatim>
---
+++
@@ -81,12 +81,12 @@
         tcl {
             # Already present (this file)
             set r 1
         }
         critcl {
-            if {![catch {package require tcllibc}]
-                || ![catch {package require sha256c}]} {
+            if {
+                ![catch {package require sha256c}]} {
                 set r [expr {[info commands ::sha2::sha256c_update] != {}}]
             }
         }
         default {
             return -code error "invalid accelerator $key:\


The issue is that if [package require tcllibc] is executed first, then
[package require sha256c] does not lead to the evaluation of sha256c.tcl, and
therefore the line "critcl::cheaders sha256.h" is never encountered.