Skip to content
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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

smiller-coti
Copy link

No description provided.

signature: new Array<Uint8Array>
}

for (let i = 0; i < encodedStr.length / 8; i++) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

consider changing the loop

functionSelector: string
) {
// consider improving address validation
if (plaintext.substring(0, 2) !== '0x' || plaintext.length !== 42) {
Copy link
Member

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 = {
Copy link
Member

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

Copy link
Author

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?

@@ -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 {
Copy link
Member

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

@smiller-coti smiller-coti force-pushed the smiller-coti/ctAddress branch 2 times, most recently from 4fdc8ea to 50ade23 Compare September 25, 2024 09:12
// 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
Copy link
Member

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?

@smiller-coti smiller-coti force-pushed the smiller-coti/ctAddress branch 2 times, most recently from 968ccda to e8aac4d Compare September 29, 2024 06:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants