上へ

開発メモ

2004/10/03 LuaDelphi

サンプル構築時に頻発する処理をまとめていった LuaUtils.pas は現状 Boolean, Double, string, lua_CFunction, LightUserData それぞれに対して文字列をキーにした Get, RawGet, Set, RawSet がある。
function LuaGetTableBoolean(L: Plua_State; TableIndex: Integer; const Key: string): Boolean;
function LuaGetTableNumber(L: Plua_State; TableIndex: Integer; const Key: string): Double;
function LuaGetTableString(L: Plua_State; TableIndex: Integer; const Key: string): string;
function LuaGetTableFunction(L: Plua_State; TableIndex: Integer; const Key: string): lua_CFunction;
function LuaGetTableLightUserData(L: Plua_State; TableIndex: Integer; const Key: string): Pointer;
procedure LuaRawGetTable(L: Plua_State; TableIndex: Integer; const Key: string);
function LuaRawGetTableBoolean(L: Plua_State; TableIndex: Integer; const Key: string): Boolean;
function LuaRawGetTableNumber(L: Plua_State; TableIndex: Integer; const Key: string): Double;
function LuaRawGetTableString(L: Plua_State; TableIndex: Integer; const Key: string): string;
function LuaRawGetTableFunction(L: Plua_State; TableIndex: Integer; const Key: string): lua_CFunction;
・・・
これだけで5×4=20関数あるが、さらに数値をキーにしたアクセスも欲しくなってきた。このままの延長で作ると5×4×2=40関数になる。型毎に関数が増えていく状況なので、統一的にあつかえるバリアントのような型を導入して、その型に対する操作をSet,RawSet,Get,RawGet の4種類だけ作って、あとはキャストだけという構造にする方がメンテ行数が減っていいのかも知れない。

2004/12/10 BlowFish for Delphi

予想外にダウンロードされてしまったのに責任を感じて BlowFish テストベクトル テストコード作成中、まだバイトオーダーの問題(minor problem with the "bfsh-con.zip" )と、CFB, OFB で理解が甘く、テストが通っていない。現状でも bfsh-con 相当とはいえるけど、いまいち感は否定できない。必死にリファレンスコード(SSLeay) を解析中。(眠い・・・)
スピードは遅くなるけどコンパイルオプション等でバイトオーダー入れ替えは入れる予定、CFB,OFB はパディング無しでも出来るのでTCrypt の設計も見直す予定。