-
Notifications
You must be signed in to change notification settings - Fork 1
軽微な仕様変更やバグ修正 #3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
軽微な仕様変更やバグ修正 #3
Changes from all commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
e397f9e
pull requestに大変感謝しながら、定数計算できないとされた部分を修正
barrier15300 0147285
曖昧なコンストラクタを使ってた部分を修正
barrier15300 33b5c59
キャスト抜けを修正
barrier15300 b802bc9
RORマクロと自作関数を消去
barrier15300 a0f1938
使用例のソースコードを簡易的に追加
barrier15300 3310348
カラツバ法を実装...多分使わないけど
barrier15300 64703a6
とりあえずよくわからないけどこの現状をコミット
barrier15300 83491e0
代入周りがdelete指定なのかdefault指定なのか曖昧であった部分を修正
barrier15300 cd0770b
バッファの操作関係を調整
barrier15300 639d95c
暗号化関連の軽微なバグ修正と書き換え
barrier15300 6795d2a
動作テスト完了
barrier15300 69f0ae7
名前空間関連の変更
barrier15300 84ca501
Poll関数にタイムアウトを指定できるようにした(今更)
barrier15300 d1492bb
Merge branch 'main' into alpha-develop
barrier15300 5e314ab
Update include/Packet.h
barrier15300 5928253
正しいデータを読み出さない状態になってたので修正
barrier15300 563cb70
Merge branch 'alpha-develop' of https://github.com/barrier15300/Socke…
barrier15300 e2ce841
ダングリングが発生する部分を修正
barrier15300 65b2197
バッファ範囲外を参照する可能性を修正
barrier15300 b597a91
可変長版を作成するメリットが今のところ存在しないため無効化
barrier15300 d51c3d0
多倍長整数の軽微なお手入れ
barrier15300 346652a
他環境のコンパイルエラー修正
barrier15300 37baadf
受信したバイト列を受け取ってPacketオブジェクトを生成する関数を追加
barrier15300 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,84 @@ | ||
| #include "include/Socket.h" | ||
|
|
||
| struct ContainerInContainer { | ||
|
|
||
| std::vector<std::string> names; | ||
|
|
||
| Packet::bytearray ToBytes() const { | ||
| Packet::bytearray ret; | ||
| Packet::StoreBytes(ret, names); | ||
| return ret; | ||
| } | ||
|
|
||
| Packet::byte_view FromBytes(Packet::byte_view view) { | ||
| Packet::LoadBytes(view, names); | ||
| return view; | ||
| } | ||
| }; | ||
|
|
||
| struct ContainerInVariable { | ||
| std::vector<ContainerInContainer> container; | ||
|
|
||
| Packet::bytearray ToBytes() const { | ||
| Packet::bytearray ret; | ||
| Packet::StoreBytes(ret, container); | ||
| return ret; | ||
| } | ||
|
|
||
| Packet::byte_view FromBytes(Packet::byte_view view) { | ||
| Packet::LoadBytes(view, container); | ||
| return view; | ||
| } | ||
| }; | ||
|
|
||
| int main(int argc, char* argv[]) { | ||
|
|
||
| ContainerInVariable data{}; | ||
| ContainerInContainer cic{}; | ||
|
|
||
| std::string str = "test"; | ||
|
|
||
| cic.names.push_back(str); str += "t"; | ||
| cic.names.push_back(str); str += "t"; | ||
| cic.names.push_back(str); str += "t"; | ||
| cic.names.push_back(str); str += "t"; | ||
|
|
||
| data.container.push_back(cic); | ||
|
|
||
| str = "test2"; | ||
|
|
||
| cic.names.push_back(str); str += "b"; | ||
| cic.names.push_back(str); str += "b"; | ||
| cic.names.push_back(str); str += "b"; | ||
| cic.names.push_back(str); str += "b"; | ||
|
|
||
| data.container.push_back(cic); | ||
|
|
||
| str = "magic"; | ||
|
|
||
| cic.names.push_back(str); str += "m"; | ||
| cic.names.push_back(str); str += "m"; | ||
| cic.names.push_back(str); str += "m"; | ||
| cic.names.push_back(str); str += "m"; | ||
|
|
||
| data.container.push_back(cic); | ||
|
|
||
| str = "test"; | ||
|
|
||
| cic.names.push_back(str); str += "z"; | ||
| cic.names.push_back(str); str += "z"; | ||
| cic.names.push_back(str); str += "z"; | ||
| cic.names.push_back(str); str += "z"; | ||
|
|
||
| data.container.push_back(cic); | ||
|
|
||
| Packet pak = Packet(data); | ||
|
|
||
| auto& buf = pak.GetBuffer(); | ||
|
|
||
| for (auto&& c : buf) { | ||
| std::cout << std::uppercase << std::setfill('0') << std::setw(2) << std::hex << std::right << static_cast<int>(c); | ||
| } | ||
|
|
||
| return 0; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| #include "include/Socket.h" | ||
|
|
||
| int main(int argc, char* argv[]) { | ||
|
|
||
| KeyManager key; | ||
| std::string message = "I have skill is write low level programing language."; | ||
|
|
||
| auto q = ECDSA::MakePublicKey(key.GetSecretKey()); | ||
|
|
||
| auto v = ECDSA::Sign(key.GetSecretKey(), {message.begin(), message.end()}); | ||
|
|
||
| bool ret = ECDSA::Verify(q, v, {message.begin(), message.end()}); | ||
|
|
||
| std::cout << "message: \"" << message << "\"" << std::endl; | ||
| std::cout << "Q: {" << q.x.value.ToString(16) << ", " << q.y.value.ToString(16) << "}" << std::endl; | ||
| std::cout << "(r, s)(bytes): "; | ||
| for (auto&& b : v) { | ||
| std::cout << std::hex << std::setw(2) << std::setfill('0') << std::right << (int)b; | ||
| } | ||
| std::cout << std::endl; | ||
|
|
||
| std::cout << std::boolalpha << ret; | ||
|
|
||
| assert(ret); | ||
|
|
||
| return 0; | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
std::stoiが例外をスローする可能性があるargs[1]が数値でない文字列の場合、std::stoiはstd::invalid_argumentをスローし、非常に大きい数値の場合はstd::out_of_rangeをスローします。try-catch で囲むか、事前にバリデーションを行ってください。🛡️ 修正案
🤖 Prompt for AI Agents