-
-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Yevgeny Pats
committed
Sep 20, 2019
1 parent
5be2afd
commit 31c324c
Showing
3 changed files
with
62 additions
and
37 deletions.
There are no files selected for viewing
This file contains 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 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 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,24 @@ | ||
// +build gofuzz | ||
|
||
package crypto | ||
|
||
import "log" | ||
|
||
func Fuzz(data []byte) int { | ||
encrypted_data, err := AesEncrypt(string(data), "12345678123456781234567812345678") | ||
if err != nil { | ||
log.Panic("tried encrypt %v got err %v", encrypted_data, err) | ||
} | ||
|
||
decrypted_data, err := AesDecrypt(encrypted_data, "12345678123456781234567812345678") | ||
if err != nil { | ||
log.Panic("tried to encrypt/decrypt %v got err %v", data, err) | ||
} | ||
|
||
if decrypted_data != string(data) { | ||
log.Panic("decrypt(encrypt(%v)) != %v", data, data) | ||
} | ||
|
||
return 0 | ||
} | ||
|