-
Notifications
You must be signed in to change notification settings - Fork 1
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
Smiller coti/ct address #19
base: main
Are you sure you want to change the base?
Conversation
254ba48
to
031b3b0
Compare
src/crypto_utils.ts
Outdated
signature: new Array<Uint8Array> | ||
} | ||
|
||
for (let i = 0; i < encodedStr.length / 8; i++) { |
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.
consider changing the loop
src/crypto_utils.ts
Outdated
functionSelector: string | ||
) { | ||
// consider improving address validation | ||
if (plaintext.substring(0, 2) !== '0x' || plaintext.length !== 42) { |
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.
did you consider using
const { utils } = require('ethers')
utils.isAddress(address)
functionSelector | ||
) | ||
|
||
const inputText = { |
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.
i think we should enhance it to a datatype of some ciphered address to manage the 3 parts away from the user
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.
Do you mean something like this?
src/crypto_utils.ts
Outdated
@@ -191,16 +253,40 @@ export function decryptUint(ciphertext: bigint, userKey: string): bigint { | |||
return decodeUint(decryptedMessage) | |||
} | |||
|
|||
export function decryptString(ciphertext: Array<bigint>, userKey: string): string { | |||
let decryptedStr = new Array<number>(ciphertext.length) | |||
export function decryptString(ciphertext: { value: bigint[] }, userKey: string): string { |
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.
not sure on this code with the #18 changes - we need to review final look
4fdc8ea
to
50ade23
Compare
src/crypto_utils.ts
Outdated
// We use 8 bytes since we will use ctUint64 to store | ||
// each chunk of 8 characters | ||
for (let i = 0; i < encodedStr.length; i += EIGHT_BYTES) { | ||
const startIdx = i |
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.
same comment i guess some how it is the same change?
968ccda
to
e8aac4d
Compare
e8aac4d
to
0183765
Compare
Quality Gate passedIssues Measures |
No description provided.