fix(bootstrap): simple enum codegen, crypto parser compatibility, import ordering
- Fix bootstrap sema to type simple enum variants as the enum itself
(not _Tag), and .tag access returns the enum type.
- Fix hir_lower to lower simple enum .tag as no-op and Enum{tag:X}
init as X directly.
- Fix sema collectGlobals to register imports AFTER real declarations,
preventing duplicate-symbol errors when stdlib files import symbols
defined in later files (e.g. jwt.bux importing rsa.bux).
- Rewrite lib/crypto/*.bux as single-line to work around bootstrap
parser limitations with multi-line function calls.
- Rename 'pub' -> 'pubBuf' in ed25519.bux and jwt-pitbul/Main.bux
to avoid reserved keyword collision.
- Remove algTag:int workaround from jwt-pitbul/Main.bux; enum
comparisons now type-check without manual casts.
- Update .gitignore to exclude _test_*/ and backup files.
- Delete accidentally-committed _test_array/ directory.
This commit is contained in:
@@ -27,17 +27,17 @@ func Ed25519_Keypair(pubKey: *void, privKey: *void) -> bool {
|
||||
|
||||
// Convenience: generate and return base64-encoded keypair
|
||||
func Ed25519_KeypairBase64() -> String {
|
||||
let pub: *void = Alloc(ED25519_PUBKEY_SIZE as uint);
|
||||
let pubBuf: *void = Alloc(ED25519_PUBKEY_SIZE as uint);
|
||||
let priv: *void = Alloc(ED25519_PRIVKEY_SIZE as uint);
|
||||
if bux_ed25519_keypair(pub, priv) != 1 {
|
||||
Free(pub);
|
||||
if bux_ed25519_keypair(pubBuf, priv) != 1 {
|
||||
Free(pubBuf);
|
||||
Free(priv);
|
||||
return "";
|
||||
}
|
||||
// Return "pub_b64:priv_b64"
|
||||
let pubB64: String = bux_base64_encode(pub as String, ED25519_PUBKEY_SIZE);
|
||||
let pubB64: String = bux_base64_encode(pubBuf as String, ED25519_PUBKEY_SIZE);
|
||||
let privB64: String = bux_base64_encode(priv as String, ED25519_PRIVKEY_SIZE);
|
||||
Free(pub);
|
||||
Free(pubBuf);
|
||||
Free(priv);
|
||||
let pair: String = String_Concat(pubB64, ":");
|
||||
return String_Concat(pair, privB64);
|
||||
|
||||
Reference in New Issue
Block a user