• 0 Posts
  • 49 Comments
Joined 1 year ago
cake
Cake day: June 19th, 2023

help-circle






  • Killing_Spark@feddit.detoProgrammer Humor@lemmy.mlgot him
    link
    fedilink
    arrow-up
    1
    ·
    edit-2
    2 months ago

    This point advocates against the use of mod with content in a file unless it is used for a testing module. A common pattern is to have the unit tests for a module inside the main module file. Tests in rust are just specially tagged functions. To avoid compilation costs in non-test builds and false unused code warnings you can put all test related code in a submodule and tag that module with #[cfg(test)]. That way the module will only be included and compiled if the crate is being compiled to run tests.

    The Star wars thing refers to scrolling long text files similar to the intro of the starwars movies where a long text is scrolled for the viewer.


  • mod name declares that the module should be compiled and reachable as a submodule of the current module. This assumes that you have a file or directory of the name in the right place. This is what you should do.

    You can also declare a module like this: mod name {...} where you just put the content in the block. The two are functionally equivalent, from the compilers perspective.









  • So the attack is (very basically, if I understand correctly)

    Setup:

    • I control at least one process on the machine I am targeting another process on
    • I can send data to the target process and the process will decrypt that

    Attack:

    • I send data that in some intermediate state of decryption will look like a pointer
    • This “pointer” contains some information about the secret key I am trying to steal
    • The prefetcher does it’s thing loading the data “pointed to” in the cache
    • I can observe via a cache side channel what the prefetcher did, giving me this “pointer” containing information about the secret key
    • Repeat until I have gathered enough information about the secret key

    Is this somewhat correct? Those speculative execution vulnerabilities always make my brain hurt a little